You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.5KB

  1. /*
  2. * Flash Compatible Streaming Format common header.
  3. * Copyright (c) 2000 Fabrice Bellard.
  4. * Copyright (c) 2003 Tinic Uro.
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #ifndef FFMPEG_SWF_H
  23. #define FFMPEG_SWF_H
  24. #include "avformat.h"
  25. #include "riff.h" /* for CodecTag */
  26. /* should have a generic way to indicate probable size */
  27. #define DUMMY_FILE_SIZE (100 * 1024 * 1024)
  28. #define DUMMY_DURATION 600 /* in seconds */
  29. #define TAG_END 0
  30. #define TAG_SHOWFRAME 1
  31. #define TAG_DEFINESHAPE 2
  32. #define TAG_FREECHARACTER 3
  33. #define TAG_PLACEOBJECT 4
  34. #define TAG_REMOVEOBJECT 5
  35. #define TAG_STREAMHEAD 18
  36. #define TAG_STREAMBLOCK 19
  37. #define TAG_JPEG2 21
  38. #define TAG_PLACEOBJECT2 26
  39. #define TAG_STREAMHEAD2 45
  40. #define TAG_VIDEOSTREAM 60
  41. #define TAG_VIDEOFRAME 61
  42. #define TAG_FILEATTRIBUTES 69
  43. #define TAG_LONG 0x100
  44. /* flags for shape definition */
  45. #define FLAG_MOVETO 0x01
  46. #define FLAG_SETFILL0 0x02
  47. #define FLAG_SETFILL1 0x04
  48. #define AUDIO_FIFO_SIZE 65536
  49. /* character id used */
  50. #define BITMAP_ID 0
  51. #define VIDEO_ID 0
  52. #define SHAPE_ID 1
  53. #undef NDEBUG
  54. #include <assert.h>
  55. typedef struct {
  56. int audio_stream_index;
  57. offset_t duration_pos;
  58. offset_t tag_pos;
  59. int samples_per_frame;
  60. int sound_samples;
  61. int swf_frame_number;
  62. int video_frame_number;
  63. int frame_rate;
  64. int tag;
  65. uint8_t audio_fifo[AUDIO_FIFO_SIZE];
  66. int audio_in_pos;
  67. int video_type;
  68. int audio_type;
  69. } SWFContext;
  70. static const AVCodecTag swf_codec_tags[] = {
  71. {CODEC_ID_FLV1, 0x02},
  72. {CODEC_ID_VP6F, 0x04},
  73. {0, 0},
  74. };
  75. static const AVCodecTag swf_audio_codec_tags[] = {
  76. {CODEC_ID_PCM_S16LE, 0x00},
  77. {CODEC_ID_ADPCM_SWF, 0x01},
  78. {CODEC_ID_MP3, 0x02},
  79. {CODEC_ID_PCM_S16LE, 0x03},
  80. //{CODEC_ID_NELLYMOSER, 0x06},
  81. {0, 0},
  82. };
  83. #endif /* FFMPEG_SWF_H */