FFmpeg
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 typedef struct SWFContext {
124  int64_t duration_pos;
125  int64_t tag_pos;
126  int64_t vframes_pos;
132  int tag;
136 #if CONFIG_ZLIB
137 #define ZBUF_SIZE 4096
138  AVIOContext *zpb;
139  uint8_t *zbuf_in;
140  uint8_t *zbuf_out;
141  z_stream zstream;
142 #endif
143 } SWFContext;
144 
145 extern const AVCodecTag ff_swf_codec_tags[];
146 
147 #endif /* AVFORMAT_SWF_H */
SWFContext::video_frame_number
int video_frame_number
Definition: swf.h:130
TAG_STREAMHEAD
@ TAG_STREAMHEAD
Definition: swf.h:59
SWFContext
Definition: swf.h:123
TAG_DEFINEFONT3
@ TAG_DEFINEFONT3
Definition: swf.h:94
TAG_DEFINETEXT2
@ TAG_DEFINETEXT2
Definition: swf.h:69
TAG_END
@ TAG_END
Definition: swf.h:42
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:52
SWFContext::duration_pos
int64_t duration_pos
Definition: swf.h:124
SWFContext::sound_samples
int sound_samples
Definition: swf.h:128
SWFContext::video_par
AVCodecParameters * video_par
Definition: swf.h:134
TAG_DEFINESHAPE
@ TAG_DEFINESHAPE
Definition: swf.h:44
TAG_DEFINEBITSJPEG3
@ TAG_DEFINEBITSJPEG3
Definition: swf.h:71
TAG_PROTECT
@ TAG_PROTECT
Definition: swf.h:65
TAG_DEFINEFONT4
@ TAG_DEFINEFONT4
Definition: swf.h:106
TAG_DEFINEBUTTON2
@ TAG_DEFINEBUTTON2
Definition: swf.h:70
TAG_EXPORTASSETS
@ TAG_EXPORTASSETS
Definition: swf.h:79
TAG_STARTSOUND2
@ TAG_STARTSOUND2
Definition: swf.h:104
AVFifoBuffer
Definition: fifo.h:31
fifo.h
TAG_DEFINEMORPHSHAPE
@ TAG_DEFINEMORPHSHAPE
Definition: swf.h:77
TAG_PLACEOBJECT3
@ TAG_PLACEOBJECT3
Definition: swf.h:90
TAG_IMPORTASSETS
@ TAG_IMPORTASSETS
Definition: swf.h:80
TAG_DOINITACTION
@ TAG_DOINITACTION
Definition: swf.h:82
SWFContext::vframes_pos
int64_t vframes_pos
Definition: swf.h:126
TAG_DEFINEFONTALIGNZONES
@ TAG_DEFINEFONTALIGNZONES
Definition: swf.h:92
ff_swf_codec_tags
const AVCodecTag ff_swf_codec_tags[]
Definition: swf.c:25
AVCodecTag
Definition: internal.h:42
TAG_METADATA
@ TAG_METADATA
Definition: swf.h:96
TAG_DEFINESHAPE2
@ TAG_DEFINESHAPE2
Definition: swf.h:63
TAG_REMOVEOBJECT2
@ TAG_REMOVEOBJECT2
Definition: swf.h:67
TAG_REMOVEOBJECT
@ TAG_REMOVEOBJECT
Definition: swf.h:47
TAG_SETTABINDEX
@ TAG_SETTABINDEX
Definition: swf.h:88
TAG_SETBACKGROUNDCOLOR
@ TAG_SETBACKGROUNDCOLOR
Definition: swf.h:51
TAG_CSMTEXTSETTINGS
@ TAG_CSMTEXTSETTINGS
Definition: swf.h:93
TAG_DEFINEBITSLOSSLESS
@ TAG_DEFINEBITSLOSSLESS
Definition: swf.h:61
TAG_STREAMHEAD2
@ TAG_STREAMHEAD2
Definition: swf.h:76
internal.h
TAG_FREECHARACTER
@ TAG_FREECHARACTER
Definition: swf.h:45
TAG_DEFINEFONT
@ TAG_DEFINEFONT
Definition: swf.h:52
SWFContext::audio_par
AVCodecParameters * audio_par
Definition: swf.h:134
TAG_DEFINEFONTINFO2
@ TAG_DEFINEFONTINFO2
Definition: swf.h:85
TAG_DEFINEBITSJPEG4
@ TAG_DEFINEBITSJPEG4
Definition: swf.h:105
TAG_DEFINESPRITE
@ TAG_DEFINESPRITE
Definition: swf.h:74
AVIOContext
Bytestream IO Context.
Definition: avio.h:161
TAG_FILEATTRIBUTES
@ TAG_FILEATTRIBUTES
Definition: swf.h:89
SWFContext::video_st
AVStream * video_st
Definition: swf.h:135
SWFContext::tag
int tag
Definition: swf.h:132
TAG_ENABLEDEBUGGER
@ TAG_ENABLEDEBUGGER
Definition: swf.h:81
TAG_JPEG2
@ TAG_JPEG2
Definition: swf.h:62
avio.h
TAG_ENABLEDEBUGGER2
@ TAG_ENABLEDEBUGGER2
Definition: swf.h:86
TAG_DEFINESCENEANDFRAMELABELDATA
@ TAG_DEFINESCENEANDFRAMELABELDATA
Definition: swf.h:101
TAG_SYMBOLCLASS
@ TAG_SYMBOLCLASS
Definition: swf.h:95
TAG_DEFINEBINARYDATA
@ TAG_DEFINEBINARYDATA
Definition: swf.h:102
TAG_IMPORTASSETS2
@ TAG_IMPORTASSETS2
Definition: swf.h:91
TAG_DEFINEBUTTONSOUND
@ TAG_DEFINEBUTTONSOUND
Definition: swf.h:58
TAG_DEFINEBITSLOSSLESS2
@ TAG_DEFINEBITSLOSSLESS2
Definition: swf.h:72
TAG_DEFINEEDITTEXT
@ TAG_DEFINEEDITTEXT
Definition: swf.h:73
SWFContext::swf_frame_number
int swf_frame_number
Definition: swf.h:129
TAG_DEFINESHAPE3
@ TAG_DEFINESHAPE3
Definition: swf.h:68
TAG_DEFINESHAPE4
@ TAG_DEFINESHAPE4
Definition: swf.h:99
TAG_DEFINEBUTTONCXFORM
@ TAG_DEFINEBUTTONCXFORM
Definition: swf.h:64
TAG_VIDEOSTREAM
@ TAG_VIDEOSTREAM
Definition: swf.h:83
TAG_PLACEOBJECT
@ TAG_PLACEOBJECT
Definition: swf.h:46
TAG_DEFINETEXT
@ TAG_DEFINETEXT
Definition: swf.h:53
uint8_t
uint8_t
Definition: audio_convert.c:194
TAG_FRAMELABEL
@ TAG_FRAMELABEL
Definition: swf.h:75
SWFContext::frame_rate
int frame_rate
Definition: swf.h:131
TAG_STARTSOUND
@ TAG_STARTSOUND
Definition: swf.h:57
TAG_PLACEOBJECT2
@ TAG_PLACEOBJECT2
Definition: swf.h:66
TAG_SHOWFRAME
@ TAG_SHOWFRAME
Definition: swf.h:43
AVStream
Stream structure.
Definition: avformat.h:865
TAG_SCRIPTLIMITS
@ TAG_SCRIPTLIMITS
Definition: swf.h:87
avformat.h
TAG_JPEGTABLES
@ TAG_JPEGTABLES
Definition: swf.h:50
SWFContext::samples_per_frame
int samples_per_frame
Definition: swf.h:127
TAG_STREAMBLOCK
@ TAG_STREAMBLOCK
Definition: swf.h:60
TAG_DEFINEFONTNAME
@ TAG_DEFINEFONTNAME
Definition: swf.h:103
TAG_DEFINEMORPHSHAPE2
@ TAG_DEFINEMORPHSHAPE2
Definition: swf.h:100
TAG_VIDEOFRAME
@ TAG_VIDEOFRAME
Definition: swf.h:84
TAG_DEFINEBUTTON
@ TAG_DEFINEBUTTON
Definition: swf.h:49
TAG_DEFINEFONTINFO
@ TAG_DEFINEFONTINFO
Definition: swf.h:55
SWFContext::tag_pos
int64_t tag_pos
Definition: swf.h:125
TAG_DEFINESCALINGGRID
@ TAG_DEFINESCALINGGRID
Definition: swf.h:97
TAG_DOABC
@ TAG_DOABC
Definition: swf.h:98
TAG_DOACTION
@ TAG_DOACTION
Definition: swf.h:54
TAG_DEFINEFONT2
@ TAG_DEFINEFONT2
Definition: swf.h:78
SWFContext::audio_fifo
AVFifoBuffer * audio_fifo
Definition: swf.h:133
TAG_DEFINESOUND
@ TAG_DEFINESOUND
Definition: swf.h:56
TAG_DEFINEBITS
@ TAG_DEFINEBITS
Definition: swf.h:48