Add MDEC tags to Electronic Arts demuxer.
Originally committed as revision 14679 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
0281d32550
commit
d9d9a8c028
@ -41,6 +41,7 @@
|
|||||||
#define SCEl_TAG MKTAG('S', 'C', 'E', 'l')
|
#define SCEl_TAG MKTAG('S', 'C', 'E', 'l')
|
||||||
#define kVGT_TAG MKTAG('k', 'V', 'G', 'T') /* TGV i-frame */
|
#define kVGT_TAG MKTAG('k', 'V', 'G', 'T') /* TGV i-frame */
|
||||||
#define fVGT_TAG MKTAG('f', 'V', 'G', 'T') /* TGV p-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 MADk_TAG MKTAG('M', 'A', 'D', 'k') /* MAD i-frame */
|
||||||
#define MPCh_TAG MKTAG('M', 'P', 'C', 'h') /* MPEG2 */
|
#define MPCh_TAG MKTAG('M', 'P', 'C', 'h') /* MPEG2 */
|
||||||
#define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
|
#define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
|
||||||
@ -54,6 +55,7 @@ typedef struct EaDemuxContext {
|
|||||||
|
|
||||||
enum CodecID video_codec;
|
enum CodecID video_codec;
|
||||||
AVRational time_base;
|
AVRational time_base;
|
||||||
|
int width, height;
|
||||||
int video_stream_index;
|
int video_stream_index;
|
||||||
|
|
||||||
enum CodecID audio_codec;
|
enum CodecID audio_codec;
|
||||||
@ -245,6 +247,18 @@ static int process_audio_header_sead(AVFormatContext *s)
|
|||||||
return 1;
|
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)
|
static int process_video_header_vp6(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
EaDemuxContext *ea = s->priv_data;
|
EaDemuxContext *ea = s->priv_data;
|
||||||
@ -313,6 +327,10 @@ static int process_ea_header(AVFormatContext *s) {
|
|||||||
ea->time_base = (AVRational){0,0};
|
ea->time_base = (AVRational){0,0};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case mTCD_TAG :
|
||||||
|
err = process_video_header_mdec(s);
|
||||||
|
break;
|
||||||
|
|
||||||
case MVhd_TAG :
|
case MVhd_TAG :
|
||||||
err = process_video_header_vp6(s);
|
err = process_video_header_vp6(s);
|
||||||
break;
|
break;
|
||||||
@ -367,6 +385,8 @@ static int ea_read_header(AVFormatContext *s,
|
|||||||
st->codec->codec_id = ea->video_codec;
|
st->codec->codec_id = ea->video_codec;
|
||||||
st->codec->codec_tag = 0; /* no fourcc */
|
st->codec->codec_tag = 0; /* no fourcc */
|
||||||
st->codec->time_base = ea->time_base;
|
st->codec->time_base = ea->time_base;
|
||||||
|
st->codec->width = ea->width;
|
||||||
|
st->codec->height = ea->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ea->audio_codec) {
|
if (ea->audio_codec) {
|
||||||
@ -464,6 +484,11 @@ static int ea_read_packet(AVFormatContext *s,
|
|||||||
chunk_size += 8;
|
chunk_size += 8;
|
||||||
goto get_video_packet;
|
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:
|
case MV0K_TAG:
|
||||||
key = PKT_FLAG_KEY;
|
key = PKT_FLAG_KEY;
|
||||||
case MV0F_TAG:
|
case MV0F_TAG:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user