Bug 54870 - [GStreamer] GRefPtr support for GstElement
Summary: [GStreamer] GRefPtr support for GstElement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-21 04:42 PST by Philippe Normand
Modified: 2011-02-24 04:48 PST (History)
2 users (show)

See Also:


Attachments
proposed patch (7.58 KB, patch)
2011-02-21 04:46 PST, Philippe Normand
no flags Details | Formatted Diff | Diff
proposed patch (7.59 KB, patch)
2011-02-21 04:53 PST, Philippe Normand
mrobinson: review-
Details | Formatted Diff | Diff
proposed patch (7.76 KB, patch)
2011-02-23 00:48 PST, Philippe Normand
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2011-02-21 04:42:32 PST
So in some places we could use GstElement smart pointer without explicitely calling gst_object_unref.
Comment 1 Philippe Normand 2011-02-21 04:46:16 PST
Created attachment 83148 [details]
proposed patch
Comment 2 WebKit Review Bot 2011-02-21 04:49:21 PST
Attachment 83148 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/CMakeListsEfl.txt', u'Sourc..." exit_code: 1

Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h:20:  #ifndef header guard has wrong style, please use: WTF_GRefPtrGStreamer_h  [build/header_guard] [5]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Philippe Normand 2011-02-21 04:53:43 PST
Created attachment 83150 [details]
proposed patch
Comment 4 Martin Robinson 2011-02-21 08:22:28 PST
Comment on attachment 83150 [details]
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=83150&action=review

> Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp:32
> +template <> void derefGPtr<GstElement>(GstElement* ptr)
> +{
> +    if (ptr)
> +        gst_object_unref(ptr);
> +}

There should also be a specialization for refGPtr even if it's currently unused with your changes. If that's not there g_object_ref will be used when you assign a GRefPtr.
Comment 5 Philippe Normand 2011-02-23 00:48:47 PST
Created attachment 83455 [details]
proposed patch
Comment 6 Philippe Normand 2011-02-24 04:48:36 PST
Committed r79546: <http://trac.webkit.org/changeset/79546>