diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2002-05-20 16:31:13 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2002-05-20 16:31:13 +0000 |
commit | c9a65ca8c306071b3c359b56a384a1594cd505df (patch) | |
tree | a33c4b156673f2c1404042501c1cebaae6a35457 /libav/swf.c | |
parent | db7f1f95acc050bb5ddf62b0008eab8c8305d369 (diff) | |
download | ffmpeg-c9a65ca8c306071b3c359b56a384a1594cd505df.tar.gz |
converted to new API
Originally committed as revision 547 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/swf.c')
-rw-r--r-- | libav/swf.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/libav/swf.c b/libav/swf.c index 092f1d72c6..79ef4bba51 100644 --- a/libav/swf.c +++ b/libav/swf.c @@ -438,6 +438,19 @@ static int get_swf_tag(ByteIOContext *pb, int *len_ptr) return tag; } + +static int swf_probe(AVProbeData *p) +{ + /* check file header */ + if (p->buf_size <= 16) + return 0; + if (p->buf[0] == 'F' && p->buf[1] == 'W' && + p->buf[2] == 'S' && p->buf[3] == '\0') + return AVPROBE_SCORE_MAX; + else + return 0; +} + static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) { ByteIOContext *pb = &s->pb; @@ -528,18 +541,32 @@ static int swf_read_close(AVFormatContext *s) return 0; } -AVFormat swf_format = { +static AVInputFormat swf_iformat = { + "swf", + "Flash format", + 0, + swf_probe, + swf_read_header, + swf_read_packet, + swf_read_close, +}; + +static AVOutputFormat swf_oformat = { "swf", "Flash format", "application/x-shockwave-flash", "swf", + sizeof(SWFContext), CODEC_ID_MP2, CODEC_ID_MJPEG, swf_write_header, swf_write_packet, swf_write_trailer, - - swf_read_header, - swf_read_packet, - swf_read_close, }; + +int swf_init(void) +{ + av_register_input_format(&swf_iformat); + av_register_output_format(&swf_oformat); + return 0; +} |