File gstreamer-revert-encforce-elements.patch of Package gstreamer

From 3c21d6a29f42731b5f47561a07f251ce8f875c5a Mon Sep 17 00:00:00 2001
From: Mathieu Duponchelle <mathieu@centricular.com>
Date: Thu, 5 Dec 2019 09:47:30 +0100
Subject: [PATCH] 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 cc6342d853f4252c5d5cf09fff9d3379ad467fbc.
---
 gst/gstdevice.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/gst/gstdevice.c b/gst/gstdevice.c
index 64f5ba5309f..60407823f56 100644
--- a/gst/gstdevice.c
+++ b/gst/gstdevice.c
@@ -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;
 }
 
 /**
-- 
2.24.1


From 5c47fe611894ebfd8da946797802913042eff3bf Mon Sep 17 00:00:00 2001
From: Mathieu Duponchelle <mathieu@centricular.com>
Date: Thu, 5 Dec 2019 09:47:38 +0100
Subject: [PATCH] Revert "element: Enforce that elements created by
 gst_element_factory_create/make() 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 ce43de86902c4e9c8ed4e9682602664cb9bce2ee.
---
 gst/gstelementfactory.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c
index 3ccfc1420ab..cf3b1007744 100644
--- a/gst/gstelementfactory.c
+++ b/gst/gstelementfactory.c
@@ -386,12 +386,6 @@ gst_element_factory_create (GstElementFactory * factory, const gchar * name)
     /* This ref will never be dropped as the class is never destroyed */
     GST_OBJECT_FLAG_SET (factory, GST_OBJECT_FLAG_MAY_BE_LEAKED);
 
-  /* 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);
-
   GST_DEBUG ("created element \"%s\"", GST_OBJECT_NAME (factory));
 
   return element;
-- 
2.24.1