[FFmpeg-cvslog] r14679 - trunk/libavformat/electronicarts.c
pross
subversion
Sun Aug 10 03:58:46 CEST 2008
Author: pross
Date: Sun Aug 10 03:58:46 2008
New Revision: 14679
Log:
Add MDEC tags to Electronic Arts demuxer.
Modified:
trunk/libavformat/electronicarts.c
Modified: trunk/libavformat/electronicarts.c
==============================================================================
--- trunk/libavformat/electronicarts.c (original)
+++ trunk/libavformat/electronicarts.c Sun Aug 10 03:58:46 2008
@@ -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 @@ typedef struct EaDemuxContext {
enum CodecID video_codec;
AVRational time_base;
+ int width, height;
int video_stream_index;
enum CodecID audio_codec;
@@ -245,6 +247,18 @@ static int process_audio_header_sead(AVF
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 @@ static int process_ea_header(AVFormatCon
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 @@ static int ea_read_header(AVFormatContex
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 @@ static int ea_read_packet(AVFormatContex
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:
More information about the ffmpeg-cvslog
mailing list