Title: [206202] trunk/Source/WebCore
- Revision
- 206202
- Author
- commit-qu...@webkit.org
- Date
- 2016-09-21 00:48:32 -0700 (Wed, 21 Sep 2016)
Log Message
Build fails with GSTREAMER_GL when both desktop GL and GLES2 are enabled in gst-plugins-bad
https://bugs.webkit.org/show_bug.cgi?id=159562
Patch by Miguel Gomez <mago...@igalia.com> on 2016-09-21
Reviewed by Philippe Normand.
Refactor video orientation code so including TextureMapperGL in MediaPlayerPrivateGStreamerBase.h
is not necessary.
Covered by existent tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::texMapFlagFromOrientation):
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
(WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (206201 => 206202)
--- trunk/Source/WebCore/ChangeLog 2016-09-21 07:14:41 UTC (rev 206201)
+++ trunk/Source/WebCore/ChangeLog 2016-09-21 07:48:32 UTC (rev 206202)
@@ -1,3 +1,23 @@
+2016-09-21 Miguel Gomez <mago...@igalia.com>
+
+ Build fails with GSTREAMER_GL when both desktop GL and GLES2 are enabled in gst-plugins-bad
+ https://bugs.webkit.org/show_bug.cgi?id=159562
+
+ Reviewed by Philippe Normand.
+
+ Refactor video orientation code so including TextureMapperGL in MediaPlayerPrivateGStreamerBase.h
+ is not necessary.
+
+ Covered by existent tests.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+ (WebCore::texMapFlagFromOrientation):
+ (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
+ (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
+ (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
+ (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
+
2016-09-21 Jeremy Huddleston Sequoia <jerem...@apple.com>
[GTK] Fix build failure in clipboard support
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (206201 => 206202)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2016-09-21 07:14:41 UTC (rev 206201)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2016-09-21 07:48:32 UTC (rev 206202)
@@ -103,6 +103,26 @@
return ABS(a);
}
+#if USE(TEXTURE_MAPPER_GL)
+static inline TextureMapperGL::Flags texMapFlagFromOrientation(const ImageOrientation& orientation)
+{
+ switch (orientation) {
+ case DefaultImageOrientation:
+ return 0;
+ case OriginRightTop:
+ return TextureMapperGL::ShouldRotateTexture90;
+ case OriginBottomRight:
+ return TextureMapperGL::ShouldRotateTexture180;
+ case OriginLeftBottom:
+ return TextureMapperGL::ShouldRotateTexture270;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ return 0;
+}
+#endif
+
#if USE(COORDINATED_GRAPHICS_THREADED) && USE(GSTREAMER_GL)
class GstVideoFrameHolder : public TextureMapperPlatformLayerBuffer::UnmanagedBufferDataHolder {
public:
@@ -154,9 +174,6 @@
, m_drawTimer(RunLoop::main(), this, &MediaPlayerPrivateGStreamerBase::repaint)
#endif
, m_usingFallbackVideoSink(false)
-#if USE(TEXTURE_MAPPER_GL)
- , m_textureMapperRotationFlag(0)
-#endif
{
g_mutex_init(&m_sampleMutex);
#if USE(COORDINATED_GRAPHICS_THREADED)
@@ -486,7 +503,7 @@
return;
#if USE(GSTREAMER_GL)
- std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), m_textureMapperRotationFlag);
+ std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), texMapFlagFromOrientation(m_videoSourceOrientation));
if (UNLIKELY(!frameHolder->isValid()))
return;
@@ -509,7 +526,7 @@
buffer = std::make_unique<TextureMapperPlatformLayerBuffer>(WTFMove(texture));
}
updateTexture(buffer->textureGL(), videoInfo);
- buffer->setExtraFlags(m_textureMapperRotationFlag | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0));
+ buffer->setExtraFlags(texMapFlagFromOrientation(m_videoSourceOrientation) | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0));
m_platformLayerProxy->pushNextBuffer(WTFMove(buffer));
#endif
}
@@ -646,7 +663,7 @@
return;
size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
- flags = m_textureMapperRotationFlag | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0);
+ flags = texMapFlagFromOrientation(m_videoSourceOrientation) | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0);
texture = textureMapper.acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
updateTexture(static_cast<BitmapTextureGL&>(*texture), videoInfo);
}
@@ -669,7 +686,7 @@
return;
unsigned textureID = *reinterpret_cast<unsigned*>(videoFrame.data[0]);
- TextureMapperGL::Flags flags = m_textureMapperRotationFlag | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0);
+ TextureMapperGL::Flags flags = texMapFlagFromOrientation(m_videoSourceOrientation) | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0);
IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
TextureMapperGL& textureMapperGL = reinterpret_cast<TextureMapperGL&>(textureMapper);
@@ -753,26 +770,6 @@
return;
m_videoSourceOrientation = orientation;
-
-#if USE(TEXTURE_MAPPER_GL)
- switch (m_videoSourceOrientation) {
- case DefaultImageOrientation:
- m_textureMapperRotationFlag = 0;
- break;
- case OriginRightTop:
- m_textureMapperRotationFlag = TextureMapperGL::ShouldRotateTexture90;
- break;
- case OriginBottomRight:
- m_textureMapperRotationFlag = TextureMapperGL::ShouldRotateTexture180;
- break;
- case OriginLeftBottom:
- m_textureMapperRotationFlag = TextureMapperGL::ShouldRotateTexture270;
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
-#endif
}
bool MediaPlayerPrivateGStreamerBase::supportsFullscreen() const
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h (206201 => 206202)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h 2016-09-21 07:14:41 UTC (rev 206201)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h 2016-09-21 07:48:32 UTC (rev 206202)
@@ -37,10 +37,7 @@
#if USE(TEXTURE_MAPPER)
#include "TextureMapperPlatformLayer.h"
#include "TextureMapperPlatformLayerProxy.h"
-#if USE(TEXTURE_MAPPER_GL)
-#include "TextureMapperGL.h"
#endif
-#endif
typedef struct _GstStreamVolume GstStreamVolume;
typedef struct _GstVideoInfo GstVideoInfo;
@@ -204,9 +201,6 @@
#endif
ImageOrientation m_videoSourceOrientation;
-#if USE(TEXTURE_MAPPER_GL)
- TextureMapperGL::Flags m_textureMapperRotationFlag;
-#endif
};
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes