swf.h
Go to the documentation of this file.
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 
23 #ifndef AVFORMAT_SWF_H
24 #define AVFORMAT_SWF_H
25 
26 #include "config.h"
27 
28 #if CONFIG_ZLIB
29 #include <zlib.h>
30 #endif
31 
32 #include "libavutil/fifo.h"
33 #include "avformat.h"
34 #include "avio.h"
35 #include "internal.h"
36 
37 /* should have a generic way to indicate probable size */
38 #define DUMMY_FILE_SIZE (100 * 1024 * 1024)
39 #define DUMMY_DURATION 600 /* in seconds */
40 
41 enum {
42  TAG_END = 0,
62  TAG_JPEG2 = 21,
98  TAG_DOABC = 82,
107 };
108 
109 #define TAG_LONG 0x100
110 
111 /* flags for shape definition */
112 #define FLAG_MOVETO 0x01
113 #define FLAG_SETFILL0 0x02
114 #define FLAG_SETFILL1 0x04
115 
116 #define AUDIO_FIFO_SIZE 65536
117 
118 /* character id used */
119 #define BITMAP_ID 0
120 #define VIDEO_ID 0
121 #define SHAPE_ID 1
122 
123 #undef NDEBUG
124 #include <assert.h>
125 
126 typedef struct SWFContext {
127  int64_t duration_pos;
128  int64_t tag_pos;
129  int64_t vframes_pos;
135  int tag;
138 #if CONFIG_ZLIB
139  AVIOContext *zpb;
140 #define ZBUF_SIZE 4096
141  uint8_t *zbuf_in;
142  uint8_t *zbuf_out;
143  z_stream zstream;
144 #endif
145 } SWFContext;
146 
147 extern const AVCodecTag ff_swf_codec_tags[];
148 
149 #endif /* AVFORMAT_SWF_H */
Definition: swf.h:42
Bytestream IO Context.
Definition: avio.h:68
Buffered I/O operations.
Definition: swf.h:98
int frame_rate
Definition: swf.h:134
uint8_t
int swf_frame_number
Definition: swf.h:132
Definition: swf.h:62
int video_frame_number
Definition: swf.h:133
int sound_samples
Definition: swf.h:131
int samples_per_frame
Definition: swf.h:130
struct SWFContext SWFContext
const AVCodecTag ff_swf_codec_tags[]
Definition: swf.c:25
AVCodecContext * audio_enc
Definition: swf.h:137
main external API structure.
a very simple circular buffer FIFO implementation
AVCodecContext * video_enc
Definition: swf.h:137
int64_t vframes_pos
Definition: swf.h:129
Main libavformat public API header.
int64_t tag_pos
Definition: swf.h:128
int tag
Definition: swf.h:135
AVFifoBuffer * audio_fifo
Definition: swf.h:136
int64_t duration_pos
Definition: swf.h:127