Title: [101082] trunk/Source/WebCore
Revision
101082
Author
[email protected]
Date
2011-11-23 07:33:19 -0800 (Wed, 23 Nov 2011)

Log Message

[GStreamer] improper usage of gst_object_ref_sink
https://bugs.webkit.org/show_bug.cgi?id=73014

Reviewed by Martin Robinson.

No new tests. Existing tests cover this already.

* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
(WTF::adoptGRef): Ensure this is called with non-floating GstObjects.
(WTF::GstElement): Replace gst_object_ref_sink with
gst_object_ref+gst_object_sink like advised in the GstObject documentation.
(WTF::GstPad): Ditto.
* platform/graphics/gstreamer/GRefPtrGStreamer.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (101081 => 101082)


--- trunk/Source/WebCore/ChangeLog	2011-11-23 15:28:40 UTC (rev 101081)
+++ trunk/Source/WebCore/ChangeLog	2011-11-23 15:33:19 UTC (rev 101082)
@@ -1,3 +1,19 @@
+2011-11-23  Philippe Normand  <[email protected]>
+
+        [GStreamer] improper usage of gst_object_ref_sink
+        https://bugs.webkit.org/show_bug.cgi?id=73014
+
+        Reviewed by Martin Robinson.
+
+        No new tests. Existing tests cover this already.
+
+        * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
+        (WTF::adoptGRef): Ensure this is called with non-floating GstObjects.
+        (WTF::GstElement): Replace gst_object_ref_sink with
+        gst_object_ref+gst_object_sink like advised in the GstObject documentation.
+        (WTF::GstPad): Ditto.
+        * platform/graphics/gstreamer/GRefPtrGStreamer.h:
+
 2011-11-23  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: split console agent into worker and page console agents

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp	2011-11-23 15:28:40 UTC (rev 101081)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp	2011-11-23 15:33:19 UTC (rev 101082)
@@ -25,10 +25,19 @@
 
 namespace WTF {
 
+template <> GRefPtr<GstElement> adoptGRef(GstElement* ptr)
+{
+    ASSERT(!GST_OBJECT_IS_FLOATING(GST_OBJECT(ptr)));
+    return GRefPtr<GstElement>(ptr, GRefPtrAdopt);
+}
+
 template <> GstElement* refGPtr<GstElement>(GstElement* ptr)
 {
-    if (ptr)
-        gst_object_ref_sink(ptr);
+    if (ptr) {
+        gst_object_ref(GST_OBJECT(ptr));
+        gst_object_sink(GST_OBJECT(ptr));
+    }
+
     return ptr;
 }
 
@@ -38,10 +47,18 @@
         gst_object_unref(ptr);
 }
 
+template <> GRefPtr<GstPad> adoptGRef(GstPad* ptr)
+{
+    ASSERT(!GST_OBJECT_IS_FLOATING(GST_OBJECT(ptr)));
+    return GRefPtr<GstPad>(ptr, GRefPtrAdopt);
+}
+
 template <> GstPad* refGPtr<GstPad>(GstPad* ptr)
 {
-    if (ptr)
-        gst_object_ref_sink(GST_OBJECT(ptr));
+    if (ptr) {
+        gst_object_ref(GST_OBJECT(ptr));
+        gst_object_sink(GST_OBJECT(ptr));
+    }
     return ptr;
 }
 

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h (101081 => 101082)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h	2011-11-23 15:28:40 UTC (rev 101081)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h	2011-11-23 15:33:19 UTC (rev 101082)
@@ -29,9 +29,11 @@
 
 namespace WTF {
 
+template<> GRefPtr<GstElement> adoptGRef(GstElement* ptr);
 template<> GstElement* refGPtr<GstElement>(GstElement* ptr);
 template<> void derefGPtr<GstElement>(GstElement* ptr);
 
+template<> GRefPtr<GstPad> adoptGRef(GstPad* ptr);
 template<> GstPad* refGPtr<GstPad>(GstPad* ptr);
 template<> void derefGPtr<GstPad>(GstPad* ptr);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to