Unreviewed, GStreamer 0.10 build fix after r151175.
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jun 2013 09:17:24 +0000 (09:17 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jun 2013 09:17:24 +0000 (09:17 +0000)
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151203 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h

index 0c9402b..1a4b2f9 100644 (file)
@@ -1,3 +1,15 @@
+2013-06-05  Philippe Normand  <pnormand@igalia.com>
+
+        Unreviewed, GStreamer 0.10 build fix after r151175.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
+        (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
+        (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
+        (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
+        (WebCore::MediaPlayerPrivateGStreamerBase::paint):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
+
 2013-06-05  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSS Regions] REGRESSION Incorrect layer clipping inside flow thread
index 5641dd9..0dde45a 100644 (file)
@@ -115,14 +115,24 @@ MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase(MediaPlayer* pl
     , m_texture(0)
 #endif
 {
-    g_mutex_init(&m_bufferMutex);
+#if GLIB_CHECK_VERSION(2, 31, 0)
+    m_bufferMutex = WTF::fastNew<GMutex>();
+    g_mutex_init(m_bufferMutex);
+#else
+    m_bufferMutex = g_mutex_new();
+#endif
 }
 
 MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase()
 {
     g_signal_handler_disconnect(m_webkitVideoSink.get(), m_repaintHandler);
 
-    g_mutex_clear(&m_bufferMutex);
+#if GLIB_CHECK_VERSION(2, 31, 0)
+    g_mutex_clear(m_bufferMutex);
+    WTF::fastDelete(m_bufferMutex);
+#else
+    g_mutex_free(m_bufferMutex);
+#endif
 
     if (m_buffer)
         gst_buffer_unref(m_buffer);
@@ -168,9 +178,9 @@ IntSize MediaPlayerPrivateGStreamerBase::naturalSize() const
      */
     GRefPtr<GstCaps> caps = webkitGstGetPadCaps(m_videoSinkPad.get());
 #else
-    g_mutex_lock(&m_bufferMutex);
+    g_mutex_lock(m_bufferMutex);
     GRefPtr<GstCaps> caps = m_buffer ? GST_BUFFER_CAPS(m_buffer) : 0;
-    g_mutex_unlock(&m_bufferMutex);
+    g_mutex_unlock(m_bufferMutex);
 #endif
     if (!caps)
         return IntSize();
@@ -358,9 +368,9 @@ void MediaPlayerPrivateGStreamerBase::triggerRepaint(GstBuffer* buffer)
     else
 #endif
     {
-        g_mutex_lock(&m_bufferMutex);
+        g_mutex_lock(m_bufferMutex);
         gst_buffer_replace(&m_buffer, buffer);
-        g_mutex_unlock(&m_bufferMutex);
+        g_mutex_unlock(m_bufferMutex);
         m_player->repaint();
     }
 }
@@ -383,9 +393,9 @@ void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const IntR
     if (!m_player->visible())
         return;
 
-    g_mutex_lock(&m_bufferMutex);
+    g_mutex_lock(m_bufferMutex);
     if (!m_buffer) {
-        g_mutex_unlock(&m_bufferMutex);
+        g_mutex_unlock(m_bufferMutex);
         return;
     }
 
@@ -399,19 +409,19 @@ void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const IntR
     GRefPtr<GstCaps> caps = GST_BUFFER_CAPS(m_buffer);
 #endif
     if (!caps) {
-        g_mutex_unlock(&m_bufferMutex);
+        g_mutex_unlock(m_bufferMutex);
         return;
     }
 
     RefPtr<ImageGStreamer> gstImage = ImageGStreamer::createImage(m_buffer, caps.get());
     if (!gstImage) {
-        g_mutex_unlock(&m_bufferMutex);
+        g_mutex_unlock(m_bufferMutex);
         return;
     }
 
     context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB,
         rect, gstImage->rect(), CompositeCopy, DoNotRespectImageOrientation, false);
-    g_mutex_unlock(&m_bufferMutex);
+    g_mutex_unlock(m_bufferMutex);
 }
 
 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
index 1d80f74..8ae47de 100644 (file)
@@ -123,7 +123,7 @@ protected:
     MediaPlayer::ReadyState m_readyState;
     MediaPlayer::NetworkState m_networkState;
     IntSize m_size;
-    GMutex m_bufferMutex;
+    GMutex* m_bufferMutex;
     GstBuffer* m_buffer;
 #if USE(NATIVE_FULLSCREEN_VIDEO)
     RefPtr<GStreamerGWorld> m_gstGWorld;