Changeset 141265 in webkit
- Timestamp:
- Jan 30, 2013 6:55:50 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141260 r141265 1 2013-01-20 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] USE(NATIVE_FULLSCREEN_VIDEO) support 4 https://bugs.webkit.org/show_bug.cgi?id=106760 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Initial support for NATIVE_FULLSCREEN_VIDEO in the GStreamer media 9 player. A new FullscreenVideoControllerGStreamer class is 10 introduced, ports interested to implement native fullscreen video 11 support should inherit from it (see FullscreenVideoControllerGtk) 12 and hook it in the MediaPlayerPrivateGStreamer backend. 13 14 The GStreamerGWorld port to GStreamer 1.x is partly based on a 15 patch by Sebastian Dröge <sebastian.droge@collabora.com>. 16 17 * GNUmakefile.am: Enable NATIVE_FULLSCREEN_VIDEO support. 18 * GNUmakefile.list.am: New 19 FullscreenVideoController{GStreamer,Gtk} modules. 20 * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp: Added. 21 (WebCore): 22 (WebCore::playerVolumeChangedCallback): Playbin notify::volume 23 signal callback. 24 (WebCore::playerMuteChangedCallback): Playbin notify::mute signal callback. 25 (WebCore::FullscreenVideoControllerGStreamer::FullscreenVideoControllerGStreamer): 26 (WebCore::FullscreenVideoControllerGStreamer::~FullscreenVideoControllerGStreamer): 27 (WebCore::FullscreenVideoControllerGStreamer::enterFullscreen): 28 Switch GStreamerGWorld to full screen, hook in to playbin's 29 notify::volume and mute signals and initialize the full screen window. 30 (WebCore::FullscreenVideoControllerGStreamer::exitFullscreen): 31 Destroy the full screen window, disconnect from playbin signals 32 and switch GStreamerGWorld out of full screen. 33 (WebCore::FullscreenVideoControllerGStreamer::exitOnUserRequest): 34 Trigger exit from full screen mode. This method is meant to be 35 called when the user explicitely requests to exit from full screen 36 by pressing a key or something similar. 37 (WebCore::FullscreenVideoControllerGStreamer::togglePlay): Switch 38 between play and pause states. Useful for child classes. 39 (WebCore::FullscreenVideoControllerGStreamer::increaseVolume): 40 Useful for child classes as well. 41 (WebCore::FullscreenVideoControllerGStreamer::decreaseVolume): Ditto. 42 (WebCore::FullscreenVideoControllerGStreamer::setVolume): Ditto. 43 (WebCore::FullscreenVideoControllerGStreamer::timeToString): Ditto. 44 * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.h: Added. 45 (WebCore): 46 (FullscreenVideoControllerGStreamer): 47 (WebCore::FullscreenVideoControllerGStreamer::playStateChanged): 48 To be implemented by child class to reflect the player's state changed. 49 (WebCore::FullscreenVideoControllerGStreamer::volumeChanged): To 50 be implemented by child class as well. 51 (WebCore::FullscreenVideoControllerGStreamer::muteChanged): Ditto. 52 (WebCore::FullscreenVideoControllerGStreamer::initializeWindow): Ditto. 53 (WebCore::FullscreenVideoControllerGStreamer::destroyWindow): Ditto. 54 * platform/graphics/gstreamer/GStreamerGWorld.cpp: 55 (WebCore::gstGWorldSyncMessageCallback): Adapt for GStreamer video 56 overlay API changes. 57 (WebCore::GStreamerGWorld::GStreamerGWorld): 58 gst_bus_set_sync_handler takes one more argument in GStreamer 1.x. 59 (WebCore::GStreamerGWorld::enterFullscreen): ffmpegcolorspace was 60 renamed to videoconvert in GStreamer 1.x and the tee src pad 61 template was renamed to src_%u. There is no need to send a new 62 segment query either. 63 (WebCore): 64 (WebCore::gstGWorldPadProbeCallback): Remove the platform video 65 sink branch once the tee source pad starting it has been blocked. 66 (WebCore::GStreamerGWorld::exitFullscreen): Refactor to use an 67 asynchronous pad probe. 68 (WebCore::GStreamerGWorld::removePlatformVideoSink): Refactored 69 from exitFullscreen. 70 (WebCore::GStreamerGWorld::setWindowOverlay): Adapt for GStreamer video 71 overlay API changes. 72 * platform/graphics/gstreamer/GStreamerGWorld.h: 73 (GStreamerGWorld): 74 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 75 (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): 76 Hook NATIVE_FULLSCREEN_VIDEO support. 77 (WebCore::MediaPlayerPrivateGStreamer::volume): Playbin volume 78 query used by the FullscreenVideoController. 79 (WebCore): 80 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 81 (WebCore): 82 (MediaPlayerPrivateGStreamer): volume(), muted() and MediaPlayer 83 accessor methods added. NATIVE_FULLSCREEN_VIDEO methods added as well. 84 (WebCore::MediaPlayerPrivateGStreamer::canEnterFullscreen): 85 (WebCore::MediaPlayerPrivateGStreamer::mediaPlayer): 86 * platform/graphics/gstreamer/PlatformVideoWindow.h: Re-enable 87 module if NATIVE_FULLSCREEN_VIDEO is turned on. 88 * platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp: Ditto. 89 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: Re-enable 90 GStreamerGWorld support. 91 (_WebKitVideoSinkPrivate): 92 (webkitVideoSinkRender): 93 * platform/graphics/gstreamer/VideoSinkGStreamer.h: Ditto. 94 1 95 2013-01-30 Pavel Feldman <pfeldman@chromium.org> 2 96 -
trunk/Source/WebCore/GNUmakefile.am
r141241 r141265 162 162 webcore_cppflags += -DGST_DISABLE_DEPRECATED 163 163 endif # END ENABLE_DEBUG 164 webcore_cppflags += -DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1 164 165 endif # END USE_GSTREAMER 165 166 else -
trunk/Source/WebCore/GNUmakefile.list.am
r141219 r141265 6066 6066 Source/WebCore/platform/graphics/freetype/FontPlatformData.h \ 6067 6067 Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp \ 6068 Source/WebCore/platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp \ 6069 Source/WebCore/platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.h \ 6068 6070 Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp \ 6069 6071 Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h \ -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp
r140443 r141265 19 19 20 20 #include "config.h" 21 21 22 #include "GStreamerGWorld.h" 22 #if ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1) 23 24 #if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 23 25 24 26 #include "GRefPtrGStreamer.h" 25 27 #include "GStreamerVersioning.h" 26 28 #include <gst/gst.h> 29 #include <gst/pbutils/pbutils.h> 30 31 #ifdef GST_API_VERSION_1 32 #include <gst/video/videooverlay.h> 33 #else 27 34 #include <gst/interfaces/xoverlay.h> 28 #include <gst/pbutils/pbutils.h> 35 #endif 36 29 37 30 38 #if PLATFORM(GTK) … … 35 43 #endif 36 44 45 #ifndef GST_API_VERSION_1 46 static const char* gVideoConvertName = "ffmpegcolorspace"; 47 #else 48 static const char* gVideoConvertName = "videoconvert"; 49 #endif 50 37 51 using namespace std; 38 52 … … 44 58 45 59 GStreamerGWorld* gstGWorld = static_cast<GStreamerGWorld*>(data); 60 #ifndef GST_API_VERSION_1 46 61 const GstStructure* structure = gst_message_get_structure(message); 47 62 … … 49 64 || gst_structure_has_name(structure, "have-ns-view")) 50 65 gstGWorld->setWindowOverlay(message); 66 #else 67 if (gst_is_video_overlay_prepare_window_handle_message(message)) 68 gstGWorld->setWindowOverlay(message); 69 #endif 51 70 return TRUE; 52 71 } … … 62 81 // XOverlay messages need to be handled synchronously. 63 82 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_pipeline)); 83 #ifndef GST_API_VERSION_1 64 84 gst_bus_set_sync_handler(bus.get(), gst_bus_sync_signal_handler, this); 85 #else 86 gst_bus_set_sync_handler(bus.get(), gst_bus_sync_signal_handler, this, 0); 87 #endif 65 88 g_signal_connect(bus.get(), "sync-message::element", G_CALLBACK(gstGWorldSyncMessageCallback), this); 66 89 } … … 82 105 83 106 GstElement* platformVideoSink = gst_element_factory_make("autovideosink", "platformVideoSink"); 84 GstElement* colorspace = gst_element_factory_make( "ffmpegcolorspace", "colorspace");107 GstElement* colorspace = gst_element_factory_make(gVideoConvertName, "colorspace"); 85 108 GstElement* queue = gst_element_factory_make("queue", "queue"); 86 109 GstElement* videoScale = gst_element_factory_make("videoscale", "videoScale"); … … 95 118 GRefPtr<GstElement> tee = adoptGRef(gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoTee")); 96 119 97 // Add and link a queue, ffmpegcolorspace, videoscale and sink in the bin.98 120 gst_bin_add_many(GST_BIN(videoSink.get()), platformVideoSink, videoScale, colorspace, queue, NULL); 99 121 … … 104 126 105 127 // Link a new src pad from tee to queue. 128 #ifndef GST_API_VERSION_1 106 129 GRefPtr<GstPad> srcPad = adoptGRef(gst_element_get_request_pad(tee.get(), "src%d")); 130 #else 131 GRefPtr<GstPad> srcPad = adoptGRef(gst_element_get_request_pad(tee.get(), "src_%u")); 132 #endif 107 133 GRefPtr<GstPad> sinkPad = adoptGRef(gst_element_get_static_pad(queue, "sink")); 108 134 gst_pad_link(srcPad.get(), sinkPad.get()); … … 122 148 gst_element_set_state(queue, state); 123 149 150 #ifndef GST_API_VERSION_1 124 151 // Query the current media segment informations and send them towards 125 152 // the new tee branch downstream. 126 127 153 GstQuery* query = gst_query_new_segment(GST_FORMAT_TIME); 128 154 gboolean queryResult = gst_element_query(m_pipeline, query); … … 133 159 } 134 160 161 gint64 position; 135 162 GstFormat format; 136 gint64 position;137 163 if (!gst_element_query_position(m_pipeline, &format, &position)) 138 164 position = 0; … … 146 172 147 173 gst_query_unref(query); 174 #endif 148 175 return true; 149 176 } 177 178 #ifdef GST_API_VERSION_1 179 static GstPadProbeReturn gstGWorldPadProbeCallback(GstPad* pad, GstPadProbeInfo* info, GStreamerGWorld* gstGWorld) 180 { 181 gstGWorld->removePlatformVideoSink(); 182 return GST_PAD_PROBE_REMOVE; 183 } 184 #endif 150 185 151 186 void GStreamerGWorld::exitFullscreen() … … 154 189 return; 155 190 191 GstElement* sinkPtr = 0; 192 g_object_get(m_pipeline, "video-sink", &sinkPtr, NULL); 193 GRefPtr<GstElement> videoSink = adoptGRef(sinkPtr); 194 195 GRefPtr<GstElement> tee = adoptGRef(gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoTee")); 196 GRefPtr<GstPad> srcPad = adoptGRef(gst_element_get_static_pad(tee.get(), m_dynamicPadName.get())); 197 198 // Block data flow towards the pipeline branch to remove. No need 199 // for pad blocking if the pipeline is paused. 200 GstState state; 201 gst_element_get_state(m_pipeline, &state, 0, 0); 202 #ifdef GST_API_VERSION_1 203 if (state >= GST_STATE_PLAYING) 204 gst_pad_add_probe(srcPad.get(), GST_PAD_PROBE_TYPE_IDLE, reinterpret_cast<GstPadProbeCallback>(gstGWorldPadProbeCallback), this, 0); 205 else 206 #else 207 if (state < GST_STATE_PLAYING || gst_pad_set_blocked(srcPad.get(), true)) 208 #endif 209 removePlatformVideoSink(); 210 211 m_videoWindow = 0; 212 } 213 214 void GStreamerGWorld::removePlatformVideoSink() 215 { 216 if (!m_dynamicPadName) 217 return; 218 156 219 // Get video sink bin and the elements to remove. 157 GRefPtr<GstElement> videoSink;158 220 GstElement* sinkPtr = 0; 159 160 221 g_object_get(m_pipeline, "video-sink", &sinkPtr, NULL); 161 videoSink = adoptGRef(sinkPtr);222 GRefPtr<GstElement> videoSink = adoptGRef(sinkPtr); 162 223 163 224 GRefPtr<GstElement> tee = adoptGRef(gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoTee")); … … 167 228 GRefPtr<GstElement> videoScale = adoptGRef(gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoScale")); 168 229 169 // Get pads to unlink and remove.170 230 GRefPtr<GstPad> srcPad = adoptGRef(gst_element_get_static_pad(tee.get(), m_dynamicPadName.get())); 171 231 GRefPtr<GstPad> sinkPad = adoptGRef(gst_element_get_static_pad(queue.get(), "sink")); 172 173 // Block data flow towards the pipeline branch to remove. No need 174 // for pad blocking if the pipeline is paused. 175 GstState state; 176 gst_element_get_state(m_pipeline, &state, 0, 0); 177 if (state < GST_STATE_PLAYING || gst_pad_set_blocked(srcPad.get(), true)) { 178 179 // Unlink and release request pad. 180 gst_pad_unlink(srcPad.get(), sinkPad.get()); 181 gst_element_release_request_pad(tee.get(), srcPad.get()); 182 183 // Unlink, remove and cleanup queue, ffmpegcolorspace, videoScale and sink. 184 gst_element_unlink_many(queue.get(), colorspace.get(), videoScale.get(), platformVideoSink.get(), NULL); 185 gst_bin_remove_many(GST_BIN(videoSink.get()), queue.get(), colorspace.get(), videoScale.get(), platformVideoSink.get(), NULL); 186 gst_element_set_state(platformVideoSink.get(), GST_STATE_NULL); 187 gst_element_set_state(videoScale.get(), GST_STATE_NULL); 188 gst_element_set_state(colorspace.get(), GST_STATE_NULL); 189 gst_element_set_state(queue.get(), GST_STATE_NULL); 190 } 232 gst_pad_unlink(srcPad.get(), sinkPad.get()); 233 gst_element_release_request_pad(tee.get(), srcPad.get()); 234 235 gst_element_unlink_many(queue.get(), colorspace.get(), videoScale.get(), platformVideoSink.get(), NULL); 236 gst_bin_remove_many(GST_BIN(videoSink.get()), queue.get(), colorspace.get(), videoScale.get(), platformVideoSink.get(), NULL); 237 gst_element_set_state(platformVideoSink.get(), GST_STATE_NULL); 238 gst_element_set_state(videoScale.get(), GST_STATE_NULL); 239 gst_element_set_state(colorspace.get(), GST_STATE_NULL); 240 gst_element_set_state(queue.get(), GST_STATE_NULL); 191 241 192 242 m_dynamicPadName.clear(); … … 197 247 GstObject* sink = GST_MESSAGE_SRC(message); 198 248 249 #ifndef GST_API_VERSION_1 199 250 if (!GST_IS_X_OVERLAY(sink)) 251 #else 252 if (!GST_IS_VIDEO_OVERLAY(sink)) 253 #endif 200 254 return; 201 255 … … 206 260 m_videoWindow->prepareForOverlay(message); 207 261 262 #ifndef GST_API_VERSION_1 208 263 // gst_x_overlay_set_window_handle was introduced in -plugins-base 209 264 // 0.10.31, just like the macro for checking the version. … … 213 268 gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(sink), m_videoWindow->videoWindowId()); 214 269 #endif 270 #else 271 gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sink), m_videoWindow->videoWindowId()); 272 #endif 215 273 } 216 274 } 217 275 218 276 } 219 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)277 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h
r111258 r141265 21 21 #ifndef GStreamerGWorld_h 22 22 #define GStreamerGWorld_h 23 #if ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)23 #if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 24 24 25 25 #include <wtf/RefCounted.h> … … 50 50 51 51 GstElement* pipeline() const { return m_pipeline; } 52 void removePlatformVideoSink(); 52 53 53 54 // Returns the full-screen window created … … 68 69 69 70 } 70 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)71 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 71 72 #endif -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r140685 r141265 269 269 } 270 270 271 #if ndef GST_API_VERSION_1271 #if USE(NATIVE_FULLSCREEN_VIDEO) 272 272 if (m_videoSinkBin) { 273 273 gst_object_unref(m_videoSinkBin); … … 659 659 gst_stream_volume_set_volume(GST_STREAM_VOLUME(m_playBin.get()), GST_STREAM_VOLUME_FORMAT_CUBIC, 660 660 static_cast<double>(volume)); 661 } 662 663 float MediaPlayerPrivateGStreamer::volume() const 664 { 665 if (!m_playBin) 666 return 0; 667 668 return gst_stream_volume_get_volume(GST_STREAM_VOLUME(m_playBin.get()), GST_STREAM_VOLUME_FORMAT_CUBIC); 661 669 } 662 670 … … 1541 1549 1542 1550 g_object_set(m_playBin.get(), "mute", muted, NULL); 1551 } 1552 1553 bool MediaPlayerPrivateGStreamer::muted() const 1554 { 1555 if (!m_playBin) 1556 return false; 1557 1558 bool muted; 1559 g_object_get(m_playBin.get(), "mute", &muted, NULL); 1560 return muted; 1543 1561 } 1544 1562 … … 1741 1759 } 1742 1760 1761 #if USE(NATIVE_FULLSCREEN_VIDEO) 1762 void MediaPlayerPrivateGStreamer::enterFullscreen() 1763 { 1764 notImplemented(); 1765 } 1766 1767 void MediaPlayerPrivateGStreamer::exitFullscreen() 1768 { 1769 notImplemented(); 1770 } 1771 #endif 1772 1743 1773 bool MediaPlayerPrivateGStreamer::supportsFullscreen() const 1744 1774 { … … 1754 1784 { 1755 1785 PlatformMedia p; 1756 #if ndef GST_API_VERSION_11786 #if USE(NATIVE_FULLSCREEN_VIDEO) 1757 1787 p.type = PlatformMedia::GStreamerGWorldType; 1758 1788 p.media.gstreamerGWorld = m_gstGWorld.get(); … … 1844 1874 m_playBin = gst_element_factory_make(gPlaybinName, "play"); 1845 1875 1846 #ifndef GST_API_VERSION_11847 m_gstGWorld = GStreamerGWorld::createGWorld(m_playBin.get());1848 #endif1849 1850 1876 GRefPtr<GstBus> bus = webkitGstPipelineGetBus(GST_PIPELINE(m_playBin.get())); 1851 1877 gst_bus_add_signal_watch(bus.get()); … … 1860 1886 g_signal_connect(m_playBin.get(), "audio-changed", G_CALLBACK(mediaPlayerPrivateAudioChangedCallback), this); 1861 1887 1862 #ifndef GST_API_VERSION_1 1888 #if USE(NATIVE_FULLSCREEN_VIDEO) 1889 m_gstGWorld = GStreamerGWorld::createGWorld(m_playBin.get()); 1863 1890 m_webkitVideoSink = webkitVideoSinkNew(m_gstGWorld.get()); 1864 1891 #else … … 1870 1897 1871 1898 1872 #ifndef GST_API_VERSION_1 1873 m_videoSinkBin = gst_bin_new("video-sink"); 1874 1875 GstElement* videoTee = gst_element_factory_make("tee", "videoTee"); 1876 GstElement* queue = gst_element_factory_make("queue", 0); 1877 1878 // Take ownership. 1879 gst_object_ref_sink(m_videoSinkBin); 1880 1899 #if USE(NATIVE_FULLSCREEN_VIDEO) 1881 1900 // Build a new video sink consisting of a bin containing a tee 1882 1901 // (meant to distribute data to multiple video sinks) and our 1883 1902 // internal video sink. For fullscreen we create an autovideosink 1884 1903 // and initially block the data flow towards it and configure it 1904 1905 m_videoSinkBin = gst_bin_new("video-sink"); 1906 1907 // Take ownership. 1908 gst_object_ref_sink(m_videoSinkBin); 1909 1910 GstElement* videoTee = gst_element_factory_make("tee", "videoTee"); 1911 GstElement* queue = gst_element_factory_make("queue", 0); 1912 1913 #ifdef GST_API_VERSION_1 1914 GRefPtr<GstPad> sinkPad = adoptGRef(gst_element_get_static_pad(videoTee, "sink")); 1915 GST_OBJECT_FLAG_SET(GST_OBJECT(sinkPad.get()), GST_PAD_FLAG_PROXY_ALLOCATION); 1916 #endif 1885 1917 1886 1918 gst_bin_add_many(GST_BIN(m_videoSinkBin), videoTee, queue, NULL); … … 1911 1943 if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_fpsSink), "video-sink")) { 1912 1944 g_object_set(m_fpsSink, "video-sink", m_webkitVideoSink, NULL); 1913 #if ndef GST_API_VERSION_11945 #if USE(NATIVE_FULLSCREEN_VIDEO) 1914 1946 gst_bin_add(GST_BIN(m_videoSinkBin), m_fpsSink); 1915 1947 #endif … … 1922 1954 1923 1955 if (!m_fpsSink) { 1924 #if ndef GST_API_VERSION_11956 #if USE(NATIVE_FULLSCREEN_VIDEO) 1925 1957 gst_bin_add(GST_BIN(m_videoSinkBin), m_webkitVideoSink); 1926 1958 #endif … … 1930 1962 ASSERT(actualVideoSink); 1931 1963 1932 #if ndef GST_API_VERSION_11964 #if USE(NATIVE_FULLSCREEN_VIDEO) 1933 1965 // Faster elements linking. 1934 1966 gst_element_link_pads_full(queue, "src", actualVideoSink, "sink", GST_PAD_LINK_CHECK_NOTHING); -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r140685 r141265 40 40 namespace WebCore { 41 41 42 #ifdef FullscreenVideoControllerClass 43 class FullscreenVideoControllerClass; 44 #endif 45 42 46 class GraphicsContext; 43 47 class IntSize; … … 76 80 77 81 void setVolume(float); 82 float volume() const; 78 83 void volumeChanged(); 79 84 void notifyPlayerOfVolumeChange(); … … 81 86 bool supportsMuting() const; 82 87 void setMuted(bool); 88 bool muted() const; 83 89 void muteChanged(); 84 90 void notifyPlayerOfMute(); … … 94 100 bool didLoadingProgress() const; 95 101 unsigned totalBytes() const; 102 float maxTimeLoaded() const; 96 103 97 104 void setVisible(bool); … … 111 118 bool hasSingleSecurityOrigin() const; 112 119 120 #if USE(NATIVE_FULLSCREEN_VIDEO) 121 void enterFullscreen(); 122 void exitFullscreen(); 123 bool canEnterFullscreen() const { return true; } 124 #endif 125 113 126 bool supportsFullscreen() const; 114 127 PlatformMedia platformMedia() const; … … 128 141 MediaPlayer::MovieLoadType movieLoadType() const; 129 142 143 MediaPlayer* mediaPlayer() const { return m_player; } 144 130 145 private: 131 146 MediaPlayerPrivateGStreamer(MediaPlayer*); … … 145 160 void cacheDuration(); 146 161 void updateStates(); 147 float maxTimeLoaded() const;148 162 149 163 void createGSTPlayBin(); … … 192 206 bool m_mediaDurationKnown; 193 207 mutable float m_maxTimeLoadedAtLastDidLoadingProgress; 194 #if ndef GST_API_VERSION_1208 #if USE(NATIVE_FULLSCREEN_VIDEO) 195 209 RefPtr<GStreamerGWorld> m_gstGWorld; 210 #ifdef FullscreenVideoControllerClass 211 OwnPtr<FullscreenVideoControllerClass> m_fullscreenVideoController; 212 #endif 196 213 #endif 197 214 guint m_volumeTimerHandler; -
trunk/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h
r109915 r141265 20 20 #ifndef PlatformVideoWindow_h 21 21 #define PlatformVideoWindow_h 22 #if ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)22 #if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 23 23 24 24 #include "Widget.h" … … 62 62 } 63 63 64 #endif // USE(GSTREAMER) && !defined(GST_API_VERSION_1)64 #endif // USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 65 65 #endif -
trunk/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp
r109915 r141265 20 20 #include "config.h" 21 21 #include "PlatformVideoWindow.h" 22 #if ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)22 #if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 23 23 24 24 #include <gtk/gtk.h> … … 49 49 PlatformVideoWindow::~PlatformVideoWindow() 50 50 { 51 if (m_videoWindow && m_window) { 52 gtk_container_remove(GTK_CONTAINER(m_window), m_videoWindow); 51 if (m_videoWindow) { 53 52 gtk_widget_destroy(m_videoWindow); 54 53 m_videoWindow = 0; … … 66 65 { 67 66 } 68 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)67 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 69 68 -
trunk/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
r125603 r141265 20 20 #ifndef PlatformVideoWindowPrivate_h 21 21 #define PlatformVideoWindowPrivate_h 22 #if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 22 23 23 24 #include <QEvent> … … 56 57 } // namespace WebCore 57 58 58 59 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 59 60 #endif // PlatformVideoWindowPrivate_h -
trunk/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp
r136707 r141265 20 20 #include "config.h" 21 21 #include "PlatformVideoWindow.h" 22 #if ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)22 #if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 23 23 24 24 #include "HTMLVideoElement.h" … … 131 131 { 132 132 } 133 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && !defined(GST_API_VERSION_1)133 #endif // ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) -
trunk/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
r131387 r141265 82 82 #endif 83 83 84 #if ndef GST_API_VERSION_184 #if USE(NATIVE_FULLSCREEN_VIDEO) 85 85 WebCore::GStreamerGWorld* gstGWorld; 86 86 #endif … … 155 155 } 156 156 157 #if ndef GST_API_VERSION_1157 #if USE(NATIVE_FULLSCREEN_VIDEO) 158 158 // Ignore buffers if the video is already in fullscreen using 159 159 // another sink. … … 419 419 420 420 421 #if ndef GST_API_VERSION_1421 #if USE(NATIVE_FULLSCREEN_VIDEO) 422 422 GstElement* webkitVideoSinkNew(WebCore::GStreamerGWorld* gstGWorld) 423 423 { -
trunk/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
r120790 r141265 23 23 #if ENABLE(VIDEO) && USE(GSTREAMER) 24 24 25 #if ndef GST_API_VERSION_125 #if USE(NATIVE_FULLSCREEN_VIDEO) 26 26 #include "GStreamerGWorld.h" 27 27 #endif … … 62 62 GType webkit_video_sink_get_type() G_GNUC_CONST; 63 63 64 #if ndef GST_API_VERSION_164 #if USE(NATIVE_FULLSCREEN_VIDEO) 65 65 GstElement* webkitVideoSinkNew(WebCore::GStreamerGWorld*); 66 66 #else -
trunk/Source/WebKit/qt/ChangeLog
r141259 r141265 1 2013-01-26 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] USE(NATIVE_FULLSCREEN_VIDEO) support 4 https://bugs.webkit.org/show_bug.cgi?id=106760 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Build fixes for GStreamer NATIVE_FULLSCREEN_VIDEO support. Some 9 more changes will be needed to use the new 10 FullscreenVideoController though. 11 12 * WebCoreSupport/ChromeClientQt.cpp: 13 (WebCore::ChromeClientQt::ChromeClientQt): 14 (WebCore::ChromeClientQt::~ChromeClientQt): 15 * WebCoreSupport/FullScreenVideoQt.cpp: 16 (WebCore): 17 (WebCore::FullScreenVideoQt::FullScreenVideoQt): 18 (WebCore::FullScreenVideoQt::~FullScreenVideoQt): 19 (WebCore::FullScreenVideoQt::enterFullScreenForNode): 20 (WebCore::FullScreenVideoQt::exitFullScreenForNode): 21 (WebCore::FullScreenVideoQt::isValid): 22 * WebCoreSupport/FullScreenVideoQt.h: 23 (WebCore): 24 (FullScreenVideoQt): 25 1 26 2013-01-30 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 27 -
trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r139078 r141265 76 76 #include <wtf/OwnPtr.h> 77 77 78 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && !defined(GST_API_VERSION_1)) || USE(QT_MULTIMEDIA) || USE(QTKIT))78 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)) || USE(QT_MULTIMEDIA) || USE(QTKIT)) 79 79 #include "FullScreenVideoQt.h" 80 80 #include "HTMLMediaElement.h" … … 127 127 : m_webPage(webPageAdapter) 128 128 , m_eventLoop(0) 129 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && !defined(GST_API_VERSION_1)) || USE(QT_MULTIMEDIA) || USE(QTKIT))129 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)) || USE(QT_MULTIMEDIA) || USE(QTKIT)) 130 130 , m_fullScreenVideo(0) 131 131 #endif … … 139 139 m_eventLoop->exit(); 140 140 141 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && !defined(GST_API_VERSION_1)) || USE(QT_MULTIMEDIA) || USE(QTKIT))141 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)) || USE(QT_MULTIMEDIA) || USE(QTKIT)) 142 142 delete m_fullScreenVideo; 143 143 #endif … … 678 678 #endif 679 679 680 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && !defined(GST_API_VERSION_1)) || USE(QT_MULTIMEDIA) || USE(QTKIT))680 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)) || USE(QT_MULTIMEDIA) || USE(QTKIT)) 681 681 FullScreenVideoQt* ChromeClientQt::fullScreenVideo() 682 682 { -
trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
r139078 r141265 161 161 #endif 162 162 163 #if ENABLE(VIDEO) && ( USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT))163 #if ENABLE(VIDEO) && ((USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)) || USE(QT_MULTIMEDIA) || USE(QTKIT)) 164 164 virtual bool supportsFullscreenForNode(const Node*); 165 165 virtual void enterFullscreenForNode(Node*); -
trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
r135515 r141265 45 45 namespace WebCore { 46 46 47 #if USE(GSTREAMER) && !defined(GST_API_VERSION_1)47 #if USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 48 48 GStreamerFullScreenVideoHandler::GStreamerFullScreenVideoHandler() 49 49 : m_videoElement(0) … … 100 100 #endif 101 101 102 #if USE(GSTREAMER) && !defined(GST_API_VERSION_1)102 #if USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 103 103 m_FullScreenVideoHandlerGStreamer = new GStreamerFullScreenVideoHandler; 104 104 #endif … … 114 114 delete m_FullScreenVideoHandler; 115 115 #endif 116 #if USE(GSTREAMER) && !defined(GST_API_VERSION_1)116 #if USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 117 117 delete m_FullScreenVideoHandlerGStreamer; 118 118 #endif … … 144 144 #endif 145 145 146 #if USE(GSTREAMER) && !defined(GST_API_VERSION_1)146 #if USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 147 147 m_FullScreenVideoHandlerGStreamer->setVideoElement(m_videoElement); 148 148 m_FullScreenVideoHandlerGStreamer->enterFullScreen(); … … 175 175 mediaPlayerQt->restoreVideoItem(); 176 176 #endif 177 #if USE(GSTREAMER) && !defined(GST_API_VERSION_1)177 #if USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 178 178 m_FullScreenVideoHandlerGStreamer->exitFullScreen(); 179 179 #endif … … 214 214 return m_FullScreenVideoHandler; 215 215 #endif 216 #if USE(GSTREAMER) && !defined(GST_API_VERSION_1)216 #if USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 217 217 return m_FullScreenVideoHandlerGStreamer; 218 218 #elif USE(QTKIT) -
trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
r135515 r141265 44 44 45 45 // We do not use ENABLE or USE because moc does not expand these macros. 46 #if defined(WTF_USE_GSTREAMER) && WTF_USE_GSTREAMER && !defined(GST_API_VERSION_1)46 #if defined(WTF_USE_GSTREAMER) && WTF_USE_GSTREAMER && defined(WTF_USE_NATIVE_FULLSCREEN_VIDEO) && WTF_USE_NATIVE_FULLSCREEN_VIDEO 47 47 class FullScreenVideoWindow; 48 48 … … 91 91 QWebFullScreenVideoHandler* m_FullScreenVideoHandler; 92 92 #endif 93 #if USE(GSTREAMER) 93 #if USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO) 94 94 GStreamerFullScreenVideoHandler* m_FullScreenVideoHandlerGStreamer; 95 95 #endif
Note: See TracChangeset
for help on using the changeset viewer.