From dcf04269e1eab9d3a015218165f1027b1e4bce51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 7 Dec 2011 13:46:43 +0100 Subject: [PATCH] autoconvert: Remove the initial-identity property from autoconvert Initially creating an identity element to forward serialized events downstream before any caps are known is broken behaviour. Serialized events should only be forwarded downstream if the caps are already known, otherwise autopluggers and other elements using pad-blocks will fail. This behaviour also doesn't work anymore after basetransform was fixed to queue serialized events until the caps are known as a result of fixing bug #659571. See bug #599469, #665205. --- gst/autoconvert/gstautoconvert.c | 59 +------------------------------- gst/autoconvert/gstautoconvert.h | 2 -- 2 files changed, 1 insertion(+), 60 deletions(-) diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c index 9ff7135c2c..43a7cc9fbf 100644 --- a/gst/autoconvert/gstautoconvert.c +++ b/gst/autoconvert/gstautoconvert.c @@ -45,8 +45,6 @@ GST_DEBUG_CATEGORY (autoconvert_debug); #define GST_CAT_DEFAULT (autoconvert_debug) -#define DEFAULT_INITIAL_IDENTITY FALSE - #define GST_AUTOCONVERT_LOCK(ac) GST_OBJECT_LOCK (ac) #define GST_AUTOCONVERT_UNLOCK(ac) GST_OBJECT_UNLOCK (ac) @@ -83,8 +81,7 @@ enum enum { PROP_0, - PROP_FACTORIES, - PROP_INITIAL_IDENTITY + PROP_FACTORIES }; static void gst_auto_convert_set_property (GObject * object, @@ -199,14 +196,6 @@ gst_auto_convert_class_init (GstAutoConvertClass * klass) " elements), can only be set once", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_INITIAL_IDENTITY, - g_param_spec_boolean ("initial-identity", - "Install identity initially", - "If true, then the identity element will be installed initially " - "and used for event passing until the first data buffer arrives ", - DEFAULT_INITIAL_IDENTITY, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_auto_convert_change_state); } @@ -249,8 +238,6 @@ gst_auto_convert_init (GstAutoConvert * autoconvert, gst_element_add_pad (GST_ELEMENT (autoconvert), autoconvert->srcpad); gst_segment_init (&autoconvert->sink_segment, GST_FORMAT_UNDEFINED); - - autoconvert->initial_identity = DEFAULT_INITIAL_IDENTITY; } static void @@ -303,11 +290,6 @@ gst_auto_convert_set_property (GObject * object, " have been set or auto-discovered"); GST_AUTOCONVERT_UNLOCK (autoconvert); break; - case PROP_INITIAL_IDENTITY: - GST_AUTOCONVERT_LOCK (autoconvert); - autoconvert->initial_identity = g_value_get_boolean (value); - GST_AUTOCONVERT_UNLOCK (autoconvert); - break; } } @@ -326,11 +308,6 @@ gst_auto_convert_get_property (GObject * object, g_value_set_pointer (value, &autoconvert->factories); GST_AUTOCONVERT_UNLOCK (autoconvert); break; - case PROP_INITIAL_IDENTITY: - GST_AUTOCONVERT_LOCK (autoconvert); - g_value_set_boolean (value, autoconvert->initial_identity); - GST_AUTOCONVERT_UNLOCK (autoconvert); - break; } } @@ -478,37 +455,12 @@ gst_auto_convert_get_subelement (GstAutoConvert * autoconvert, gboolean query_only) { GstElement *element = NULL; - gboolean initial_identity; GST_AUTOCONVERT_LOCK (autoconvert); if (autoconvert->current_subelement) element = gst_object_ref (autoconvert->current_subelement); - initial_identity = autoconvert->initial_identity; GST_AUTOCONVERT_UNLOCK (autoconvert); - if (G_UNLIKELY (!query_only && element == NULL && initial_identity)) { - /* No current sub-element - create an identity and install it */ - GstElementFactory *identity_feature; - GstElement *identity; - - GST_INFO_OBJECT (autoconvert, - "No existing child element - instantiating identity"); - /* if the identity feature doesn't exist - something is very wrong */ - identity_feature = - GST_ELEMENT_FACTORY_CAST (gst_default_registry_find_feature ("identity", - GST_TYPE_ELEMENT_FACTORY)); - identity = - gst_auto_convert_get_or_make_element_from_factory (autoconvert, - identity_feature); - if (identity - && gst_auto_convert_activate_element (autoconvert, identity, NULL)) { - GST_AUTOCONVERT_LOCK (autoconvert); - if (autoconvert->current_subelement) - element = gst_object_ref (autoconvert->current_subelement); - GST_AUTOCONVERT_UNLOCK (autoconvert); - } - } - return element; } @@ -1124,15 +1076,6 @@ gst_auto_convert_sink_event (GstPad * pad, GstEvent * event) } internal_srcpad = gst_auto_convert_get_internal_srcpad (autoconvert); - if (internal_srcpad == NULL) { - /* Query the subelement - triggers creation of an identity if necessary */ - GstElement *subelement = - gst_auto_convert_get_subelement (autoconvert, FALSE); - if (subelement) - gst_object_unref (subelement); - internal_srcpad = gst_auto_convert_get_internal_srcpad (autoconvert); - } - if (internal_srcpad) { ret = gst_pad_push_event (internal_srcpad, event); gst_object_unref (internal_srcpad); diff --git a/gst/autoconvert/gstautoconvert.h b/gst/autoconvert/gstautoconvert.h index 612bcb18dc..b2f3abfba9 100644 --- a/gst/autoconvert/gstautoconvert.h +++ b/gst/autoconvert/gstautoconvert.h @@ -56,8 +56,6 @@ struct _GstAutoConvert GList *cached_events; GstSegment sink_segment; gboolean drop_newseg; - - gboolean initial_identity; }; struct _GstAutoConvertClass