<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[182227] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/182227">182227</a></dd>
<dt>Author</dt> <dd>philn@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-01 03:19:03 -0700 (Wed, 01 Apr 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[GStreamer] GstGL support in the video sink
https://bugs.webkit.org/show_bug.cgi?id=138562
Use GStreamer's glimagesink for video rendering instead of our
custom video sink if a recent-enough version of GstGL is found
during the build. When glimagesink is used it passes a texture to
the media player which then wraps it inside a TextureMapper
texture later used for actual rendering.
Using this new code path will allow us to remove our custom sink
entirely in the long term.
Patch by Philippe Normand <philn@igalia.com> on 2015-03-24
Reviewed by Carlos Garcia Campos.
No new test, existing media tests cover video rendering already.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::mediaPlayerPrivateDrawCallback): client-draw signal callback.
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Better
check for sample validity.
(WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Ditto.
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Trigger a
repaint and wait its completion.
(WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
Extract texture ID and video dimensions from the sample and do actual paint.
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Use
glimagesink if GstGL is available.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBasecpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBaseh">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182226 => 182227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-01 09:36:15 UTC (rev 182226)
+++ trunk/Source/WebCore/ChangeLog        2015-04-01 10:19:03 UTC (rev 182227)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-03-24 Philippe Normand <philn@igalia.com>
+
+ [GStreamer] GstGL support in the video sink
+ https://bugs.webkit.org/show_bug.cgi?id=138562
+
+ Use GStreamer's glimagesink for video rendering instead of our
+ custom video sink if a recent-enough version of GstGL is found
+ during the build. When glimagesink is used it passes a texture to
+ the media player which then wraps it inside a TextureMapper
+ texture later used for actual rendering.
+
+ Using this new code path will allow us to remove our custom sink
+ entirely in the long term.
+
+ Reviewed by Carlos Garcia Campos.
+
+ No new test, existing media tests cover video rendering already.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+ (WebCore::mediaPlayerPrivateDrawCallback): client-draw signal callback.
+ (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
+ (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
+ (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Better
+ check for sample validity.
+ (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Ditto.
+ (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Trigger a
+ repaint and wait its completion.
+ (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
+ Extract texture ID and video dimensions from the sample and do actual paint.
+ (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Use
+ glimagesink if GstGL is available.
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
+
</ins><span class="cx"> 2015-04-01 Joonghun Park <jh718.park@samsung.com>
</span><span class="cx">
</span><span class="cx"> nullptr cleanup in StyleResolver
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (182226 => 182227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2015-04-01 09:36:15 UTC (rev 182226)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2015-04-01 10:19:03 UTC (rev 182227)
</span><span class="lines">@@ -291,8 +291,8 @@
</span><span class="cx"> m_playBin.clear();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (m_webkitVideoSink) {
- GRefPtr<GstPad> videoSinkPad = adoptGRef(gst_element_get_static_pad(m_webkitVideoSink.get(), "sink"));
</del><ins>+ if (m_videoSink) {
+ GRefPtr<GstPad> videoSinkPad = adoptGRef(gst_element_get_static_pad(m_videoSink.get(), "sink"));
</ins><span class="cx"> g_signal_handlers_disconnect_by_func(videoSinkPad.get(), reinterpret_cast<gpointer>(mediaPlayerPrivateVideoSinkCapsChangedCallback), this);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2076,7 +2076,7 @@
</span><span class="cx"> g_object_set(m_playBin.get(), "audio-filter", scale, nullptr);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- GRefPtr<GstPad> videoSinkPad = adoptGRef(gst_element_get_static_pad(m_webkitVideoSink.get(), "sink"));
</del><ins>+ GRefPtr<GstPad> videoSinkPad = adoptGRef(gst_element_get_static_pad(m_videoSink.get(), "sink"));
</ins><span class="cx"> if (videoSinkPad)
</span><span class="cx"> g_signal_connect(videoSinkPad.get(), "notify::caps", G_CALLBACK(mediaPlayerPrivateVideoSinkCapsChangedCallback), this);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (182226 => 182227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp        2015-04-01 09:36:15 UTC (rev 182226)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp        2015-04-01 10:19:03 UTC (rev 182227)
</span><span class="lines">@@ -44,6 +44,12 @@
</span><span class="cx"> #include <gst/audio/streamvolume.h>
</span><span class="cx"> #include <gst/video/gstvideometa.h>
</span><span class="cx">
</span><ins>+#if USE(GSTREAMER_GL)
+#define GST_USE_UNSTABLE_API
+#include <gst/gl/gstglmemory.h>
+#undef GST_USE_UNSTABLE_API
+#endif
+
</ins><span class="cx"> #if GST_CHECK_VERSION(1, 1, 0) && USE(TEXTURE_MAPPER_GL)
</span><span class="cx"> #include "BitmapTextureGL.h"
</span><span class="cx"> #include "BitmapTexturePool.h"
</span><span class="lines">@@ -86,32 +92,40 @@
</span><span class="cx"> playerPrivate->triggerRepaint(sample);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if USE(GSTREAMER_GL)
+static gboolean mediaPlayerPrivateDrawCallback(GstElement*, GstContext*, GstSample* sample, MediaPlayerPrivateGStreamerBase* playerPrivate)
+{
+ playerPrivate->triggerRepaint(sample);
+ return TRUE;
+}
+#endif
+
</ins><span class="cx"> MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase(MediaPlayer* player)
</span><span class="cx"> : m_player(player)
</span><span class="cx"> , m_fpsSink(0)
</span><span class="cx"> , m_readyState(MediaPlayer::HaveNothing)
</span><span class="cx"> , m_networkState(MediaPlayer::Empty)
</span><del>- , m_sample(0)
</del><span class="cx"> , m_repaintHandler(0)
</span><span class="cx"> , m_volumeSignalHandler(0)
</span><span class="cx"> , m_muteSignalHandler(0)
</span><ins>+ , m_usingFallbackVideoSink(false)
</ins><span class="cx"> {
</span><span class="cx"> g_mutex_init(&m_sampleMutex);
</span><ins>+#if USE(GSTREAMER_GL)
+ g_cond_init(&m_drawCondition);
+ g_mutex_init(&m_drawMutex);
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase()
</span><span class="cx"> {
</span><span class="cx"> if (m_repaintHandler) {
</span><del>- g_signal_handler_disconnect(m_webkitVideoSink.get(), m_repaintHandler);
</del><ins>+ g_signal_handler_disconnect(m_videoSink.get(), m_repaintHandler);
</ins><span class="cx"> m_repaintHandler = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> g_mutex_clear(&m_sampleMutex);
</span><span class="cx">
</span><del>- if (m_sample)
- gst_sample_unref(m_sample);
- m_sample = 0;
-
</del><span class="cx"> m_player = 0;
</span><span class="cx">
</span><span class="cx"> if (m_volumeSignalHandler) {
</span><span class="lines">@@ -124,6 +138,11 @@
</span><span class="cx"> m_muteSignalHandler = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if USE(GSTREAMER_GL)
+ g_cond_clear(&m_drawCondition);
+ g_mutex_clear(&m_drawMutex);
+#endif
+
</ins><span class="cx"> #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
</span><span class="cx"> if (client())
</span><span class="cx"> client()->platformLayerWillBeDestroyed();
</span><span class="lines">@@ -140,10 +159,10 @@
</span><span class="cx"> return m_videoSize;
</span><span class="cx">
</span><span class="cx"> WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
</span><del>- if (!m_sample)
</del><ins>+ if (!GST_IS_SAMPLE(m_sample.get()))
</ins><span class="cx"> return FloatSize();
</span><span class="cx">
</span><del>- GstCaps* caps = gst_sample_get_caps(m_sample);
</del><ins>+ GstCaps* caps = gst_sample_get_caps(m_sample.get());
</ins><span class="cx"> if (!caps)
</span><span class="cx"> return FloatSize();
</span><span class="cx">
</span><span class="lines">@@ -282,10 +301,10 @@
</span><span class="cx"> PassRefPtr<BitmapTexture> MediaPlayerPrivateGStreamerBase::updateTexture(TextureMapper* textureMapper)
</span><span class="cx"> {
</span><span class="cx"> WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
</span><del>- if (!m_sample)
</del><ins>+ if (!GST_IS_SAMPLE(m_sample.get()))
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- GstCaps* caps = gst_sample_get_caps(m_sample);
</del><ins>+ GstCaps* caps = gst_sample_get_caps(m_sample.get());
</ins><span class="cx"> if (!caps)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="lines">@@ -296,7 +315,7 @@
</span><span class="cx">
</span><span class="cx"> IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
</span><span class="cx"> RefPtr<BitmapTexture> texture = textureMapper->acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
</span><del>- GstBuffer* buffer = gst_sample_get_buffer(m_sample);
</del><ins>+ GstBuffer* buffer = gst_sample_get_buffer(m_sample.get());
</ins><span class="cx">
</span><span class="cx"> #if GST_CHECK_VERSION(1, 1, 0)
</span><span class="cx"> GstVideoGLTextureUploadMeta* meta;
</span><span class="lines">@@ -329,16 +348,31 @@
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateGStreamerBase::triggerRepaint(GstSample* sample)
</span><span class="cx"> {
</span><del>- g_return_if_fail(GST_IS_SAMPLE(sample));
-
</del><span class="cx"> {
</span><span class="cx"> WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
</span><del>- if (m_sample)
- gst_sample_unref(m_sample);
- m_sample = gst_sample_ref(sample);
</del><ins>+ m_sample = sample;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+#if USE(GSTREAMER_GL)
+ {
+ ASSERT(!isMainThread());
+
+ WTF::GMutexLocker<GMutex> lock(m_drawMutex);
+
+ m_drawTimerHandler.schedule("[WebKit] video render", [this] {
+ // Rendering should be done from the main thread
+ // because this is where the GL APIs were initialized.
+ WTF::GMutexLocker<GMutex> lock(m_drawMutex);
</ins><span class="cx"> #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
</span><ins>+ if (supportsAcceleratedRendering() && m_player->client().mediaPlayerRenderingCanBeAccelerated(m_player) && client())
+ client()->setPlatformLayerNeedsDisplay();
+ g_cond_signal(&m_drawCondition);
+#endif
+ });
+ g_cond_wait(&m_drawCondition, &m_drawMutex);
+ }
+
+#elif USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
</ins><span class="cx"> if (supportsAcceleratedRendering() && m_player->client().mediaPlayerRenderingCanBeAccelerated(m_player) && client()) {
</span><span class="cx"> client()->setPlatformLayerNeedsDisplay();
</span><span class="cx"> return;
</span><span class="lines">@@ -367,10 +401,10 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> WTF::GMutexLocker<GMutex> lock(m_sampleMutex);
</span><del>- if (!m_sample)
</del><ins>+ if (!GST_IS_SAMPLE(m_sample.get()))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- RefPtr<ImageGStreamer> gstImage = ImageGStreamer::createImage(m_sample);
</del><ins>+ RefPtr<ImageGStreamer> gstImage = ImageGStreamer::createImage(m_sample.get());
</ins><span class="cx"> if (!gstImage)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -387,9 +421,40 @@
</span><span class="cx"> if (!m_player->visible())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- RefPtr<BitmapTexture> texture = updateTexture(textureMapper);
- if (texture)
- textureMapper->drawTexture(*texture.get(), targetRect, matrix, opacity);
</del><ins>+ if (m_usingFallbackVideoSink) {
+ if (RefPtr<BitmapTexture> texture = updateTexture(textureMapper))
+ textureMapper->drawTexture(*texture.get(), targetRect, matrix, opacity);
+ return;
+ }
+
+#if USE(GSTREAMER_GL)
+ if (!GST_IS_SAMPLE(m_sample.get()))
+ return;
+
+ GstCaps* caps = gst_sample_get_caps(m_sample.get());
+ if (!caps)
+ return;
+
+ GstVideoInfo videoInfo;
+ gst_video_info_init(&videoInfo);
+ if (!gst_video_info_from_caps(&videoInfo, caps))
+ return;
+
+ GstBuffer* buffer = gst_sample_get_buffer(m_sample.get());
+ GstVideoFrame videoFrame;
+ if (!gst_video_frame_map(&videoFrame, &videoInfo, buffer, static_cast<GstMapFlags>(GST_MAP_READ | GST_MAP_GL)))
+ return;
+
+ unsigned textureID = *reinterpret_cast<unsigned*>(videoFrame.data[0]);
+ BitmapTexture::Flags flags = BitmapTexture::NoFlag;
+ if (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo))
+ flags |= BitmapTexture::SupportsAlpha;
+
+ IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
+ TextureMapperGL* textureMapperGL = reinterpret_cast<TextureMapperGL*>(textureMapper);
+ textureMapperGL->drawTexture(textureID, flags, size, targetRect, matrix, opacity);
+ gst_video_frame_unmap(&videoFrame);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -416,12 +481,22 @@
</span><span class="cx">
</span><span class="cx"> GstElement* MediaPlayerPrivateGStreamerBase::createVideoSink()
</span><span class="cx"> {
</span><del>- ASSERT(initializeGStreamer());
-
</del><span class="cx"> GstElement* videoSink = nullptr;
</span><del>- m_webkitVideoSink = webkitVideoSinkNew();
</del><ins>+#if USE(GSTREAMER_GL)
+ if (webkitGstCheckVersion(1, 5, 0)) {
+ m_videoSink = gst_element_factory_make("glimagesink", nullptr);
+ if (m_videoSink) {
+ m_repaintHandler = g_signal_connect(m_videoSink.get(), "client-draw", G_CALLBACK(mediaPlayerPrivateDrawCallback), this);
+ videoSink = m_videoSink.get();
+ }
+ }
+#endif
</ins><span class="cx">
</span><del>- m_repaintHandler = g_signal_connect(m_webkitVideoSink.get(), "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this);
</del><ins>+ if (!m_videoSink) {
+ m_usingFallbackVideoSink = true;
+ m_videoSink = webkitVideoSinkNew();
+ m_repaintHandler = g_signal_connect(m_videoSink.get(), "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this);
+ }
</ins><span class="cx">
</span><span class="cx"> m_fpsSink = gst_element_factory_make("fpsdisplaysink", "sink");
</span><span class="cx"> if (m_fpsSink) {
</span><span class="lines">@@ -436,14 +511,14 @@
</span><span class="cx"> #endif // LOG_DISABLED
</span><span class="cx">
</span><span class="cx"> if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_fpsSink.get()), "video-sink")) {
</span><del>- g_object_set(m_fpsSink.get(), "video-sink", m_webkitVideoSink.get(), nullptr);
</del><ins>+ g_object_set(m_fpsSink.get(), "video-sink", m_videoSink.get(), nullptr);
</ins><span class="cx"> videoSink = m_fpsSink.get();
</span><span class="cx"> } else
</span><span class="cx"> m_fpsSink = nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_fpsSink)
</span><del>- videoSink = m_webkitVideoSink.get();
</del><ins>+ videoSink = m_videoSink.get();
</ins><span class="cx">
</span><span class="cx"> ASSERT(videoSink);
</span><span class="cx">
</span><span class="lines">@@ -503,7 +578,7 @@
</span><span class="cx"> GstQuery* query = gst_query_new_position(GST_FORMAT_BYTES);
</span><span class="cx"> gint64 position = 0;
</span><span class="cx">
</span><del>- if (gst_element_query(m_webkitVideoSink.get(), query))
</del><ins>+ if (gst_element_query(m_videoSink.get(), query))
</ins><span class="cx"> gst_query_parse_position(query, 0, &position);
</span><span class="cx">
</span><span class="cx"> gst_query_unref(query);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h (182226 => 182227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h        2015-04-01 09:36:15 UTC (rev 182226)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h        2015-04-01 10:19:03 UTC (rev 182227)
</span><span class="lines">@@ -36,11 +36,8 @@
</span><span class="cx"> #include "TextureMapperPlatformLayer.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-typedef struct _GstSample GstSample;
-typedef struct _GstElement GstElement;
</del><span class="cx"> typedef struct _GstMessage GstMessage;
</span><span class="cx"> typedef struct _GstStreamVolume GstStreamVolume;
</span><del>-typedef struct _WebKitVideoSink WebKitVideoSink;
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -117,19 +114,25 @@
</span><span class="cx">
</span><span class="cx"> MediaPlayer* m_player;
</span><span class="cx"> GRefPtr<GstStreamVolume> m_volumeElement;
</span><del>- GRefPtr<GstElement> m_webkitVideoSink;
</del><ins>+ GRefPtr<GstElement> m_videoSink;
</ins><span class="cx"> GRefPtr<GstElement> m_fpsSink;
</span><span class="cx"> MediaPlayer::ReadyState m_readyState;
</span><span class="cx"> MediaPlayer::NetworkState m_networkState;
</span><span class="cx"> IntSize m_size;
</span><span class="cx"> mutable GMutex m_sampleMutex;
</span><del>- GstSample* m_sample;
</del><ins>+ GRefPtr<GstSample> m_sample;
</ins><span class="cx"> GThreadSafeMainLoopSource m_volumeTimerHandler;
</span><span class="cx"> GThreadSafeMainLoopSource m_muteTimerHandler;
</span><ins>+#if USE(GSTREAMER_GL)
+ GThreadSafeMainLoopSource m_drawTimerHandler;
+ GCond m_drawCondition;
+ GMutex m_drawMutex;
+#endif
</ins><span class="cx"> unsigned long m_repaintHandler;
</span><span class="cx"> unsigned long m_volumeSignalHandler;
</span><span class="cx"> unsigned long m_muteSignalHandler;
</span><span class="cx"> mutable FloatSize m_videoSize;
</span><ins>+ bool m_usingFallbackVideoSink;
</ins><span class="cx"> #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
</span><span class="cx"> PassRefPtr<BitmapTexture> updateTexture(TextureMapper*);
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>