Changeset 140443 in webkit
- Timestamp:
- Jan 22, 2013, 11:15:38 AM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
platform/audio/gstreamer/AudioDestinationGStreamer.cpp (modified) (3 diffs)
-
platform/audio/gstreamer/AudioFileReaderGStreamer.cpp (modified) (2 diffs)
-
platform/graphics/gstreamer/GStreamerGWorld.cpp (modified) (2 diffs)
-
platform/graphics/gstreamer/GStreamerVersioning.cpp (modified) (1 diff)
-
platform/graphics/gstreamer/GStreamerVersioning.h (modified) (1 diff)
-
platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r140441 r140443 1 2013-01-22 Christophe Dumez <christophe.dumez@intel.com> 2 3 [gstreamer] GstBus signal watch should be removed on clean up 4 https://bugs.webkit.org/show_bug.cgi?id=107544 5 6 Reviewed by Philippe Normand. 7 8 Our gstreamer backend code currently calls gst_bus_add_signal_watch() 9 on GstBus to add a signal watch. As per the gstreamer documentation, 10 "To clean up, the caller is responsible for calling 11 gst_bus_remove_signal_watch() as many times as this function is 12 called". This is because gst_bus_add_signal_watch() causes the GstBus 13 object to be ref'd and gst_bus_remove_signal_watch() needs to be 14 called to properly unref it. 15 16 This patch makes sure that gst_bus_remove_signal_watch() is called 17 on the GstBus object when cleaning up. This patch also uses smart 18 pointers for GstBus objects for consistency. 19 20 No new tests, no behavior change for layout tests. 21 22 * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: 23 (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): 24 (WebCore::AudioDestinationGStreamer::~AudioDestinationGStreamer): 25 * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: 26 (WebCore::AudioFileReader::~AudioFileReader): 27 (WebCore::AudioFileReader::decodeAudioForBusCreation): 28 * platform/graphics/gstreamer/GStreamerGWorld.cpp: 29 (WebCore::GStreamerGWorld::GStreamerGWorld): 30 * platform/graphics/gstreamer/GStreamerVersioning.cpp: 31 (webkitGstPipelineGetBus): 32 * platform/graphics/gstreamer/GStreamerVersioning.h: 33 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 34 (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): 35 1 36 2013-01-22 Adam Barth <abarth@webkit.org> 2 37 -
trunk/Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp
r139290 r140443 27 27 #include <wtf/gobject/GOwnPtr.h> 28 28 #include "GRefPtrGStreamer.h" 29 #include "GStreamerVersioning.h" 29 30 #include "Logging.h" 30 31 #include "WebKitWebAudioSourceGStreamer.h" … … 75 76 { 76 77 m_pipeline = gst_pipeline_new("play"); 77 G stBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline));78 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_pipeline)); 78 79 ASSERT(bus); 79 gst_bus_add_signal_watch(bus); 80 g_signal_connect(bus, "message", G_CALLBACK(messageCallback), this); 81 gst_object_unref(bus); 80 gst_bus_add_signal_watch(bus.get()); 81 g_signal_connect(bus.get(), "message", G_CALLBACK(messageCallback), this); 82 82 83 83 GstElement* webkitAudioSrc = reinterpret_cast<GstElement*>(g_object_new(WEBKIT_TYPE_WEB_AUDIO_SRC, … … 108 108 AudioDestinationGStreamer::~AudioDestinationGStreamer() 109 109 { 110 G stBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline));110 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_pipeline)); 111 111 ASSERT(bus); 112 g_signal_handlers_disconnect_by_func(bus, reinterpret_cast<gpointer>(messageCallback), this); 113 gst_object_unref(bus); 112 g_signal_handlers_disconnect_by_func(bus.get(), reinterpret_cast<gpointer>(messageCallback), this); 113 gst_bus_remove_signal_watch(bus.get()); 114 114 115 gst_element_set_state(m_pipeline, GST_STATE_NULL); 115 116 gst_object_unref(m_pipeline); -
trunk/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
r138786 r140443 182 182 { 183 183 if (m_pipeline) { 184 G stBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline));184 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_pipeline)); 185 185 ASSERT(bus); 186 g_signal_handlers_disconnect_by_func(bus, reinterpret_cast<gpointer>(messageCallback), this); 187 gst_object_unref(bus); 186 g_signal_handlers_disconnect_by_func(bus.get(), reinterpret_cast<gpointer>(messageCallback), this); 187 gst_bus_remove_signal_watch(bus.get()); 188 188 189 gst_element_set_state(m_pipeline, GST_STATE_NULL); 189 190 gst_object_unref(GST_OBJECT(m_pipeline)); … … 414 415 m_pipeline = gst_pipeline_new(0); 415 416 416 G stBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline));417 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_pipeline)); 417 418 ASSERT(bus); 418 gst_bus_add_signal_watch(bus); 419 g_signal_connect(bus, "message", G_CALLBACK(messageCallback), this); 420 gst_object_unref(bus); 419 gst_bus_add_signal_watch(bus.get()); 420 g_signal_connect(bus.get(), "message", G_CALLBACK(messageCallback), this); 421 421 422 422 GstElement* source; -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
r128570 r140443 23 23 24 24 #include "GRefPtrGStreamer.h" 25 #include "GStreamerVersioning.h" 25 26 #include <gst/gst.h> 26 27 #include <gst/interfaces/xoverlay.h> … … 60 61 { 61 62 // XOverlay messages need to be handled synchronously. 62 GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline)); 63 gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, this); 64 g_signal_connect(bus, "sync-message::element", G_CALLBACK(gstGWorldSyncMessageCallback), this); 65 gst_object_unref(bus); 63 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_pipeline)); 64 gst_bus_set_sync_handler(bus.get(), gst_bus_sync_signal_handler, this); 65 g_signal_connect(bus.get(), "sync-message::element", G_CALLBACK(gstGWorldSyncMessageCallback), this); 66 66 } 67 67 -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.cpp
r140425 r140443 68 68 #else 69 69 return GST_PAD_CAPS(pad); 70 #endif 71 } 72 73 GRefPtr<GstBus> webkitGstPipelineGetBus(GstPipeline* pipeline) 74 { 75 #ifdef GST_API_VERSION_1 76 return adoptGRef(gst_pipeline_get_bus(pipeline)); 77 #else 78 // gst_pipeline_get_bus returns a floating reference in 79 // gstreamer 0.10 so we should not adopt. 80 return gst_pipeline_get_bus(pipeline); 70 81 #endif 71 82 } -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerVersioning.h
r140425 r140443 33 33 GstPad* webkitGstGhostPadFromStaticTemplate(GstStaticPadTemplate*, const gchar* name, GstPad* target); 34 34 GRefPtr<GstCaps> webkitGstGetPadCaps(GstPad*); 35 GRefPtr<GstBus> webkitGstPipelineGetBus(GstPipeline*); 35 36 #if ENABLE(VIDEO) 36 37 bool getVideoSizeAndFormatFromCaps(GstCaps*, WebCore::IntSize&, GstVideoFormat&, int& pixelAspectRatioNumerator, int& pixelAspectRatioDenominator, int& stride); -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r140422 r140443 276 276 277 277 if (m_playBin) { 278 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_playBin.get())); 279 ASSERT(bus); 280 g_signal_handlers_disconnect_by_func(bus.get(), reinterpret_cast<gpointer>(mediaPlayerPrivateMessageCallback), this); 281 gst_bus_remove_signal_watch(bus.get()); 282 278 283 gst_element_set_state(m_playBin.get(), GST_STATE_NULL); 279 284 m_playBin = 0; … … 1802 1807 #endif 1803 1808 1804 GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_playBin.get())); 1805 gst_bus_add_signal_watch(bus); 1806 g_signal_connect(bus, "message", G_CALLBACK(mediaPlayerPrivateMessageCallback), this); 1807 gst_object_unref(bus); 1809 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_playBin.get())); 1810 gst_bus_add_signal_watch(bus.get()); 1811 g_signal_connect(bus.get(), "message", G_CALLBACK(mediaPlayerPrivateMessageCallback), this); 1808 1812 1809 1813 g_object_set(m_playBin.get(), "mute", m_player->muted(), NULL);
Note:
See TracChangeset
for help on using the changeset viewer.