Title: [231891] trunk/Source/WebCore
Revision
231891
Author
commit-qu...@webkit.org
Date
2018-05-17 01:16:40 -0700 (Thu, 17 May 2018)

Log Message

[GStreamer]: Consider GstStream(Collection) as if if was not a GInitiallyUnowned
https://bugs.webkit.org/show_bug.cgi?id=185657

Patch by Thibault Saunier <tsaun...@igalia.com> on 2018-05-17
Reviewed by Philippe Normand.

Starting with GStreamer 1.14[1] the reference is sunk at object creation time, making it a normal
GObject in practice, in our GRefPtr template implementation we should just consider GstStream
as if it was a normal GObject and not care about its floating reference state as
the ref is never sunk by anyone before 1.14 though that floating ref is considered
as a hard reference by the GstStreamCollection (leading to assertions/)

The exact same issue happens with GstStreamCollection, so fix it at the same time.

Also do not adoptRef() on the result of gst_stream_collection_get_stream() as this function
is transfer-none.

[1] commit f119e93b47efb06ffc68c01d3e094d5346c30041 `gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent`

* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef):
(WTF::refGPtr<GstStream>):
(WTF::refGPtr<GstStreamCollection>):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (231890 => 231891)


--- trunk/Source/WebCore/ChangeLog	2018-05-17 06:54:50 UTC (rev 231890)
+++ trunk/Source/WebCore/ChangeLog	2018-05-17 08:16:40 UTC (rev 231891)
@@ -1,3 +1,30 @@
+2018-05-17  Thibault Saunier  <tsaun...@igalia.com>
+
+        [GStreamer]: Consider GstStream(Collection) as if if was not a GInitiallyUnowned
+        https://bugs.webkit.org/show_bug.cgi?id=185657
+
+        Reviewed by Philippe Normand.
+
+        Starting with GStreamer 1.14[1] the reference is sunk at object creation time, making it a normal
+        GObject in practice, in our GRefPtr template implementation we should just consider GstStream
+        as if it was a normal GObject and not care about its floating reference state as
+        the ref is never sunk by anyone before 1.14 though that floating ref is considered
+        as a hard reference by the GstStreamCollection (leading to assertions/)
+
+        The exact same issue happens with GstStreamCollection, so fix it at the same time.
+
+        Also do not adoptRef() on the result of gst_stream_collection_get_stream() as this function
+        is transfer-none.
+
+        [1] commit f119e93b47efb06ffc68c01d3e094d5346c30041 `gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent`
+
+        * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
+        (WTF::adoptGRef):
+        (WTF::refGPtr<GstStream>):
+        (WTF::refGPtr<GstStreamCollection>):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+
 2018-05-16  Devin Rousso  <web...@devinrousso.com>
 
         Web Inspector: create a navigation item for toggling the overlay rulers/guides

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp (231890 => 231891)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp	2018-05-17 06:54:50 UTC (rev 231890)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp	2018-05-17 08:16:40 UTC (rev 231891)
@@ -356,7 +356,6 @@
 #if GST_CHECK_VERSION(1, 10, 0)
 template <> GRefPtr<GstStream> adoptGRef(GstStream* ptr)
 {
-    ASSERT(!ptr || !g_object_is_floating(ptr));
     return GRefPtr<GstStream>(ptr, GRefPtrAdopt);
 }
 
@@ -363,7 +362,7 @@
 template <> GstStream* refGPtr<GstStream>(GstStream* ptr)
 {
     if (ptr)
-        gst_object_ref_sink(GST_OBJECT_CAST(ptr));
+        gst_object_ref(GST_OBJECT_CAST(ptr));
 
     return ptr;
 }
@@ -376,7 +375,6 @@
 
 template <> GRefPtr<GstStreamCollection> adoptGRef(GstStreamCollection* ptr)
 {
-    ASSERT(!ptr || !g_object_is_floating(ptr));
     return GRefPtr<GstStreamCollection>(ptr, GRefPtrAdopt);
 }
 
@@ -383,7 +381,7 @@
 template <> GstStreamCollection* refGPtr<GstStreamCollection>(GstStreamCollection* ptr)
 {
     if (ptr)
-        gst_object_ref_sink(GST_OBJECT_CAST(ptr));
+        gst_object_ref(GST_OBJECT_CAST(ptr));
 
     return ptr;
 }

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (231890 => 231891)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2018-05-17 06:54:50 UTC (rev 231890)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2018-05-17 08:16:40 UTC (rev 231891)
@@ -1323,9 +1323,10 @@
 
         unsigned length = gst_message_streams_selected_get_size(message);
         for (unsigned i = 0; i < length; i++) {
-            GRefPtr<GstStream> stream = adoptGRef(gst_message_streams_selected_get_stream(message, i));
+            GRefPtr<GstStream> stream = gst_message_streams_selected_get_stream(message, i);
             if (!stream)
                 continue;
+
             GstStreamType type = gst_stream_get_stream_type(stream.get());
             String streamId(gst_stream_get_stream_id(stream.get()));
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to