Revert "device: Enforce that elements created by gst_device_create_element() are floating"

See https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/333

The reference we receive when calling g_object_new should be
floating, but we can't force it at our level.

This reverts commit cc6342d853.
This commit is contained in:
Mathieu Duponchelle 2019-12-05 09:47:30 +01:00
parent 1294936877
commit 3c21d6a29f

View file

@ -205,20 +205,13 @@ GstElement *
gst_device_create_element (GstDevice * device, const gchar * name)
{
GstDeviceClass *klass = GST_DEVICE_GET_CLASS (device);
GstElement *element = NULL;
g_return_val_if_fail (GST_IS_DEVICE (device), NULL);
if (klass->create_element)
element = klass->create_element (device, name);
/* Ensure that the reference is floating. Bindings might have a hard time
* making sure that the reference is indeed still floating after returning
* here */
if (element)
g_object_force_floating ((GObject *) element);
return element;
return klass->create_element (device, name);
else
return NULL;
}
/**