r16363 - trunk/libavformat/sierravmd.c
Author: kostya Date: Sat Dec 27 18:34:00 2008 New Revision: 16363 Log: Latest Coktel Vision VMDs contained Indeo 3, add demuxer support for it Modified: trunk/libavformat/sierravmd.c Modified: trunk/libavformat/sierravmd.c ============================================================================== --- trunk/libavformat/sierravmd.c Sat Dec 27 17:25:36 2008 (r16362) +++ trunk/libavformat/sierravmd.c Sat Dec 27 18:34:00 2008 (r16363) @@ -49,6 +49,7 @@ typedef struct VmdDemuxContext { unsigned int frames_per_block; vmd_frame *frame_table; unsigned int current_frame; + int is_indeo3; int sample_rate; int64_t audio_sample_counter; @@ -91,6 +92,10 @@ static int vmd_read_header(AVFormatConte if (get_buffer(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE) return AVERROR(EIO); + if(vmd->vmd_header[16] == 'i' && vmd->vmd_header[17] == 'v' && vmd->vmd_header[18] == '3') + vmd->is_indeo3 = 1; + else + vmd->is_indeo3 = 1; /* start up the decoders */ vst = av_new_stream(s, 0); if (!vst) @@ -98,10 +103,14 @@ static int vmd_read_header(AVFormatConte av_set_pts_info(vst, 33, 1, 10); vmd->video_stream_index = vst->index; vst->codec->codec_type = CODEC_TYPE_VIDEO; - vst->codec->codec_id = CODEC_ID_VMDVIDEO; + vst->codec->codec_id = vmd->is_indeo3 ? CODEC_ID_INDEO3 : CODEC_ID_VMDVIDEO; vst->codec->codec_tag = 0; /* no fourcc */ vst->codec->width = AV_RL16(&vmd->vmd_header[12]); vst->codec->height = AV_RL16(&vmd->vmd_header[14]); + if(vmd->is_indeo3 && vst->codec->width > 320){ + vst->codec->width >>= 1; + vst->codec->height >>= 1; + } vst->codec->extradata_size = VMD_HEADER_SIZE; vst->codec->extradata = av_mallocz(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(vst->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE); @@ -261,8 +270,11 @@ static int vmd_read_packet(AVFormatConte return AVERROR(ENOMEM); pkt->pos= url_ftell(pb); memcpy(pkt->data, frame->frame_record, BYTES_PER_FRAME_RECORD); - ret = get_buffer(pb, pkt->data + BYTES_PER_FRAME_RECORD, - frame->frame_size); + if(vmd->is_indeo3) + ret = get_buffer(pb, pkt->data, frame->frame_size); + else + ret = get_buffer(pb, pkt->data + BYTES_PER_FRAME_RECORD, + frame->frame_size); if (ret != frame->frame_size) { av_free_packet(pkt);
2008/12/27 kostya <subversion at mplayerhq.hu>:
Author: kostya Date: Sat Dec 27 18:34:00 2008 New Revision: 16363
Log: Latest Coktel Vision VMDs contained Indeo 3, add demuxer support for it
Modified: trunk/libavformat/sierravmd.c
Modified: trunk/libavformat/sierravmd.c ============================================================================== --- trunk/libavformat/sierravmd.c Sat Dec 27 17:25:36 2008 (r16362) +++ trunk/libavformat/sierravmd.c Sat Dec 27 18:34:00 2008 (r16363) @@ -49,6 +49,7 @@ typedef struct VmdDemuxContext { unsigned int frames_per_block; vmd_frame *frame_table; unsigned int current_frame; + int is_indeo3;
int sample_rate; int64_t audio_sample_counter; @@ -91,6 +92,10 @@ static int vmd_read_header(AVFormatConte if (get_buffer(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE) return AVERROR(EIO);
+ if(vmd->vmd_header[16] == 'i' && vmd->vmd_header[17] == 'v' && vmd->vmd_header[18] == '3') + vmd->is_indeo3 = 1; + else + vmd->is_indeo3 = 1;
So vmd->is_indeo3 == 1 always? Was that intentional? Regards, Rob
On Sun, Dec 28, 2008 at 03:35:08PM +0000, Robert Swain wrote:
2008/12/27 kostya <subversion at mplayerhq.hu>:
Author: kostya Date: Sat Dec 27 18:34:00 2008 New Revision: 16363
Log: Latest Coktel Vision VMDs contained Indeo 3, add demuxer support for it
Modified: trunk/libavformat/sierravmd.c
Modified: trunk/libavformat/sierravmd.c ============================================================================== --- trunk/libavformat/sierravmd.c Sat Dec 27 17:25:36 2008 (r16362) +++ trunk/libavformat/sierravmd.c Sat Dec 27 18:34:00 2008 (r16363) @@ -49,6 +49,7 @@ typedef struct VmdDemuxContext { unsigned int frames_per_block; vmd_frame *frame_table; unsigned int current_frame; + int is_indeo3;
int sample_rate; int64_t audio_sample_counter; @@ -91,6 +92,10 @@ static int vmd_read_header(AVFormatConte if (get_buffer(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE) return AVERROR(EIO);
+ if(vmd->vmd_header[16] == 'i' && vmd->vmd_header[17] == 'v' && vmd->vmd_header[18] == '3') + vmd->is_indeo3 = 1; + else + vmd->is_indeo3 = 1;
So vmd->is_indeo3 == 1 always? Was that intentional?
Of course not. Thanks for spotting (since there are only two people who care about VMD and the other one even has not added it to Fate tests suite, it could be long before finding it out).
Regards, Rob
2008/12/28 Kostya <kostya.shishkov at gmail.com>:
On Sun, Dec 28, 2008 at 03:35:08PM +0000, Robert Swain wrote:
2008/12/27 kostya <subversion at mplayerhq.hu>:
Author: kostya Date: Sat Dec 27 18:34:00 2008 New Revision: 16363
Log: Latest Coktel Vision VMDs contained Indeo 3, add demuxer support for it
Modified: trunk/libavformat/sierravmd.c
Modified: trunk/libavformat/sierravmd.c ============================================================================== --- trunk/libavformat/sierravmd.c Sat Dec 27 17:25:36 2008 (r16362) +++ trunk/libavformat/sierravmd.c Sat Dec 27 18:34:00 2008 (r16363) @@ -49,6 +49,7 @@ typedef struct VmdDemuxContext { unsigned int frames_per_block; vmd_frame *frame_table; unsigned int current_frame; + int is_indeo3;
int sample_rate; int64_t audio_sample_counter; @@ -91,6 +92,10 @@ static int vmd_read_header(AVFormatConte if (get_buffer(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE) return AVERROR(EIO);
+ if(vmd->vmd_header[16] == 'i' && vmd->vmd_header[17] == 'v' && vmd->vmd_header[18] == '3') + vmd->is_indeo3 = 1; + else + vmd->is_indeo3 = 1;
So vmd->is_indeo3 == 1 always? Was that intentional?
Of course not. Thanks for spotting (since there are only two people who care about VMD and the other one even has not added it to Fate tests suite, it could be long before finding it out).
Credit goes to Trax' on IRC for spotting it, I just proxy-ed the complaint. :) Rob
Kostya wrote:
On Sun, Dec 28, 2008 at 03:35:08PM +0000, Robert Swain wrote:
2008/12/27 kostya <subversion at mplayerhq.hu>:
Author: kostya Date: Sat Dec 27 18:34:00 2008 New Revision: 16363
Log: Latest Coktel Vision VMDs contained Indeo 3, add demuxer support for it
Modified: trunk/libavformat/sierravmd.c
Modified: trunk/libavformat/sierravmd.c ============================================================================== --- trunk/libavformat/sierravmd.c Sat Dec 27 17:25:36 2008 (r16362) +++ trunk/libavformat/sierravmd.c Sat Dec 27 18:34:00 2008 (r16363) @@ -49,6 +49,7 @@ typedef struct VmdDemuxContext { unsigned int frames_per_block; vmd_frame *frame_table; unsigned int current_frame; + int is_indeo3;
int sample_rate; int64_t audio_sample_counter; @@ -91,6 +92,10 @@ static int vmd_read_header(AVFormatConte if (get_buffer(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE) return AVERROR(EIO);
+ if(vmd->vmd_header[16] == 'i' && vmd->vmd_header[17] == 'v' && vmd->vmd_header[18] == '3') + vmd->is_indeo3 = 1; + else + vmd->is_indeo3 = 1; So vmd->is_indeo3 == 1 always? Was that intentional?
Of course not. Thanks for spotting (since there are only two people who care about VMD and the other one even has not added it to Fate tests suite, it could be long before finding it out).
According to my notes, I had trouble getting the VMD system to work when I was first trying to add a FATE test, which would make such a test meaningless. I will investigate it again soon to see if the situation improves. I suspect we will need several VMD tests for different generations of files. -- -Mike Melanson
participants (4)
-
kostya.shishkov@gmail.com -
mike@multimedia.cx -
robert.swain@gmail.com -
subversion@mplayerhq.hu