mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 04:52:28 +00:00
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.
This commit is contained in:
parent
6b3a314d36
commit
dcf04269e1
2 changed files with 1 additions and 60 deletions
|
@ -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);
|
||||
|
|
|
@ -56,8 +56,6 @@ struct _GstAutoConvert
|
|||
GList *cached_events;
|
||||
GstSegment sink_segment;
|
||||
gboolean drop_newseg;
|
||||
|
||||
gboolean initial_identity;
|
||||
};
|
||||
|
||||
struct _GstAutoConvertClass
|
||||
|
|
Loading…
Reference in a new issue