From 957c728b3d591d2c8a25024e18575db01283784e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 12 Dec 2010 10:54:09 +0100 Subject: [PATCH 01/27] dec: use input timestamp diff for duration estimation Use the diff between input timestamps to estimate the duration when no duration is set on input buffers. Only do this when there are no reordered input timestamps. Improves interpolation in DTS mode when no input duration is set. --- ext/ffmpeg/gstffmpegdec.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index b09b12efd0..20f87511f1 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -96,7 +96,7 @@ struct _GstFFMpegDec gboolean has_b_frames; gboolean reordered_in; GstClockTime last_in; - GstClockTime next_in; + GstClockTime last_diff; gboolean reordered_out; GstClockTime last_out; GstClockTime next_out; @@ -498,7 +498,7 @@ static void gst_ffmpegdec_reset_ts (GstFFMpegDec * ffmpegdec) { ffmpegdec->last_in = GST_CLOCK_TIME_NONE; - ffmpegdec->next_in = GST_CLOCK_TIME_NONE; + ffmpegdec->last_diff = GST_CLOCK_TIME_NONE; ffmpegdec->last_out = GST_CLOCK_TIME_NONE; ffmpegdec->next_out = GST_CLOCK_TIME_NONE; ffmpegdec->reordered_in = FALSE; @@ -1872,6 +1872,9 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec, } else if (GST_CLOCK_TIME_IS_VALID (dec_info->duration)) { GST_LOG_OBJECT (ffmpegdec, "using in_duration"); out_duration = dec_info->duration; + } else if (GST_CLOCK_TIME_IS_VALID (ffmpegdec->last_diff)) { + GST_LOG_OBJECT (ffmpegdec, "using last-diff"); + out_duration = ffmpegdec->last_diff; } else { /* if we have an input framerate, use that */ if (ffmpegdec->format.video.fps_n != -1 && @@ -2482,10 +2485,15 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) if (in_timestamp != -1) { /* check for increasing timestamps if they are jumping backwards, we * probably are dealing with PTS as timestamps */ - if (!ffmpegdec->reordered_in && ffmpegdec->last_in != -1 - && in_timestamp < ffmpegdec->last_in) { - GST_LOG_OBJECT (ffmpegdec, "detected reordered input timestamps"); - ffmpegdec->reordered_in = TRUE; + if (!ffmpegdec->reordered_in && ffmpegdec->last_in != -1) { + if (in_timestamp < ffmpegdec->last_in) { + GST_LOG_OBJECT (ffmpegdec, "detected reordered input timestamps"); + ffmpegdec->reordered_in = TRUE; + ffmpegdec->last_diff = GST_CLOCK_TIME_NONE; + } else if (in_timestamp > ffmpegdec->last_in) { + /* keep track of timestamp diff to estimate duration */ + ffmpegdec->last_diff = in_timestamp - ffmpegdec->last_in; + } } ffmpegdec->last_in = in_timestamp; } From ec48b24291e4587145d012034e76d69761126d43 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 12 Dec 2010 12:38:55 +0100 Subject: [PATCH 02/27] dec: scale the estimated duration by number of frames When estimating the frame duration, the diff between two incomming timestamps should be scaled by the amount of frames in the interval. Improves duration estimation and DTS interpolation. --- ext/ffmpeg/gstffmpegdec.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 20f87511f1..dd8d41dec3 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -97,6 +97,7 @@ struct _GstFFMpegDec gboolean reordered_in; GstClockTime last_in; GstClockTime last_diff; + guint last_frames; gboolean reordered_out; GstClockTime last_out; GstClockTime next_out; @@ -499,6 +500,7 @@ gst_ffmpegdec_reset_ts (GstFFMpegDec * ffmpegdec) { ffmpegdec->last_in = GST_CLOCK_TIME_NONE; ffmpegdec->last_diff = GST_CLOCK_TIME_NONE; + ffmpegdec->last_frames = 0; ffmpegdec->last_out = GST_CLOCK_TIME_NONE; ffmpegdec->next_out = GST_CLOCK_TIME_NONE; ffmpegdec->reordered_in = FALSE; @@ -2491,12 +2493,22 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) ffmpegdec->reordered_in = TRUE; ffmpegdec->last_diff = GST_CLOCK_TIME_NONE; } else if (in_timestamp > ffmpegdec->last_in) { + GstClockTime diff; /* keep track of timestamp diff to estimate duration */ - ffmpegdec->last_diff = in_timestamp - ffmpegdec->last_in; + diff = in_timestamp - ffmpegdec->last_in; + /* need to scale with amount of frames in the interval */ + if (ffmpegdec->last_frames) + diff /= ffmpegdec->last_frames; + + GST_LOG_OBJECT (ffmpegdec, "estimated duration %" GST_TIME_FORMAT " %u", + GST_TIME_ARGS (diff), ffmpegdec->last_frames); + + ffmpegdec->last_diff = diff; } } ffmpegdec->last_in = in_timestamp; } + ffmpegdec->last_frames = 0; GST_LOG_OBJECT (ffmpegdec, "Received new data of size %u, offset:%" G_GUINT64_FORMAT ", ts:%" @@ -2634,6 +2646,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) } else { ffmpegdec->clear_ts = TRUE; } + ffmpegdec->last_frames++; GST_LOG_OBJECT (ffmpegdec, "Before (while bsize>0). bsize:%d , bdata:%p", bsize, bdata); From eb202fde0a3e841345c11a5b0a004ff7fe2482c6 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 13 Dec 2010 16:24:24 +0200 Subject: [PATCH 03/27] Automatic update of common submodule From 011bcc8 to 20742ae --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 011bcc8a0f..20742aee03 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 011bcc8a0fc7f798ee874a7ba899123fb2470e22 +Subproject commit 20742aee033cc7c4aa9a817df005d15d5fa6ba85 From 73f9eed3751214219ad821155de15bfb180e3f26 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 15 Dec 2010 14:56:50 +0200 Subject: [PATCH 04/27] Automatic update of common submodule From 20742ae to 169462a --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 20742aee03..169462a62f 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 20742aee033cc7c4aa9a817df005d15d5fa6ba85 +Subproject commit 169462a62f8b3cb91d721092af13530a3f72a462 From a5910b4ec4dd645b83f3253eb66ce76fc0839335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 16 Dec 2010 10:05:03 +0100 Subject: [PATCH 05/27] ffdeinterlace: Change classification to Filter/Effect/Video/Deinterlace --- ext/ffmpeg/gstffmpegdeinterlace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegdeinterlace.c b/ext/ffmpeg/gstffmpegdeinterlace.c index b140ccfebd..bf87d4539f 100644 --- a/ext/ffmpeg/gstffmpegdeinterlace.c +++ b/ext/ffmpeg/gstffmpegdeinterlace.c @@ -96,7 +96,7 @@ gst_ffmpegdeinterlace_base_init (gpointer g_class) gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_factory)); gst_element_class_set_details_simple (element_class, - "FFMPEG Deinterlace element", "Filter/Converter/Video", + "FFMPEG Deinterlace element", "Filter/Effect/Video/Deinterlace", "Deinterlace video", "Luca Ognibene "); } From dde194dc1a1dfb4b03094d19513d65735702bee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 16 Dec 2010 10:12:02 +0100 Subject: [PATCH 06/27] ffvideoscale: Change classification to Filter/Converter/Video/Scaler --- ext/ffmpeg/gstffmpegscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegscale.c b/ext/ffmpeg/gstffmpegscale.c index 3150cdb310..a8678ae826 100644 --- a/ext/ffmpeg/gstffmpegscale.c +++ b/ext/ffmpeg/gstffmpegscale.c @@ -108,7 +108,7 @@ gst_ffmpegscale_base_init (gpointer g_class) gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_factory)); gst_element_class_set_details_simple (element_class, "FFMPEG Scale element", - "Filter/Converter/Video", + "Filter/Converter/Video/Scaler", "Converts video from one resolution to another", "Luca Ognibene "); } From 31778018270c10b6c225d1d0b96a0dfbc4671977 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 20 Dec 2010 17:47:51 +0100 Subject: [PATCH 07/27] Automatic update of common submodule From 169462a to 46445ad --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 169462a62f..46445ad50f 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 169462a62f8b3cb91d721092af13530a3f72a462 +Subproject commit 46445ad50f184d2640dd205361e0446e9121ba5f From 22d44c87b1f3874c6f57b586a2e404a1fde6d19f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 21 Dec 2010 12:11:32 +0100 Subject: [PATCH 08/27] ffmpgdec: work around parser timestamp bug Sometimes the parser loses track of timestamps and starts to reuse old timestamp. Feed it some dummy data and clear some context variables to work around the problem. --- ext/ffmpeg/gstffmpegdec.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index dd8d41dec3..3e73abdf5d 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -2286,6 +2286,22 @@ gst_ffmpegdec_drain (GstFFMpegDec * ffmpegdec) static void gst_ffmpegdec_flush_pcache (GstFFMpegDec * ffmpegdec) { + if (ffmpegdec->pctx) { + gint res, size, bsize; + guint8 *data; + guint8 bdata[FF_INPUT_BUFFER_PADDING_SIZE]; + + bsize = FF_INPUT_BUFFER_PADDING_SIZE; + memset (bdata, 0, bsize); + + /* parse some dummy data to work around some ffmpeg weirdness where it keeps + * the previous pts around */ + res = av_parser_parse (ffmpegdec->pctx, ffmpegdec->context, + &data, &size, bdata, bsize, -1, -1); + ffmpegdec->pctx->pts = -1; + ffmpegdec->pctx->dts = -1; + } + if (ffmpegdec->pcache) { gst_buffer_unref (ffmpegdec->pcache); ffmpegdec->pcache = NULL; @@ -2535,7 +2551,8 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) GST_LOG_OBJECT (ffmpegdec, "Calling av_parser_parse with offset %" G_GINT64_FORMAT ", ts:%" - GST_TIME_FORMAT, in_offset, GST_TIME_ARGS (in_timestamp)); + GST_TIME_FORMAT " size %d", in_offset, GST_TIME_ARGS (in_timestamp), + bsize); /* feed the parser. We pass the timestamp info so that we can recover all * info again later */ @@ -2543,10 +2560,19 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) &data, &size, bdata, bsize, in_info->idx, in_info->idx); GST_LOG_OBJECT (ffmpegdec, - "parser returned res %d and size %d", res, size); + "parser returned res %d and size %d, id %d", res, size, + ffmpegdec->pctx->pts); /* store pts for decoding */ - dec_info = gst_ts_info_get (ffmpegdec, ffmpegdec->pctx->pts); + if (ffmpegdec->pctx->pts != -1) + dec_info = gst_ts_info_get (ffmpegdec, ffmpegdec->pctx->pts); + else { + /* ffmpeg sometimes loses track after a flush, help it by feeding a + * valid start time */ + ffmpegdec->pctx->pts = in_info->idx; + ffmpegdec->pctx->dts = in_info->idx; + dec_info = in_info; + } GST_LOG_OBJECT (ffmpegdec, "consuming %d bytes. id %d", size, dec_info->idx); From a90df26e15e124d0ee17962ed15c160ca51fef73 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 3 Jan 2011 11:45:04 +0100 Subject: [PATCH 09/27] ffmpegenc: Disable non-audio/video encoders Fixes #629648 --- ext/ffmpeg/gstffmpegenc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c index 3e3b617a2c..f2afb2e0b6 100644 --- a/ext/ffmpeg/gstffmpegenc.c +++ b/ext/ffmpeg/gstffmpegenc.c @@ -1312,6 +1312,11 @@ gst_ffmpegenc_register (GstPlugin * plugin) while (in_plugin) { gchar *type_name; + /* Skip non-AV codecs */ + if (in_plugin->type != CODEC_TYPE_AUDIO && + in_plugin->type != CODEC_TYPE_VIDEO) + goto next; + /* no quasi codecs, please */ if (in_plugin->id == CODEC_ID_RAWVIDEO || in_plugin->id == CODEC_ID_V210 || From 051e2de3d387c611e4c091b19465840e75942266 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 5 Jan 2011 16:59:55 +0100 Subject: [PATCH 10/27] ffmpegdec: Fix unitialized variables on macosx --- ext/ffmpeg/gstffmpegdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 3e73abdf5d..ff9864113e 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -2560,7 +2560,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) &data, &size, bdata, bsize, in_info->idx, in_info->idx); GST_LOG_OBJECT (ffmpegdec, - "parser returned res %d and size %d, id %d", res, size, + "parser returned res %d and size %d, id %" G_GINT64_FORMAT, res, size, ffmpegdec->pctx->pts); /* store pts for decoding */ From 2de5aaf22d6762450857d644e815d858bc0cce65 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 7 Jan 2011 18:08:15 +0100 Subject: [PATCH 11/27] ffmpegdec: Set the mp3 decoder to a rank of NONE It's just causing too many headaches. This will force people to use a working mp3 decoder, like mad. --- ext/ffmpeg/gstffmpegdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index ff9864113e..d3e7c409f9 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -2936,6 +2936,9 @@ gst_ffmpegdec_register (GstPlugin * plugin) case CODEC_ID_SIPR: rank = GST_RANK_SECONDARY; break; + case CODEC_ID_MP3: + rank = GST_RANK_NONE; + break; default: rank = GST_RANK_MARGINAL; break; From b8b627b6b979d66d6c0d328f4566c9b04d4bc30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 10 Jan 2011 14:55:03 +0000 Subject: [PATCH 12/27] Automatic update of common submodule From 46445ad to ccbaa85 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index 46445ad50f..ccbaa85fc5 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 46445ad50f184d2640dd205361e0446e9121ba5f +Subproject commit ccbaa85fc58099fb90f1b5a0fad4d92d45500d19 From 0907606b320547d222f577a53c5ce61cec78247c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 10 Jan 2011 16:37:49 +0000 Subject: [PATCH 13/27] Automatic update of common submodule From ccbaa85 to e572c87 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index ccbaa85fc5..e572c87c58 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit ccbaa85fc58099fb90f1b5a0fad4d92d45500d19 +Subproject commit e572c87c582166a6c65edf2a6a0fa73e31a3b04c From 34b4cb7cf7880670af7907a34361a0c58edbd9fa Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 11 Jan 2011 15:51:38 +0200 Subject: [PATCH 14/27] Automatic update of common submodule From e572c87 to f94d739 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index e572c87c58..f94d739915 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit e572c87c582166a6c65edf2a6a0fa73e31a3b04c +Subproject commit f94d73991563ea2dcae2218b4847e32998f06816 From 60e8ca179fe6620fcff162a66b38d8f59569bbcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 14 Jan 2011 09:35:17 +0000 Subject: [PATCH 15/27] configure: require core 0.10.31 For gst_util_fraction_compare() --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 10d7b577bf..afee896379 100644 --- a/configure.ac +++ b/configure.ac @@ -45,7 +45,7 @@ AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL dnl *** required versions of GStreamer stuff *** -GST_REQ=0.10.22 +GST_REQ=0.10.31 ORC_REQ=0.4.6 dnl *** autotools stuff **** From fdb604d1cff15e16f55b56e1b28c0444b7c16399 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sun, 7 Nov 2010 17:08:04 +0100 Subject: [PATCH 16/27] ffmpegrev: Switch to revision 26402 of ffmpeg This is the last svn revision. They have switched to using git... but since there's still some controversy, we'll stick to this version for the time being and maybe switch to using a git submodule in a month with the same equivalent revision (or newer/older if needed) --- ffmpegrev | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffmpegrev b/ffmpegrev index 773e5d5685..b5f2c5e319 100644 --- a/ffmpegrev +++ b/ffmpegrev @@ -1,6 +1,6 @@ -FFMPEG_REVISION=23623 +FFMPEG_REVISION=26402 FFMPEG_CO_DIR=gst-libs/ext/ffmpeg -FFMPEG_SVN=svn://svn.ffmpeg.org/ffmpeg/branches/0.6 +FFMPEG_SVN=svn://svn.ffmpeg.org/ffmpeg/trunk/ # Because ffmpeg trunk checks out libswscale via an svn:externals, checking # out an old ffmpeg does not check out a corresponding libswscale. # Keep the swscale checkout manually synchronized, then. Update this From e879166d444d27ef4789489c29afe6d73880ef71 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sun, 7 Nov 2010 17:08:19 +0100 Subject: [PATCH 17/27] configure.ac: Don't forget to include new libavcore library --- configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index afee896379..98e02137b2 100644 --- a/configure.ac +++ b/configure.ac @@ -261,8 +261,9 @@ else AC_MSG_NOTICE([Using ffmpeg revision $FFMPEG_REVISION]) dnl libgstffmpeg.la: include dirs - FFMPEG_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavformat \ - -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \ + FFMPEG_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \ + -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavcore \ + -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavformat \ -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavcodec \ -I \$(top_srcdir)/gst-libs/ext/ffmpeg \ -I \$(top_builddir)/gst-libs/ext/ffmpeg \ @@ -271,7 +272,8 @@ else dnl libgstffmpeg.la: libs to statically link to FFMPEG_LIBS="\$(top_builddir)/gst-libs/ext/ffmpeg/libavformat/libavformat.a \ \$(top_builddir)/gst-libs/ext/ffmpeg/libavcodec/libavcodec.a \ - \$(top_builddir)/gst-libs/ext/ffmpeg/libavutil/libavutil.a" + \$(top_builddir)/gst-libs/ext/ffmpeg/libavutil/libavutil.a \ + \$(top_builddir)/gst-libs/ext/ffmpeg/libavcore/libavcore.a" dnl POSTPROC_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libpostproc \ -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \ From ed1b1eefaf8b134ebdd93a791d5bb429ccbca207 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sun, 7 Nov 2010 17:08:50 +0100 Subject: [PATCH 18/27] ffmpegprotocol: Slight API change --- ext/ffmpeg/gstffmpegprotocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegprotocol.c b/ext/ffmpeg/gstffmpegprotocol.c index f46ac286c8..713a8743cc 100644 --- a/ext/ffmpeg/gstffmpegprotocol.c +++ b/ext/ffmpeg/gstffmpegprotocol.c @@ -154,7 +154,7 @@ gst_ffmpegdata_read (URLContext * h, unsigned char *buf, int size) } static int -gst_ffmpegdata_write (URLContext * h, unsigned char *buf, int size) +gst_ffmpegdata_write (URLContext * h, const unsigned char *buf, int size) { GstProtocolInfo *info; GstBuffer *outbuf; From cc4a11831d93d3d1b33ce6ddd86daba8d0d9051c Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 24 Jan 2011 17:20:56 +0100 Subject: [PATCH 19/27] gstffmpegcodecmap: Add some new codec mappings VP8 LAGARITH GSM GSM_MS --- ext/ffmpeg/gstffmpegcodecmap.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index e170832036..cdb1a7cc53 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -943,6 +943,10 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, caps = gst_ff_vid_caps_new (context, codec_id, "video/x-vp6-alpha", NULL); break; + case CODEC_ID_VP8: + caps = gst_ff_vid_caps_new (context, codec_id, "video/x-vp8", NULL); + break; + case CODEC_ID_THEORA: caps = gst_ff_vid_caps_new (context, codec_id, "video/x-theora", NULL); break; @@ -1182,6 +1186,10 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, caps = gst_ff_vid_caps_new (context, codec_id, "video/x-zmbv", NULL); break; + case CODEC_ID_LAGARITH: + caps = gst_ff_vid_caps_new (context, codec_id, "video/x-lagarith", NULL); + break; + case CODEC_ID_WS_VQA: case CODEC_ID_IDCIN: @@ -1430,6 +1438,14 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, caps = gst_ff_aud_caps_new (context, codec_id, "audio/AMR-WB", NULL); break; + case CODEC_ID_GSM: + caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-gsm", NULL); + break; + + case CODEC_ID_GSM_MS: + caps = gst_ff_aud_caps_new (context, codec_id, "audio/ms-gsm", NULL); + break; + case CODEC_ID_NELLYMOSER: caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-nellymoser", NULL); @@ -3073,6 +3089,9 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) } else if (!strcmp (mimetype, "video/x-vp6-alpha")) { id = CODEC_ID_VP6A; video = TRUE; + } else if (!strcmp (mimetype, "video/x-vp8")) { + id = CODEC_ID_VP8; + video = TRUE; } else if (!strcmp (mimetype, "video/x-flash-screen")) { id = CODEC_ID_FLASHSV; video = TRUE; From 9a1d1fef32fc7e6fe009be313527e83e3276d629 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 24 Jan 2011 17:43:44 +0100 Subject: [PATCH 20/27] gstffmpegmux: Blacklist some muxer formats --- ext/ffmpeg/gstffmpegmux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegmux.c b/ext/ffmpeg/gstffmpegmux.c index bedda87513..91138f0a6f 100644 --- a/ext/ffmpeg/gstffmpegmux.c +++ b/ext/ffmpeg/gstffmpegmux.c @@ -903,7 +903,9 @@ gst_ffmpegmux_register (GstPlugin * plugin) (!strncmp (in_plugin->name, "alaw", 4)) || (!strncmp (in_plugin->name, "h26", 3)) || (!strncmp (in_plugin->name, "rtp", 3)) || - (!strncmp (in_plugin->name, "ass", 3)) + (!strncmp (in_plugin->name, "ass", 3)) || + (!strncmp (in_plugin->name, "ffmetadata", 10)) || + (!strncmp (in_plugin->name, "srt", 3)) ) { GST_LOG ("Ignoring muxer %s", in_plugin->name); goto next; From 787910557937673181336f8f27e7f6d12c6e5370 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 24 Jan 2011 18:29:00 +0100 Subject: [PATCH 21/27] gstffmpegdemux: Ignore more pseudo demuxers --- ext/ffmpeg/gstffmpegdemux.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index d7012c4e5e..b5594a6ee9 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -1896,13 +1896,18 @@ gst_ffmpegdemux_register (GstPlugin * plugin) goto next; /* no network demuxers */ - if (!strcmp (in_plugin->name, "sdp") || !strcmp (in_plugin->name, "rtsp")) + if (!strcmp (in_plugin->name, "sdp") || + !strcmp (in_plugin->name, "rtsp") || + !strcmp (in_plugin->name, "applehttp") + ) goto next; /* these don't do what one would expect or * are only partially functional/useful */ if (!strcmp (in_plugin->name, "aac") || - !strcmp (in_plugin->name, "wv") || !strcmp (in_plugin->name, "ass")) + !strcmp (in_plugin->name, "wv") || + !strcmp (in_plugin->name, "ass") || + !strcmp (in_plugin->name, "ffmetadata")) goto next; /* Don't use the typefind functions of formats for which we already have @@ -1914,6 +1919,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin) !strcmp (in_plugin->name, "mpegvideo") || !strcmp (in_plugin->name, "mp3") || !strcmp (in_plugin->name, "matroska") || + !strcmp (in_plugin->name, "matroska_webm") || !strcmp (in_plugin->name, "mpeg") || !strcmp (in_plugin->name, "wav") || !strcmp (in_plugin->name, "au") || From 5429138b890f666a4985e02ab1c5d156a114e512 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 24 Jan 2011 18:29:24 +0100 Subject: [PATCH 22/27] codecmap: Add proper caps name for Camstudio --- ext/ffmpeg/gstffmpegcodecmap.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index cdb1a7cc53..0815443b0e 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -1190,6 +1190,15 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, caps = gst_ff_vid_caps_new (context, codec_id, "video/x-lagarith", NULL); break; + case CODEC_ID_CSCD: + caps = gst_ff_vid_caps_new (context, codec_id, "video/x-camstudio", NULL); + if (context) { + gst_caps_set_simple (caps, + "depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL); + } else { + gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 8, 32, NULL); + } + break; case CODEC_ID_WS_VQA: case CODEC_ID_IDCIN: @@ -1209,7 +1218,6 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, case CODEC_ID_MP3ADU: case CODEC_ID_MP3ON4: case CODEC_ID_WESTWOOD_SND1: - case CODEC_ID_CSCD: case CODEC_ID_MMVIDEO: case CODEC_ID_AVS: case CODEC_ID_CAVS: @@ -2381,6 +2389,7 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id, case CODEC_ID_MSRLE: case CODEC_ID_QTRLE: case CODEC_ID_TSCC: + case CODEC_ID_CSCD: case CODEC_ID_APE: { gint depth; From 199c03a2e040a87a21ffabb4acc256080509ee3f Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 25 Jan 2011 11:30:02 +0100 Subject: [PATCH 23/27] gst-libs: Remove .config file from ffmpeg build when cleaning up --- gst-libs/ext/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/gst-libs/ext/Makefile.am b/gst-libs/ext/Makefile.am index 1c249d72c7..95167f7f1b 100644 --- a/gst-libs/ext/Makefile.am +++ b/gst-libs/ext/Makefile.am @@ -26,6 +26,7 @@ dist-clean: rm -rf $(TMP_DIST_DIR) rm -f Makefile rm -f ffmpeg/.version + rm -f ffmpeg/.config distclean: dist-clean From a2a4ee93c4f86cc890b1ba090531b82c036b0f62 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 25 Jan 2011 16:34:04 +0100 Subject: [PATCH 24/27] codecmap: Add mapping for g722 --- ext/ffmpeg/gstffmpegcodecmap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 0815443b0e..de3bd5f058 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -1293,6 +1293,14 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-alaw", NULL); break; + case CODEC_ID_ADPCM_G722: + caps = gst_ff_aud_caps_new (context, codec_id, "audio/G722", NULL); + if (context) + gst_caps_set_simple (caps, + "block_align", G_TYPE_INT, context->block_align, + "bitrate", G_TYPE_INT, context->bit_rate, NULL); + break; + case CODEC_ID_ADPCM_G726: { /* the G726 decoder can also handle G721 */ From 8d40c6357d024c0a54262429ff688756049b0135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 31 Jan 2011 23:28:33 +0000 Subject: [PATCH 25/27] ffmpegdec: improve error message when set_caps is called but we have no mapping This may happen e.g. if gst-ffmpeg is compiled against an external libavcodec and the external lib is upgraded. See e.g. https://bugzilla.gnome.org/show_bug.cgi?id=640825 --- ext/ffmpeg/gstffmpegdec.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index d3e7c409f9..5704baa9e1 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -1294,9 +1294,22 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force) /* ERRORS */ no_caps: { - GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, (NULL), - ("could not find caps for codec (%s), unknown type", - oclass->in_plugin->name)); +#ifdef HAVE_FFMPEG_UNINSTALLED + /* using internal ffmpeg snapshot */ + GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, + ("Could not find GStreamer caps mapping for FFmpeg codec '%s'.", + oclass->in_plugin->name), (NULL)); +#else + /* using external ffmpeg */ + GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, + ("Could not find GStreamer caps mapping for FFmpeg codec '%s', and " + "you are using an external libavcodec. This is most likely due to " + "a packaging problem and/or libavcodec having been upgraded to a " + "version that is not compatible with this version of " + "gstreamer-ffmpeg. Make sure your gstreamer-ffmpeg and libavcodec " + "packages come from the same source/repository.", + oclass->in_plugin->name), (NULL)); +#endif return FALSE; } caps_failed: From 2bea2467cec23c2e60aecb081ee9e8f484665d01 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 14 Feb 2011 12:54:26 +0200 Subject: [PATCH 26/27] Automatic update of common submodule From f94d739 to 1de7f6a --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index f94d739915..1de7f6ab2d 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit f94d73991563ea2dcae2218b4847e32998f06816 +Subproject commit 1de7f6ab2d4bc1af69f06079cf0f4e2cbbfdc178 From 32ca9c111b511376f86c375463f2ff02d0400f96 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Thu, 10 Feb 2011 12:00:11 +0100 Subject: [PATCH 27/27] ffvideoscale: add support for UYVY Fixes #642015 --- ext/libswscale/gstffmpegscale.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/libswscale/gstffmpegscale.c b/ext/libswscale/gstffmpegscale.c index f69af813bb..f967c207cc 100644 --- a/ext/libswscale/gstffmpegscale.c +++ b/ext/libswscale/gstffmpegscale.c @@ -88,13 +88,13 @@ GST_DEBUG_CATEGORY (ffmpegscale_debug); GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_BGR "; " \ GST_VIDEO_CAPS_xRGB "; " GST_VIDEO_CAPS_xBGR "; " \ GST_VIDEO_CAPS_ARGB "; " GST_VIDEO_CAPS_ABGR "; " \ - GST_VIDEO_CAPS_YUV ("{ I420, YUY2, Y41B, Y42B }") + GST_VIDEO_CAPS_YUV ("{ I420, YUY2, UYVY, Y41B, Y42B }") #else #define VIDEO_CAPS \ GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_BGR "; " \ GST_VIDEO_CAPS_RGBx "; " GST_VIDEO_CAPS_BGRx "; " \ GST_VIDEO_CAPS_RGBA "; " GST_VIDEO_CAPS_BGRA "; " \ - GST_VIDEO_CAPS_YUV ("{ I420, YUY2, Y41B, Y42B }") + GST_VIDEO_CAPS_YUV ("{ I420, YUY2, UYVY, Y41B, Y42B }") #endif static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", @@ -511,6 +511,9 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps) case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): pix_fmt = PIX_FMT_YUYV422; break; + case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'): + pix_fmt = PIX_FMT_UYVY422; + break; case GST_MAKE_FOURCC ('I', '4', '2', '0'): pix_fmt = PIX_FMT_YUV420P; break;