Mercurial > libavformat.hg
changeset 3704:03f3eca1498a libavformat
Add MDEC tags to Electronic Arts demuxer.
author | pross |
---|---|
date | Sun, 10 Aug 2008 01:58:46 +0000 |
parents | ff3b10be0cc7 |
children | 98156a539790 |
files | electronicarts.c |
diffstat | 1 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/electronicarts.c Sun Aug 10 00:28:56 2008 +0000 +++ b/electronicarts.c Sun Aug 10 01:58:46 2008 +0000 @@ -41,6 +41,7 @@ #define SCEl_TAG MKTAG('S', 'C', 'E', 'l') #define kVGT_TAG MKTAG('k', 'V', 'G', 'T') /* TGV i-frame */ #define fVGT_TAG MKTAG('f', 'V', 'G', 'T') /* TGV p-frame */ +#define mTCD_TAG MKTAG('m', 'T', 'C', 'D') /* MDEC */ #define MADk_TAG MKTAG('M', 'A', 'D', 'k') /* MAD i-frame */ #define MPCh_TAG MKTAG('M', 'P', 'C', 'h') /* MPEG2 */ #define MVhd_TAG MKTAG('M', 'V', 'h', 'd') @@ -54,6 +55,7 @@ enum CodecID video_codec; AVRational time_base; + int width, height; int video_stream_index; enum CodecID audio_codec; @@ -245,6 +247,18 @@ return 1; } +static int process_video_header_mdec(AVFormatContext *s) +{ + EaDemuxContext *ea = s->priv_data; + ByteIOContext *pb = s->pb; + url_fskip(pb, 4); + ea->width = get_le16(pb); + ea->height = get_le16(pb); + ea->time_base = (AVRational){1,15}; + ea->video_codec = CODEC_ID_MDEC; + return 1; +} + static int process_video_header_vp6(AVFormatContext *s) { EaDemuxContext *ea = s->priv_data; @@ -313,6 +327,10 @@ ea->time_base = (AVRational){0,0}; break; + case mTCD_TAG : + err = process_video_header_mdec(s); + break; + case MVhd_TAG : err = process_video_header_vp6(s); break; @@ -367,6 +385,8 @@ st->codec->codec_id = ea->video_codec; st->codec->codec_tag = 0; /* no fourcc */ st->codec->time_base = ea->time_base; + st->codec->width = ea->width; + st->codec->height = ea->height; } if (ea->audio_codec) { @@ -464,6 +484,11 @@ chunk_size += 8; goto get_video_packet; + case mTCD_TAG: + url_fseek(pb, 8, SEEK_CUR); // skip ea dct header + chunk_size -= 8; + goto get_video_packet; + case MV0K_TAG: key = PKT_FLAG_KEY; case MV0F_TAG: