Changeset 206202 in webkit
- Timestamp:
- Sep 21, 2016 12:48:32 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206200 r206202 1 2016-09-21 Miguel Gomez <magomez@igalia.com> 2 3 Build fails with GSTREAMER_GL when both desktop GL and GLES2 are enabled in gst-plugins-bad 4 https://bugs.webkit.org/show_bug.cgi?id=159562 5 6 Reviewed by Philippe Normand. 7 8 Refactor video orientation code so including TextureMapperGL in MediaPlayerPrivateGStreamerBase.h 9 is not necessary. 10 11 Covered by existent tests. 12 13 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: 14 (WebCore::texMapFlagFromOrientation): 15 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): 16 (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): 17 (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper): 18 (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation): 19 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 20 1 21 2016-09-21 Jeremy Huddleston Sequoia <jeremyhu@apple.com> 2 22 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
r205430 r206202 104 104 } 105 105 106 #if USE(TEXTURE_MAPPER_GL) 107 static inline TextureMapperGL::Flags texMapFlagFromOrientation(const ImageOrientation& orientation) 108 { 109 switch (orientation) { 110 case DefaultImageOrientation: 111 return 0; 112 case OriginRightTop: 113 return TextureMapperGL::ShouldRotateTexture90; 114 case OriginBottomRight: 115 return TextureMapperGL::ShouldRotateTexture180; 116 case OriginLeftBottom: 117 return TextureMapperGL::ShouldRotateTexture270; 118 default: 119 ASSERT_NOT_REACHED(); 120 } 121 122 return 0; 123 } 124 #endif 125 106 126 #if USE(COORDINATED_GRAPHICS_THREADED) && USE(GSTREAMER_GL) 107 127 class GstVideoFrameHolder : public TextureMapperPlatformLayerBuffer::UnmanagedBufferDataHolder { … … 155 175 #endif 156 176 , m_usingFallbackVideoSink(false) 157 #if USE(TEXTURE_MAPPER_GL)158 , m_textureMapperRotationFlag(0)159 #endif160 177 { 161 178 g_mutex_init(&m_sampleMutex); … … 487 504 488 505 #if USE(GSTREAMER_GL) 489 std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), m_textureMapperRotationFlag);506 std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), texMapFlagFromOrientation(m_videoSourceOrientation)); 490 507 if (UNLIKELY(!frameHolder->isValid())) 491 508 return; … … 510 527 } 511 528 updateTexture(buffer->textureGL(), videoInfo); 512 buffer->setExtraFlags( m_textureMapperRotationFlag| (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0));529 buffer->setExtraFlags(texMapFlagFromOrientation(m_videoSourceOrientation) | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0)); 513 530 m_platformLayerProxy->pushNextBuffer(WTFMove(buffer)); 514 531 #endif … … 647 664 648 665 size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)); 649 flags = m_textureMapperRotationFlag| (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0);666 flags = texMapFlagFromOrientation(m_videoSourceOrientation) | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0); 650 667 texture = textureMapper.acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag); 651 668 updateTexture(static_cast<BitmapTextureGL&>(*texture), videoInfo); … … 670 687 671 688 unsigned textureID = *reinterpret_cast<unsigned*>(videoFrame.data[0]); 672 TextureMapperGL::Flags flags = m_textureMapperRotationFlag| (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0);689 TextureMapperGL::Flags flags = texMapFlagFromOrientation(m_videoSourceOrientation) | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0); 673 690 674 691 IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)); … … 754 771 755 772 m_videoSourceOrientation = orientation; 756 757 #if USE(TEXTURE_MAPPER_GL)758 switch (m_videoSourceOrientation) {759 case DefaultImageOrientation:760 m_textureMapperRotationFlag = 0;761 break;762 case OriginRightTop:763 m_textureMapperRotationFlag = TextureMapperGL::ShouldRotateTexture90;764 break;765 case OriginBottomRight:766 m_textureMapperRotationFlag = TextureMapperGL::ShouldRotateTexture180;767 break;768 case OriginLeftBottom:769 m_textureMapperRotationFlag = TextureMapperGL::ShouldRotateTexture270;770 break;771 default:772 ASSERT_NOT_REACHED();773 break;774 }775 #endif776 773 } 777 774 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
r204409 r206202 38 38 #include "TextureMapperPlatformLayer.h" 39 39 #include "TextureMapperPlatformLayerProxy.h" 40 #if USE(TEXTURE_MAPPER_GL)41 #include "TextureMapperGL.h"42 #endif43 40 #endif 44 41 … … 205 202 206 203 ImageOrientation m_videoSourceOrientation; 207 #if USE(TEXTURE_MAPPER_GL)208 TextureMapperGL::Flags m_textureMapperRotationFlag;209 #endif210 204 }; 211 205 }
Note: See TracChangeset
for help on using the changeset viewer.