Changeset 206202 in webkit


Ignore:
Timestamp:
Sep 21, 2016 12:48:32 AM (8 years ago)
Author:
commit-queue@webkit.org
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 <magomez@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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206200 r206202  
     12016-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
    1212016-09-21  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
    222
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r205430 r206202  
    104104}
    105105
     106#if USE(TEXTURE_MAPPER_GL)
     107static 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
    106126#if USE(COORDINATED_GRAPHICS_THREADED) && USE(GSTREAMER_GL)
    107127class GstVideoFrameHolder : public TextureMapperPlatformLayerBuffer::UnmanagedBufferDataHolder {
     
    155175#endif
    156176    , m_usingFallbackVideoSink(false)
    157 #if USE(TEXTURE_MAPPER_GL)
    158     , m_textureMapperRotationFlag(0)
    159 #endif
    160177{
    161178    g_mutex_init(&m_sampleMutex);
     
    487504
    488505#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));
    490507    if (UNLIKELY(!frameHolder->isValid()))
    491508        return;
     
    510527    }
    511528    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));
    513530    m_platformLayerProxy->pushNextBuffer(WTFMove(buffer));
    514531#endif
     
    647664
    648665            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);
    650667            texture = textureMapper.acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
    651668            updateTexture(static_cast<BitmapTextureGL&>(*texture), videoInfo);
     
    670687
    671688    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);
    673690
    674691    IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
     
    754771
    755772    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 #endif
    776773}
    777774
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h

    r204409 r206202  
    3838#include "TextureMapperPlatformLayer.h"
    3939#include "TextureMapperPlatformLayerProxy.h"
    40 #if USE(TEXTURE_MAPPER_GL)
    41 #include "TextureMapperGL.h"
    42 #endif
    4340#endif
    4441
     
    205202
    206203    ImageOrientation m_videoSourceOrientation;
    207 #if USE(TEXTURE_MAPPER_GL)
    208     TextureMapperGL::Flags m_textureMapperRotationFlag;
    209 #endif
    210204};
    211205}
Note: See TracChangeset for help on using the changeset viewer.