+2007-08-07 Wim Taymans <wim.taymans@gmail.com>
+
+ * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_caps_with_codecid):
+ Improve debugging of codec data.
+ realvideo caps are underspecified, use fields of alternative variant
+ before we settle this.
+
+ * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),
+ (gst_ffmpegdec_video_frame):
+ Add more debugging of used parsers.
+ Setup the realvideo slices correctly before calling the decoder, fixed
+ realvideo in matroska.
+
2007-08-01 Stefan Kost <ensonic@users.sf.net>
* ext/ffmpeg/gstffmpegcfg.c: (gst_ffmpeg_cfg_install_property),
av_mallocz (GST_ROUND_UP_16 (size + FF_INPUT_BUFFER_PADDING_SIZE));
memcpy (context->extradata, GST_BUFFER_DATA (buf), size);
context->extradata_size = size;
+ GST_DEBUG ("have codec data of size %d", size);
} else if (context->extradata == NULL) {
/* no extradata, alloc dummy with 0 sized, some codecs insist on reading
* extradata anyway which makes then segfault. */
context->extradata =
av_mallocz (GST_ROUND_UP_16 (FF_INPUT_BUFFER_PADDING_SIZE));
context->extradata_size = 0;
+ GST_DEBUG ("no codec data");
}
switch (codec_id) {
case CODEC_ID_RV40:
{
guint32 fourcc;
+ gint format;
if (gst_structure_get_fourcc (str, "rmsubid", &fourcc))
context->sub_id = fourcc;
- }
+ if (gst_structure_get_int (str, "format", &format))
+ context->sub_id = format;
+
break;
+ }
case CODEC_ID_COOK:
case CODEC_ID_RA_288:
case CODEC_ID_RA_144:
gboolean outoforder;
GstClockTime tstamp1, tstamp2;
GstClockTime dur1, dur2;
+
+ gboolean is_realvideo;
};
typedef struct _GstFFMpegDecClass GstFFMpegDecClass;
goto could_not_open;
ffmpegdec->opened = TRUE;
+ ffmpegdec->is_realvideo = FALSE;
GST_LOG_OBJECT (ffmpegdec, "Opened ffmpeg codec %s, id %d",
oclass->in_plugin->name, oclass->in_plugin->id);
ffmpegdec->pctx = NULL;
}
break;
+ case CODEC_ID_RV10:
+ case CODEC_ID_RV20:
+ ffmpegdec->is_realvideo = TRUE;
+ break;
default:
- GST_LOG_OBJECT (ffmpegdec, "Using parser");
ffmpegdec->pctx = av_parser_init (oclass->in_plugin->id);
+ if (ffmpegdec->pctx)
+ GST_LOG_OBJECT (ffmpegdec, "Using parser %p", ffmpegdec->pctx);
+ else
+ GST_LOG_OBJECT (ffmpegdec, "No parser for codec");
break;
}
/* in case we skip frames */
ffmpegdec->picture->pict_type = -1;
+ if (ffmpegdec->is_realvideo && data != NULL) {
+ gint slice_count;
+ gint i;
+
+ /* setup the slice table for realvideo */
+ if (ffmpegdec->context->slice_offset == NULL)
+ ffmpegdec->context->slice_offset = g_malloc (sizeof (guint32) * 1000);
+
+ slice_count = (*data++) + 1;
+ ffmpegdec->context->slice_count = slice_count;
+
+ for (i = 0; i < slice_count; i++) {
+ data += 4;
+ ffmpegdec->context->slice_offset[i] = GST_READ_UINT32_LE (data);
+ data += 4;
+ }
+ }
+
/* now decode the frame */
len = avcodec_decode_video (ffmpegdec->context,
ffmpegdec->picture, &have_data, data, size);