From 11f80ecdc6f8855eb8c30b5227d6d1abac793ac4 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 7 May 2008 09:47:57 +0000 Subject: [PATCH] ext/ffmpeg/gstffmpegdec.c: Bump the priority of VC1 decoder so that it goes before the WMV3 decoder. This allows prop... Original commit message from CVS: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_setcaps), (gst_ffmpegdec_video_frame), (gst_ffmpegdec_register): Bump the priority of VC1 decoder so that it goes before the WMV3 decoder. This allows proper auto-pluggin with decodebin/playbin. Fixes #531857 --- ChangeLog | 8 ++++++++ ext/ffmpeg/gstffmpegdec.c | 19 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92a894e..8e43869 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-07 Edward Hervey + + * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_setcaps), + (gst_ffmpegdec_video_frame), (gst_ffmpegdec_register): + Bump the priority of VC1 decoder so that it goes before the WMV3 + decoder. This allows proper auto-pluggin with decodebin/playbin. + Fixes #531857 + 2008-05-06 Edward Hervey Patch by: Gabriel Bouvigne diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 9ef013e..843b91a 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -612,6 +612,19 @@ gst_ffmpegdec_setcaps (GstPad * pad, GstCaps * caps) GST_OBJECT_LOCK (ffmpegdec); + /* stupid check for VC1 */ + if (oclass->in_plugin->id == CODEC_ID_WMV3) { + enum CodecID cid; + + /* Get the code id and check it's the same as the incoming caps */ + cid = gst_ffmpeg_caps_to_codecid (caps, NULL); + if (cid != CODEC_ID_WMV3) { + ret = FALSE; + GST_WARNING ("This decoder handles WMV3 and not VC1!"); + goto done; + } + } + /* close old session */ gst_ffmpegdec_close (ffmpegdec); @@ -1504,8 +1517,7 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec, * ffmpeg timestamp and the interpollated next timestamp invalid. */ out_pts = -1; ffmpegdec->next_ts = -1; - } - else + } else ffmpegdec->last_out = out_pts; if (ffmpegdec->ts_is_dts) { @@ -2526,6 +2538,9 @@ gst_ffmpegdec_register (GstPlugin * plugin) case CODEC_ID_MPEG2VIDEO: rank = GST_RANK_NONE; break; + case CODEC_ID_VC1: + rank = GST_RANK_MARGINAL + 1; + break; default: rank = GST_RANK_MARGINAL; break; -- 2.7.4