Changeset 96310 in webkit
- Timestamp:
- Sep 29, 2011 1:03:31 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96307 r96310 1 2011-09-29 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] fullscreen video pause/play fails 4 https://bugs.webkit.org/show_bug.cgi?id=66936 5 6 Reviewed by Martin Robinson. 7 8 Don't use the identity element to avoid painting of the in-window 9 video. Instead simply make the sink aware of the fullscreen state 10 and ignore buffers if fullscreen and autovideosink are 11 active. Also fixed two deadlocks happening when a paused pipeline 12 is switched to fullscreen and when fullscreen is disabled for a 13 paused pipeline. 14 15 * platform/graphics/gstreamer/GStreamerGWorld.cpp: 16 (WebCore::GStreamerGWorld::enterFullscreen): 17 (WebCore::GStreamerGWorld::exitFullscreen): 18 * platform/graphics/gstreamer/GStreamerGWorld.h: 19 (WebCore::GStreamerGWorld::isFullscreen): 20 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 21 (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): 22 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: 23 (webkit_video_sink_render): 24 (webkit_video_sink_new): 25 * platform/graphics/gstreamer/VideoSinkGStreamer.h: 26 1 27 2011-09-29 Tim Horton <timothy_horton@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
r95901 r96310 90 90 g_object_get(m_pipeline, "video-sink", &videoSink.outPtr(), NULL); 91 91 GstElement* tee = gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoTee"); 92 GstElement* valve = gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoValve");93 94 g_object_set(valve, "drop-probability", 1.0, NULL);95 92 96 93 // Add and link a queue, ffmpegcolorspace, videoscale and sink in the bin. … … 110 107 m_dynamicPadName = gst_pad_get_name(srcPad); 111 108 112 // Roll new elements to pipeline state. 113 gst_element_sync_state_with_parent(queue); 114 gst_element_sync_state_with_parent(colorspace); 115 gst_element_sync_state_with_parent(videoScale); 116 gst_element_sync_state_with_parent(platformVideoSink); 117 109 // Synchronize the new elements with pipeline state. If it's 110 // paused limit the state change to pre-rolling. 111 GstState state; 112 gst_element_get_state(m_pipeline, &state, 0, 0); 113 if (state < GST_STATE_PLAYING) 114 state = GST_STATE_READY; 115 116 gst_element_set_state(platformVideoSink, state); 117 gst_element_set_state(videoScale, state); 118 gst_element_set_state(colorspace, state); 119 gst_element_set_state(queue, state); 118 120 gst_object_unref(tee); 119 121 … … 161 163 GstElement* videoScale = gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoScale"); 162 164 163 GstElement* valve = gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoValve");164 165 g_object_set(valve, "drop-probability", 0.0, NULL);166 167 165 // Get pads to unlink and remove. 168 166 GstPad* srcPad = gst_element_get_static_pad(tee, m_dynamicPadName); 169 167 GstPad* sinkPad = gst_element_get_static_pad(queue, "sink"); 170 168 171 // Block data flow towards the pipeline branch to remove. 172 gst_pad_set_blocked(srcPad, true); 173 174 // Unlink and release request pad. 175 gst_pad_unlink(srcPad, sinkPad); 176 gst_element_release_request_pad(tee, srcPad); 169 // Block data flow towards the pipeline branch to remove. No need 170 // for pad blocking if the pipeline is paused. 171 GstState state; 172 gst_element_get_state(m_pipeline, &state, 0, 0); 173 if (state < GST_STATE_PLAYING || gst_pad_set_blocked(srcPad, true)) { 174 175 // Unlink and release request pad. 176 gst_pad_unlink(srcPad, sinkPad); 177 gst_element_release_request_pad(tee, srcPad); 178 179 // Unlink, remove and cleanup queue, ffmpegcolorspace, videoScale and sink. 180 gst_element_unlink_many(queue, colorspace, videoScale, platformVideoSink, NULL); 181 gst_bin_remove_many(GST_BIN(videoSink.get()), queue, colorspace, videoScale, platformVideoSink, NULL); 182 gst_element_set_state(platformVideoSink, GST_STATE_NULL); 183 gst_element_set_state(videoScale, GST_STATE_NULL); 184 gst_element_set_state(colorspace, GST_STATE_NULL); 185 gst_element_set_state(queue, GST_STATE_NULL); 186 } 187 177 188 gst_object_unref(GST_OBJECT(srcPad)); 178 189 gst_object_unref(GST_OBJECT(sinkPad)); 179 190 180 // Unlink, remove and cleanup queue, ffmpegcolorspace, videoScale and sink.181 gst_element_unlink_many(queue, colorspace, videoScale, platformVideoSink, NULL);182 gst_bin_remove_many(GST_BIN(videoSink.get()), queue, colorspace, videoScale, platformVideoSink, NULL);183 gst_element_set_state(queue, GST_STATE_NULL);184 gst_element_set_state(colorspace, GST_STATE_NULL);185 gst_element_set_state(videoScale, GST_STATE_NULL);186 gst_element_set_state(platformVideoSink, GST_STATE_NULL);187 191 gst_object_unref(queue); 188 192 gst_object_unref(colorspace); -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h
r95901 r96310 52 52 void exitFullscreen(); 53 53 54 bool isFullscreen() const { return m_dynamicPadName; } 55 54 56 void setWindowOverlay(GstMessage* message); 55 57 PlatformVideoWindow* platformVideoWindow() const { return m_videoWindow.get(); } -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r95799 r96310 1670 1670 g_signal_connect(m_playBin, "audio-changed", G_CALLBACK(mediaPlayerPrivateAudioChangedCallback), this); 1671 1671 1672 m_webkitVideoSink = webkit_video_sink_new( );1672 m_webkitVideoSink = webkit_video_sink_new(m_gstGWorld.get()); 1673 1673 1674 1674 g_signal_connect(m_webkitVideoSink, "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this); … … 1677 1677 GstElement* videoTee = gst_element_factory_make("tee", "videoTee"); 1678 1678 GstElement* queue = gst_element_factory_make("queue", 0); 1679 GstElement* identity = gst_element_factory_make("identity", "videoValve");1680 1679 1681 1680 // Take ownership. … … 1687 1686 // and initially block the data flow towards it and configure it 1688 1687 1689 gst_bin_add_many(GST_BIN(m_videoSinkBin), videoTee, queue, identity,NULL);1688 gst_bin_add_many(GST_BIN(m_videoSinkBin), videoTee, queue, NULL); 1690 1689 1691 1690 // Link a new src pad from tee to queue1. … … 1729 1728 1730 1729 // Faster elements linking. 1731 gst_element_link_pads_full(queue, "src", identity, "sink", GST_PAD_LINK_CHECK_NOTHING); 1732 gst_element_link_pads_full(identity, "src", actualVideoSink, "sink", GST_PAD_LINK_CHECK_NOTHING); 1730 gst_element_link_pads_full(queue, "src", actualVideoSink, "sink", GST_PAD_LINK_CHECK_NOTHING); 1733 1731 1734 1732 // Add a ghostpad to the bin so it can proxy to tee. -
trunk/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
r94155 r96310 64 64 GMutex* buffer_mutex; 65 65 GCond* data_cond; 66 WebCore::GStreamerGWorld* gstGWorld; 66 67 67 68 // If this is TRUE all processing should finish ASAP … … 144 145 145 146 if (priv->unlocked) { 147 g_mutex_unlock(priv->buffer_mutex); 148 return GST_FLOW_OK; 149 } 150 151 // Ignore buffers if the video is already in fullscreen using 152 // another sink. 153 if (priv->gstGWorld->isFullscreen()) { 146 154 g_mutex_unlock(priv->buffer_mutex); 147 155 return GST_FLOW_OK; … … 366 374 * Return value: a #GstElement for the newly created video sink 367 375 */ 368 GstElement* 369 webkit_video_sink_new(void) 370 { 371 return (GstElement*)g_object_new(WEBKIT_TYPE_VIDEO_SINK, 0); 376 GstElement* webkit_video_sink_new(WebCore::GStreamerGWorld* gstGWorld) 377 { 378 GstElement* element = GST_ELEMENT(g_object_new(WEBKIT_TYPE_VIDEO_SINK, 0)); 379 WEBKIT_VIDEO_SINK(element)->priv->gstGWorld = gstGWorld; 380 return element; 372 381 } 373 382 -
trunk/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
r94155 r96310 23 23 #if ENABLE(VIDEO) && USE(GSTREAMER) 24 24 25 #include "GStreamerGWorld.h" 25 26 #include <glib-object.h> 26 27 #include <gst/video/gstvideosink.h> … … 73 74 }; 74 75 76 75 77 GType webkit_video_sink_get_type(void) G_GNUC_CONST; 76 GstElement *webkit_video_sink_new( void);78 GstElement *webkit_video_sink_new(WebCore::GStreamerGWorld*); 77 79 78 80 G_END_DECLS
Note: See TracChangeset
for help on using the changeset viewer.