00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 #ifndef AVFORMAT_SWF_H
00024 #define AVFORMAT_SWF_H
00025 
00026 #include "config.h"
00027 
00028 #if CONFIG_ZLIB
00029 #include <zlib.h>
00030 #endif
00031 
00032 #include "libavutil/fifo.h"
00033 #include "avformat.h"
00034 #include "avio.h"
00035 #include "riff.h"    
00036 
00037 
00038 #define DUMMY_FILE_SIZE   (100 * 1024 * 1024)
00039 #define DUMMY_DURATION    600 
00040 
00041 #define TAG_END           0
00042 #define TAG_SHOWFRAME     1
00043 #define TAG_DEFINESHAPE   2
00044 #define TAG_FREECHARACTER 3
00045 #define TAG_PLACEOBJECT   4
00046 #define TAG_REMOVEOBJECT  5
00047 #define TAG_STREAMHEAD    18
00048 #define TAG_STREAMBLOCK   19
00049 #define TAG_JPEG2         21
00050 #define TAG_PLACEOBJECT2  26
00051 #define TAG_STREAMHEAD2   45
00052 #define TAG_VIDEOSTREAM   60
00053 #define TAG_VIDEOFRAME    61
00054 #define TAG_FILEATTRIBUTES 69
00055 
00056 #define TAG_LONG         0x100
00057 
00058 
00059 #define FLAG_MOVETO      0x01
00060 #define FLAG_SETFILL0    0x02
00061 #define FLAG_SETFILL1    0x04
00062 
00063 #define AUDIO_FIFO_SIZE 65536
00064 
00065 
00066 #define BITMAP_ID 0
00067 #define VIDEO_ID 0
00068 #define SHAPE_ID  1
00069 
00070 #undef NDEBUG
00071 #include <assert.h>
00072 
00073 typedef struct {
00074     int64_t duration_pos;
00075     int64_t tag_pos;
00076     int64_t vframes_pos;
00077     int samples_per_frame;
00078     int sound_samples;
00079     int swf_frame_number;
00080     int video_frame_number;
00081     int frame_rate;
00082     int tag;
00083     AVFifoBuffer *audio_fifo;
00084     AVCodecContext *audio_enc, *video_enc;
00085 #if CONFIG_ZLIB
00086     AVIOContext *zpb;
00087 #define ZBUF_SIZE 4096
00088     uint8_t *zbuf_in;
00089     uint8_t *zbuf_out;
00090     z_stream zstream;
00091 #endif
00092 } SWFContext;
00093 
00094 extern const AVCodecTag ff_swf_codec_tags[];
00095 
00096 #endif