WebKit Bugzilla
Attachment 340505 Details for
Bug 185657
: [GStreamer]: Consider GstStream(Collection) as if if was not a GInitiallyUnowned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Spelling fixes in the ChageLog.
GStreamer-Do-not-steal-GstStreamCollections-refere.patch (text/plain), 5.33 KB, created by
Thibault Saunier
on 2018-05-16 11:25:21 PDT
(
hide
)
Description:
Spelling fixes in the ChageLog.
Filename:
MIME Type:
Creator:
Thibault Saunier
Created:
2018-05-16 11:25:21 PDT
Size:
5.33 KB
patch
obsolete
>From 85fbeeefd8d29ad1fd05524f6218a2560df11ea5 Mon Sep 17 00:00:00 2001 >From: Thibault Saunier <tsaunier@igalia.com> >Date: Tue, 15 May 2018 17:12:42 -0400 >Subject: [PATCH xserver] [GStreamer]: Do not steal GstStreamCollection's > reference to GstStream > >Before GStreamer 1.14[1] GstStream's reference was not sunk when creating >it, meaning that when we were using > > `GRefPtr<GstStream> stream = gst_stream_collection_get(collection, stream_index);` > >we were actually calling `g_object_sink_ref(some_stream);` leading to taking >ownership of that (floating) reference, while we were not actually owning it as it was >owned by the GstStreamCollection itself. In the end we were ending up >unrefing an already destroyed object randomly later on (see bug #184581) > >This patchs makes sure the floating reference is sunk (giving real ownership >to the GstStreamCollection in the end) for Gst < 1.14. > >Starting from 1.14, the ref is sunk in gst_stream_new and we will not do anything >as we do not need to anymore. > >[1] commit f119e93b47efb06ffc68c01d3e094d5346c30041 `gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent` > >https://bugs.webkit.org/show_bug.cgi?id=185657 >--- > Source/WebCore/ChangeLog | 27 +++++++++++++++++++ > .../graphics/gstreamer/GRefPtrGStreamer.cpp | 6 ++--- > .../gstreamer/MediaPlayerPrivateGStreamer.cpp | 3 ++- > 3 files changed, 31 insertions(+), 5 deletions(-) > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 31c41ac4c5f..207080eb50e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2018-05-15 Thibault Saunier <tsaunier@igalia.com> >+ >+ [GStreamer]: Consider GstStream(Collection) as if if was not a GInitiallyUnowned >+ https://bugs.webkit.org/show_bug.cgi?id=185657 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-10 Thibault Saunier <tsaunier@igalia.com> > > [GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase >diff --git a/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp >index f1cbad7e05d..26014d2ec19 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp >@@ -356,14 +356,13 @@ template <> void derefGPtr<GstQuery>(GstQuery* ptr) > #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); > } > > 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,14 +375,13 @@ template <> void derefGPtr<GstStream>(GstStream* ptr) > > template <> GRefPtr<GstStreamCollection> adoptGRef(GstStreamCollection* ptr) > { >- ASSERT(!ptr || !g_object_is_floating(ptr)); > return GRefPtr<GstStreamCollection>(ptr, GRefPtrAdopt); > } > > 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; > } >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index ce0ab819e4c..8822271e78c 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -1323,9 +1323,10 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message) > > 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())); > >-- >2.17.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185657
:
340434
|
340435
|
340501
| 340505