diff -Nru gstreamer0.10-0.10.35/debian/changelog gstreamer0.10-0.10.35/debian/changelog --- gstreamer0.10-0.10.35/debian/changelog 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/changelog 2012-01-31 18:03:51.000000000 +0000 @@ -1,3 +1,9 @@ +gstreamer0.10 (0.10.35-1+ti1.5.4.1+1) oneiric; urgency=low + + * Refreshed TI patches based on commit 86eda401 + + -- Olivier Naudan Tue, 31 Jan 2012 13:03:34 -0500 + gstreamer0.10 (0.10.35-1+ti1.5.1.1+1) oneiric; urgency=low * Migration to Oneiric: diff -Nru gstreamer0.10-0.10.35/debian/patches/0001-gst-launch-add-loop-argument.patch gstreamer0.10-0.10.35/debian/patches/0001-gst-launch-add-loop-argument.patch --- gstreamer0.10-0.10.35/debian/patches/0001-gst-launch-add-loop-argument.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0001-gst-launch-add-loop-argument.patch 2012-01-31 18:03:27.000000000 +0000 @@ -1,7 +1,7 @@ From 03e7850d8bc4a0cdaf95b5ae7422580228594339 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 13 Feb 2010 15:29:13 -0600 -Subject: [PATCH 01/11] gst-launch: add --loop argument +Subject: [PATCH 01/14] gst-launch: add --loop argument if --loop is specified, automatically seek to beginning of clip when EOS is received --- @@ -50,5 +50,5 @@ PRINT (_("EOS on shutdown enabled -- Forcing EOS on the pipeline\n")); waiting_eos = TRUE; -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0002-Changes-to-make-it-possible-to-LD_PRELOAD-libttif.patch gstreamer0.10-0.10.35/debian/patches/0002-Changes-to-make-it-possible-to-LD_PRELOAD-libttif.patch --- gstreamer0.10-0.10.35/debian/patches/0002-Changes-to-make-it-possible-to-LD_PRELOAD-libttif.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0002-Changes-to-make-it-possible-to-LD_PRELOAD-libttif.patch 2012-01-31 18:03:27.000000000 +0000 @@ -1,7 +1,7 @@ From a0b30c5b2bcefc758b47b998046b5aabbcb9772a Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 4 Apr 2010 09:14:34 -0500 -Subject: [PATCH 02/11] Changes to make it possible to LD_PRELOAD libttif +Subject: [PATCH 02/14] Changes to make it possible to LD_PRELOAD libttif 1) if GST_USING_PRINTF_EXTENSION, then prepend the fmt string with "<%P> " and pass object as a normal arg. When using TTIF, you want the whole fmt string, @@ -263,5 +263,5 @@ # pragma GCC poison _gst_debug_category_new #endif -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0003-add-GstQueryBuffers-query.patch gstreamer0.10-0.10.35/debian/patches/0003-add-GstQueryBuffers-query.patch --- gstreamer0.10-0.10.35/debian/patches/0003-add-GstQueryBuffers-query.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0003-add-GstQueryBuffers-query.patch 2012-01-31 18:03:27.000000000 +0000 @@ -1,7 +1,7 @@ From 4b452f9f2e3feee04ab4b2c22287e94d5645b5d2 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 19 May 2010 15:48:09 -0500 -Subject: [PATCH 03/11] add GstQueryBuffers query +Subject: [PATCH 03/14] add GstQueryBuffers query This query is used by buffer allocator, for example a video sink element, to find out any minimum buffer requirements of upstream elements that uses @@ -254,5 +254,5 @@ #endif /* __GST_QUERY_H__ */ -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0004-Add-GstEventCrop-event.patch gstreamer0.10-0.10.35/debian/patches/0004-Add-GstEventCrop-event.patch --- gstreamer0.10-0.10.35/debian/patches/0004-Add-GstEventCrop-event.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0004-Add-GstEventCrop-event.patch 2012-01-31 18:03:27.000000000 +0000 @@ -1,7 +1,7 @@ From 93ec4a10bb01c9b97903a28e22678115b99e5623 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 24 May 2010 16:49:20 -0500 -Subject: [PATCH 04/11] Add GstEventCrop event +Subject: [PATCH 04/14] Add GstEventCrop event This event can be used to set cropping / region-of-interest to take effect on the following buffer. @@ -158,5 +158,5 @@ extern GQuark _priv_gst_quark_table[GST_QUARK_MAX]; -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0005-Add-GST_EVENT_LIVE_FLUSH.patch gstreamer0.10-0.10.35/debian/patches/0005-Add-GST_EVENT_LIVE_FLUSH.patch --- gstreamer0.10-0.10.35/debian/patches/0005-Add-GST_EVENT_LIVE_FLUSH.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0005-Add-GST_EVENT_LIVE_FLUSH.patch 2012-01-31 18:03:27.000000000 +0000 @@ -1,7 +1,7 @@ From 5c07f82246484b409b838bfb2c713f56b5284067 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Fri, 6 May 2011 08:40:26 +0200 -Subject: [PATCH 05/11] Add GST_EVENT_LIVE_FLUSH. +Subject: [PATCH 05/14] Add GST_EVENT_LIVE_FLUSH. This is needed by live sources to unblock buffer_alloc going from PLAYING to PAUSED. @@ -61,5 +61,5 @@ /* EOS event */ GstEvent * gst_event_new_eos (void); -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0006-Refresh-gstreamer-sections.txt.patch gstreamer0.10-0.10.35/debian/patches/0006-Refresh-gstreamer-sections.txt.patch --- gstreamer0.10-0.10.35/debian/patches/0006-Refresh-gstreamer-sections.txt.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0006-Refresh-gstreamer-sections.txt.patch 2012-01-31 18:03:27.000000000 +0000 @@ -1,7 +1,7 @@ From ed81aae2dc77ce6e01b6fc0722c77e2375d73b2b Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Fri, 6 May 2011 09:29:46 +0200 -Subject: [PATCH 06/11] Refresh gstreamer-sections.txt +Subject: [PATCH 06/14] Refresh gstreamer-sections.txt --- docs/gst/gstreamer-sections.txt | 34 ++++++++++++++++++++++++++++++++++ @@ -101,5 +101,5 @@ GST_TYPE_RANK -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0007-baseparse-set-correct-buffer-size.patch gstreamer0.10-0.10.35/debian/patches/0007-baseparse-set-correct-buffer-size.patch --- gstreamer0.10-0.10.35/debian/patches/0007-baseparse-set-correct-buffer-size.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0007-baseparse-set-correct-buffer-size.patch 2012-01-31 18:03:28.000000000 +0000 @@ -1,7 +1,7 @@ From d08d39a7acc7532940b46ed016f3a81c3ce68457 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 17 May 2011 22:38:14 +0200 -Subject: [PATCH 07/11] baseparse: set correct buffer size +Subject: [PATCH 07/14] baseparse: set correct buffer size --- libs/gst/base/gstbaseparse.c | 2 +- @@ -21,5 +21,5 @@ GST_BUFFER_FLAG_SET (tmpbuf, GST_MINI_OBJECT_FLAG_READONLY); -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0008-baseparse-make-minimum-frame-size-handling-more-effi.patch gstreamer0.10-0.10.35/debian/patches/0008-baseparse-make-minimum-frame-size-handling-more-effi.patch --- gstreamer0.10-0.10.35/debian/patches/0008-baseparse-make-minimum-frame-size-handling-more-effi.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0008-baseparse-make-minimum-frame-size-handling-more-effi.patch 2012-01-31 18:03:28.000000000 +0000 @@ -1,7 +1,8 @@ From 41a8164409a51574caed82112b3bf8e604dd2388 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 17 May 2011 22:15:38 +0200 -Subject: [PATCH 08/11] baseparse: make minimum frame size handling more efficient and convenient +Subject: [PATCH 08/14] baseparse: make minimum frame size handling more + efficient and convenient While some formats allow subclass to determine a specific subsequent needed frame size, others may to need to scan for markers and can only @@ -65,5 +66,5 @@ } /* skip == 0 should imply subclass set min_size to need more data; -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0009-baseparse-provide-latency-query-support.patch gstreamer0.10-0.10.35/debian/patches/0009-baseparse-provide-latency-query-support.patch --- gstreamer0.10-0.10.35/debian/patches/0009-baseparse-provide-latency-query-support.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0009-baseparse-provide-latency-query-support.patch 2012-01-31 18:03:28.000000000 +0000 @@ -1,7 +1,7 @@ From f41fc23b563259d94f57e68f9cecd48d08648153 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 12 May 2011 11:55:20 +0200 -Subject: [PATCH 09/11] baseparse: provide latency query support +Subject: [PATCH 09/14] baseparse: provide latency query support --- libs/gst/base/gstbaseparse.c | 49 ++++++++++++++++++++++++++++++++++++++++++ @@ -98,5 +98,5 @@ GstFormat src_format, gint64 src_value, -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0010-baseparse-maintain-frame-state-during-frame-parsing-.patch gstreamer0.10-0.10.35/debian/patches/0010-baseparse-maintain-frame-state-during-frame-parsing-.patch --- gstreamer0.10-0.10.35/debian/patches/0010-baseparse-maintain-frame-state-during-frame-parsing-.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0010-baseparse-maintain-frame-state-during-frame-parsing-.patch 2012-01-31 18:03:28.000000000 +0000 @@ -1,7 +1,8 @@ From 52ec0daf20dabe1087065e349ee9ccd77140c1e5 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 17 May 2011 22:17:14 +0200 -Subject: [PATCH 10/11] baseparse: maintain frame state during frame parsing round +Subject: [PATCH 10/14] baseparse: maintain frame state during frame parsing + round See #650093. --- @@ -103,5 +104,5 @@ old_min_size = 0; -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0011-basetransform-don-t-do-unnecessary-pad_alloc.patch gstreamer0.10-0.10.35/debian/patches/0011-basetransform-don-t-do-unnecessary-pad_alloc.patch --- gstreamer0.10-0.10.35/debian/patches/0011-basetransform-don-t-do-unnecessary-pad_alloc.patch 2011-10-03 13:38:37.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0011-basetransform-don-t-do-unnecessary-pad_alloc.patch 2012-01-31 18:03:28.000000000 +0000 @@ -1,7 +1,7 @@ From 41af019dc6333d1ab8372bd806e0f289899f1ea4 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 26 May 2010 14:42:40 -0500 -Subject: [PATCH 11/11] basetransform: don't do unnecessary pad_alloc() +Subject: [PATCH 11/14] basetransform: don't do unnecessary pad_alloc() Don't allocate a buffer in passthrough mode. --- @@ -48,5 +48,5 @@ /* now perform the needed transform */ if (trans->passthrough) { -- -1.7.1 +1.7.5.4 diff -Nru gstreamer0.10-0.10.35/debian/patches/0012-baseparse-add-getcaps-function.patch gstreamer0.10-0.10.35/debian/patches/0012-baseparse-add-getcaps-function.patch --- gstreamer0.10-0.10.35/debian/patches/0012-baseparse-add-getcaps-function.patch 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0012-baseparse-add-getcaps-function.patch 2012-01-31 18:03:28.000000000 +0000 @@ -0,0 +1,101 @@ +From 9d47785d668137bdf7d405936eeda561cf016901 Mon Sep 17 00:00:00 2001 +From: Thiago Santos +Date: Mon, 17 Oct 2011 14:42:08 -0300 +Subject: [PATCH 12/14] baseparse: add getcaps function + +Adds a getcaps function to the sink pad to make parsers propagate +downstream caps restrictions to upstream. + +The pipeline "audiotestsrc num-buffers=100 ! faac ! aacparse ! +"audio/mpeg, version=(int)4, stream-format=(string)adts" ! filesink" +wouldn't work because aacparse wouldn't propagate the adts restriction +upstream to faac. + +This patch adds a default getcaps to the sink pad to simply proxy +downstream caps and also adds a 'get_sink_caps' function pointer +to GstBaseParseClass for subclasses that need more refined getcaps. + +https://bugzilla.gnome.org/show_bug.cgi?id=661874 +--- + libs/gst/base/gstbaseparse.c | 26 ++++++++++++++++++++++++++ + libs/gst/base/gstbaseparse.h | 5 ++++- + 2 files changed, 30 insertions(+), 1 deletions(-) + +diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c +index e0158ce..46755e2 100644 +--- a/libs/gst/base/gstbaseparse.c ++++ b/libs/gst/base/gstbaseparse.c +@@ -378,6 +378,7 @@ static gboolean gst_base_parse_src_event (GstPad * pad, GstEvent * event); + static gboolean gst_base_parse_sink_event (GstPad * pad, GstEvent * event); + static gboolean gst_base_parse_query (GstPad * pad, GstQuery * query); + static gboolean gst_base_parse_sink_setcaps (GstPad * pad, GstCaps * caps); ++static GstCaps *gst_base_parse_sink_getcaps (GstPad * pad); + static const GstQueryType *gst_base_parse_get_querytypes (GstPad * pad); + + static GstFlowReturn gst_base_parse_chain (GstPad * pad, GstBuffer * buffer); +@@ -511,6 +512,8 @@ gst_base_parse_init (GstBaseParse * parse, GstBaseParseClass * bclass) + GST_DEBUG_FUNCPTR (gst_base_parse_sink_event)); + gst_pad_set_setcaps_function (parse->sinkpad, + GST_DEBUG_FUNCPTR (gst_base_parse_sink_setcaps)); ++ gst_pad_set_getcaps_function (parse->sinkpad, ++ GST_DEBUG_FUNCPTR (gst_base_parse_sink_getcaps)); + gst_pad_set_chain_function (parse->sinkpad, + GST_DEBUG_FUNCPTR (gst_base_parse_chain)); + gst_pad_set_activate_function (parse->sinkpad, +@@ -3836,6 +3839,29 @@ gst_base_parse_sink_setcaps (GstPad * pad, GstCaps * caps) + return res; + } + ++static GstCaps * ++gst_base_parse_sink_getcaps (GstPad * pad) ++{ ++ GstBaseParse *parse; ++ GstBaseParseClass *klass; ++ GstCaps *caps; ++ ++ parse = GST_BASE_PARSE (gst_pad_get_parent (pad)); ++ klass = GST_BASE_PARSE_GET_CLASS (parse); ++ g_assert (pad == GST_BASE_PARSE_SINK_PAD (parse)); ++ ++ if (klass->get_sink_caps) ++ caps = klass->get_sink_caps (parse); ++ else ++ caps = gst_pad_proxy_getcaps (pad); ++ gst_object_unref (parse); ++ ++ GST_LOG_OBJECT (parse, "sink getcaps returning caps %" GST_PTR_FORMAT, caps); ++ ++ return caps; ++ ++} ++ + static void + gst_base_parse_set_index (GstElement * element, GstIndex * index) + { +diff --git a/libs/gst/base/gstbaseparse.h b/libs/gst/base/gstbaseparse.h +index 655ad0e..e7b1db5 100644 +--- a/libs/gst/base/gstbaseparse.h ++++ b/libs/gst/base/gstbaseparse.h +@@ -191,6 +191,7 @@ struct _GstBaseParse { + * Called when the element stops processing. + * Allows closing external resources. + * @set_sink_caps: allows the subclass to be notified of the actual caps set. ++ * @get_sink_caps: allows the subclass to do its own sink get caps if needed. + * @check_valid_frame: Check if the given piece of data contains a valid + * frame. + * @parse_frame: Parse the already checked frame. Subclass need to +@@ -252,8 +253,10 @@ struct _GstBaseParseClass { + gboolean (*src_event) (GstBaseParse * parse, + GstEvent * event); + ++ GstCaps * (*get_sink_caps) (GstBaseParse * parse); ++ + /*< private >*/ +- gpointer _gst_reserved[GST_PADDING_LARGE]; ++ gpointer _gst_reserved[GST_PADDING_LARGE - 1]; + }; + + GType gst_base_parse_get_type (void); +-- +1.7.5.4 + diff -Nru gstreamer0.10-0.10.35/debian/patches/0013-baseparse-Return-template-caps-instead-of-other-side.patch gstreamer0.10-0.10.35/debian/patches/0013-baseparse-Return-template-caps-instead-of-other-side.patch --- gstreamer0.10-0.10.35/debian/patches/0013-baseparse-Return-template-caps-instead-of-other-side.patch 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0013-baseparse-Return-template-caps-instead-of-other-side.patch 2012-01-31 18:03:28.000000000 +0000 @@ -0,0 +1,38 @@ +From 4f64d80c6e0d3860351496a9a85afc0ec63dbbd6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Wed, 23 Nov 2011 13:42:56 +0100 +Subject: [PATCH 13/14] baseparse: Return template caps instead of other + side's peer caps if get_sink_caps vfunc is not + implemented + +Using gst_pad_proxy_get_caps() breaks backwards compatibility with old +parsers because it will propagate the other side's fields like "parsed" +and "framed" and also breaks parser/converters. + +Fixes bug #664221. +--- + libs/gst/base/gstbaseparse.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c +index 46755e2..69a6c68 100644 +--- a/libs/gst/base/gstbaseparse.c ++++ b/libs/gst/base/gstbaseparse.c +@@ -3853,13 +3853,12 @@ gst_base_parse_sink_getcaps (GstPad * pad) + if (klass->get_sink_caps) + caps = klass->get_sink_caps (parse); + else +- caps = gst_pad_proxy_getcaps (pad); ++ caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); + gst_object_unref (parse); + + GST_LOG_OBJECT (parse, "sink getcaps returning caps %" GST_PTR_FORMAT, caps); + + return caps; +- + } + + static void +-- +1.7.5.4 + diff -Nru gstreamer0.10-0.10.35/debian/patches/0014-basebarse-Add-detect-vfunc-to-allow-subclasses-to-do.patch gstreamer0.10-0.10.35/debian/patches/0014-basebarse-Add-detect-vfunc-to-allow-subclasses-to-do.patch --- gstreamer0.10-0.10.35/debian/patches/0014-basebarse-Add-detect-vfunc-to-allow-subclasses-to-do.patch 1970-01-01 00:00:00.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/0014-basebarse-Add-detect-vfunc-to-allow-subclasses-to-do.patch 2012-01-31 18:03:28.000000000 +0000 @@ -0,0 +1,221 @@ +From 86eda4012a22dc95bcb8d0f506297c8d39f9fc44 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= +Date: Thu, 20 Oct 2011 08:31:18 +0200 +Subject: [PATCH 14/14] basebarse: Add detect vfunc to allow subclasses to do + format detection before anything else + +API: GstBaseParseClass::detect() + +This is called with the first buffers until the subclass has finished detection +and only afterwards the original buffers are handled as before. The vfunc allows +detection of the stream format without breaking the upstream framing. +--- + libs/gst/base/gstbaseparse.c | 121 ++++++++++++++++++++++++++++++++++++++++++ + libs/gst/base/gstbaseparse.h | 9 +++- + 2 files changed, 129 insertions(+), 1 deletions(-) + +diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c +index 69a6c68..9db4065 100644 +--- a/libs/gst/base/gstbaseparse.c ++++ b/libs/gst/base/gstbaseparse.c +@@ -2,6 +2,8 @@ + * Copyright (C) 2008 Nokia Corporation. All rights reserved. + * Contact: Stefan Kost + * Copyright (C) 2008 Sebastian Dröge . ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -314,6 +316,12 @@ struct _GstBaseParsePrivate + + /* push mode helper frame */ + GstBaseParseFrame frame; ++ ++ /* TRUE if we're still detecting the format, i.e. ++ * if ::detect() is still called for future buffers */ ++ gboolean detecting; ++ GList *detect_buffers; ++ guint detect_buffers_size; + }; + + typedef struct _GstBaseParseSeek +@@ -423,6 +431,11 @@ gst_base_parse_clear_queues (GstBaseParse * parse) + g_slist_foreach (parse->priv->buffers_send, (GFunc) gst_buffer_unref, NULL); + g_slist_free (parse->priv->buffers_send); + parse->priv->buffers_send = NULL; ++ ++ g_list_foreach (parse->priv->detect_buffers, (GFunc) gst_buffer_unref, NULL); ++ g_list_free (parse->priv->detect_buffers); ++ parse->priv->detect_buffers = NULL; ++ parse->priv->detect_buffers_size = 0; + } + + static void +@@ -739,6 +752,11 @@ gst_base_parse_reset (GstBaseParse * parse) + parse->priv->frame._private_flags |= + GST_BASE_PARSE_FRAME_PRIVATE_FLAG_NOALLOC; + gst_base_parse_frame_free (&parse->priv->frame); ++ ++ g_list_foreach (parse->priv->detect_buffers, (GFunc) gst_buffer_unref, NULL); ++ g_list_free (parse->priv->detect_buffers); ++ parse->priv->detect_buffers = NULL; ++ parse->priv->detect_buffers_size = 0; + GST_OBJECT_UNLOCK (parse); + } + +@@ -2183,6 +2201,81 @@ gst_base_parse_chain (GstPad * pad, GstBuffer * buffer) + + parse = GST_BASE_PARSE (GST_OBJECT_PARENT (pad)); + bclass = GST_BASE_PARSE_GET_CLASS (parse); ++ ++ if (parse->priv->detecting) { ++ GstBuffer *detect_buf; ++ ++ if (parse->priv->detect_buffers_size == 0) { ++ detect_buf = gst_buffer_ref (buffer); ++ } else { ++ GList *l; ++ guint offset = 0; ++ ++ detect_buf = ++ gst_buffer_new_and_alloc (parse->priv->detect_buffers_size + ++ (buffer ? GST_BUFFER_SIZE (buffer) : 0)); ++ for (l = parse->priv->detect_buffers; l; l = l->next) { ++ memcpy (GST_BUFFER_DATA (detect_buf) + offset, ++ GST_BUFFER_DATA (l->data), GST_BUFFER_SIZE (l->data)); ++ offset += GST_BUFFER_SIZE (l->data); ++ } ++ if (buffer) ++ memcpy (GST_BUFFER_DATA (detect_buf) + offset, GST_BUFFER_DATA (buffer), ++ GST_BUFFER_SIZE (buffer)); ++ } ++ ++ ret = bclass->detect (parse, detect_buf); ++ gst_buffer_unref (detect_buf); ++ ++ if (ret == GST_FLOW_OK) { ++ GList *l; ++ ++ /* Detected something */ ++ parse->priv->detecting = FALSE; ++ ++ for (l = parse->priv->detect_buffers; l; l = l->next) { ++ if (ret == GST_FLOW_OK && !parse->priv->flushing) ++ ret = ++ gst_base_parse_chain (GST_BASE_PARSE_SINK_PAD (parse), ++ GST_BUFFER_CAST (l->data)); ++ else ++ gst_buffer_unref (GST_BUFFER_CAST (l->data)); ++ } ++ g_list_free (parse->priv->detect_buffers); ++ parse->priv->detect_buffers = NULL; ++ parse->priv->detect_buffers_size = 0; ++ ++ if (ret != GST_FLOW_OK) { ++ return ret; ++ } ++ ++ /* Handle the current buffer */ ++ } else if (ret == GST_FLOW_NOT_NEGOTIATED) { ++ /* Still detecting, append buffer or error out if draining */ ++ ++ if (parse->priv->drain) { ++ GST_DEBUG_OBJECT (parse, "Draining but did not detect format yet"); ++ return GST_FLOW_ERROR; ++ } else if (parse->priv->flushing) { ++ g_list_foreach (parse->priv->detect_buffers, (GFunc) gst_buffer_unref, ++ NULL); ++ g_list_free (parse->priv->detect_buffers); ++ parse->priv->detect_buffers = NULL; ++ parse->priv->detect_buffers_size = 0; ++ } else { ++ parse->priv->detect_buffers = ++ g_list_append (parse->priv->detect_buffers, buffer); ++ parse->priv->detect_buffers_size += GST_BUFFER_SIZE (buffer); ++ return GST_FLOW_OK; ++ } ++ } else { ++ /* Something went wrong, subclass responsible for error reporting */ ++ return ret; ++ } ++ ++ /* And now handle the current buffer if detection worked */ ++ } ++ + frame = &parse->priv->frame; + + if (G_LIKELY (buffer)) { +@@ -2559,6 +2652,30 @@ gst_base_parse_scan_frame (GstBaseParse * parse, GstBaseParseClass * klass, + if (GST_BUFFER_SIZE (buffer) < min_size) + parse->priv->drain = TRUE; + ++ if (parse->priv->detecting) { ++ ret = klass->detect (parse, buffer); ++ if (ret == GST_FLOW_NOT_NEGOTIATED) { ++ /* If draining we error out, otherwise request a buffer ++ * with 64kb more */ ++ if (parse->priv->drain) { ++ gst_buffer_unref (buffer); ++ GST_ERROR_OBJECT (parse, "Failed to detect format but draining"); ++ return GST_FLOW_ERROR; ++ } else { ++ fsize += 64 * 1024; ++ gst_buffer_unref (buffer); ++ continue; ++ } ++ } else if (ret != GST_FLOW_OK) { ++ gst_buffer_unref (buffer); ++ GST_ERROR_OBJECT (parse, "detect() returned %s", ++ gst_flow_get_name (ret)); ++ return ret; ++ } ++ ++ /* Else handle this buffer normally */ ++ } ++ + skip = -1; + gst_base_parse_frame_update (parse, frame, buffer); + res = klass->check_valid_frame (parse, frame, &fsize, &skip); +@@ -2784,6 +2901,10 @@ gst_base_parse_activate (GstBaseParse * parse, gboolean active) + if (active) { + if (parse->priv->pad_mode == GST_ACTIVATE_NONE && klass->start) + result = klass->start (parse); ++ ++ /* If the subclass implements ::detect we want to ++ * call it for the first buffers now */ ++ parse->priv->detecting = (klass->detect != NULL); + } else { + /* We must make sure streaming has finished before resetting things + * and calling the ::stop vfunc */ +diff --git a/libs/gst/base/gstbaseparse.h b/libs/gst/base/gstbaseparse.h +index e7b1db5..368bfc9 100644 +--- a/libs/gst/base/gstbaseparse.h ++++ b/libs/gst/base/gstbaseparse.h +@@ -212,6 +212,10 @@ struct _GstBaseParse { + * additional actions at this time (e.g. tag sending) or to + * decide whether this buffer should be dropped or not + * (e.g. custom segment clipping). ++ * @detect: Optional. ++ * Called until it doesn't return GST_FLOW_OK anymore for ++ * the first buffers. Can be used by the subclass to detect ++ * the stream format. Since: 0.10.36 + * + * Subclasses can override any of the available virtual methods or not, as + * needed. At minimum @check_valid_frame and @parse_frame needs to be +@@ -255,8 +259,11 @@ struct _GstBaseParseClass { + + GstCaps * (*get_sink_caps) (GstBaseParse * parse); + ++ GstFlowReturn (*detect) (GstBaseParse * parse, ++ GstBuffer * buffer); ++ + /*< private >*/ +- gpointer _gst_reserved[GST_PADDING_LARGE - 1]; ++ gpointer _gst_reserved[GST_PADDING_LARGE - 2]; + }; + + GType gst_base_parse_get_type (void); +-- +1.7.5.4 + diff -Nru gstreamer0.10-0.10.35/debian/patches/series gstreamer0.10-0.10.35/debian/patches/series --- gstreamer0.10-0.10.35/debian/patches/series 2011-10-03 13:38:38.000000000 +0000 +++ gstreamer0.10-0.10.35/debian/patches/series 2012-01-31 18:03:28.000000000 +0000 @@ -9,5 +9,8 @@ 0009-baseparse-provide-latency-query-support.patch 0010-baseparse-maintain-frame-state-during-frame-parsing-.patch 0011-basetransform-don-t-do-unnecessary-pad_alloc.patch +0012-baseparse-add-getcaps-function.patch +0013-baseparse-Return-template-caps-instead-of-other-side.patch +0014-basebarse-Add-detect-vfunc-to-allow-subclasses-to-do.patch 80_ia32-hack.patch 99_ltmain_as-needed.patch