Changeset 101082 in webkit


Ignore:
Timestamp:
Nov 23, 2011 7:33:19 AM (12 years ago)
Author:
Philippe Normand
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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r101081 r101082  
     12011-11-23  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer] improper usage of gst_object_ref_sink
     4        https://bugs.webkit.org/show_bug.cgi?id=73014
     5
     6        Reviewed by Martin Robinson.
     7
     8        No new tests. Existing tests cover this already.
     9
     10        * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
     11        (WTF::adoptGRef): Ensure this is called with non-floating GstObjects.
     12        (WTF::GstElement): Replace gst_object_ref_sink with
     13        gst_object_ref+gst_object_sink like advised in the GstObject documentation.
     14        (WTF::GstPad): Ditto.
     15        * platform/graphics/gstreamer/GRefPtrGStreamer.h:
     16
    1172011-11-23  Yury Semikhatsky  <yurys@chromium.org>
    218
  • trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp

    r99977 r101082  
    2626namespace WTF {
    2727
     28template <> GRefPtr<GstElement> adoptGRef(GstElement* ptr)
     29{
     30    ASSERT(!GST_OBJECT_IS_FLOATING(GST_OBJECT(ptr)));
     31    return GRefPtr<GstElement>(ptr, GRefPtrAdopt);
     32}
     33
    2834template <> GstElement* refGPtr<GstElement>(GstElement* ptr)
    2935{
    30     if (ptr)
    31         gst_object_ref_sink(ptr);
     36    if (ptr) {
     37        gst_object_ref(GST_OBJECT(ptr));
     38        gst_object_sink(GST_OBJECT(ptr));
     39    }
     40
    3241    return ptr;
    3342}
     
    3948}
    4049
     50template <> GRefPtr<GstPad> adoptGRef(GstPad* ptr)
     51{
     52    ASSERT(!GST_OBJECT_IS_FLOATING(GST_OBJECT(ptr)));
     53    return GRefPtr<GstPad>(ptr, GRefPtrAdopt);
     54}
     55
    4156template <> GstPad* refGPtr<GstPad>(GstPad* ptr)
    4257{
    43     if (ptr)
    44         gst_object_ref_sink(GST_OBJECT(ptr));
     58    if (ptr) {
     59        gst_object_ref(GST_OBJECT(ptr));
     60        gst_object_sink(GST_OBJECT(ptr));
     61    }
    4562    return ptr;
    4663}
  • trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h

    r99977 r101082  
    3030namespace WTF {
    3131
     32template<> GRefPtr<GstElement> adoptGRef(GstElement* ptr);
    3233template<> GstElement* refGPtr<GstElement>(GstElement* ptr);
    3334template<> void derefGPtr<GstElement>(GstElement* ptr);
    3435
     36template<> GRefPtr<GstPad> adoptGRef(GstPad* ptr);
    3537template<> GstPad* refGPtr<GstPad>(GstPad* ptr);
    3638template<> void derefGPtr<GstPad>(GstPad* ptr);
Note: See TracChangeset for help on using the changeset viewer.