Title: [235543] trunk/Source/WebCore
Revision
235543
Author
[email protected]
Date
2018-08-31 03:22:57 -0700 (Fri, 31 Aug 2018)

Log Message

[GStreamer][GL] useless ifdef in pushTextureToCompositor
https://bugs.webkit.org/show_bug.cgi?id=188552

Patch by Philippe Normand <[email protected]> on 2018-08-31
Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
There's no need for an ifdef because the frame holder already
ensures a valid texture ID will be set if it maps a GL video frame.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (235542 => 235543)


--- trunk/Source/WebCore/ChangeLog	2018-08-31 10:19:43 UTC (rev 235542)
+++ trunk/Source/WebCore/ChangeLog	2018-08-31 10:22:57 UTC (rev 235543)
@@ -1,3 +1,15 @@
+2018-08-31  Philippe Normand  <[email protected]>
+
+        [GStreamer][GL] useless ifdef in pushTextureToCompositor
+        https://bugs.webkit.org/show_bug.cgi?id=188552
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
+        There's no need for an ifdef because the frame holder already
+        ensures a valid texture ID will be set if it maps a GL video frame.
+
 2018-08-31  David Kilzer  <[email protected]>
 
         REGRESSION (r235190): Fix name of WebAudioBufferList.{cpp,h} in Xcode project

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (235542 => 235543)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2018-08-31 10:19:43 UTC (rev 235542)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2018-08-31 10:22:57 UTC (rev 235543)
@@ -783,25 +783,22 @@
 
             std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), texMapFlagFromOrientation(m_videoSourceOrientation), !m_usingFallbackVideoSink);
 
-#if USE(GSTREAMER_GL)
             GLuint textureID = frameHolder->textureID();
+            std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer;
             if (textureID) {
-                std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(textureID, frameHolder->size(), frameHolder->flags(), GraphicsContext3D::RGBA);
+                layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(textureID, frameHolder->size(), frameHolder->flags(), GraphicsContext3D::RGBA);
                 layerBuffer->setUnmanagedBufferDataHolder(WTFMove(frameHolder));
-                proxy.pushNextBuffer(WTFMove(layerBuffer));
-            } else
-#endif
-            {
-                std::unique_ptr<TextureMapperPlatformLayerBuffer> buffer = proxy.getAvailableBuffer(frameHolder->size(), GL_DONT_CARE);
-                if (UNLIKELY(!buffer)) {
+            } else {
+                layerBuffer = proxy.getAvailableBuffer(frameHolder->size(), GL_DONT_CARE);
+                if (UNLIKELY(!layerBuffer)) {
                     auto texture = BitmapTextureGL::create(TextureMapperContextAttributes::get());
                     texture->reset(frameHolder->size(), frameHolder->hasAlphaChannel() ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
-                    buffer = std::make_unique<TextureMapperPlatformLayerBuffer>(WTFMove(texture));
+                    layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(WTFMove(texture));
                 }
-                frameHolder->updateTexture(buffer->textureGL());
-                buffer->setExtraFlags(texMapFlagFromOrientation(m_videoSourceOrientation) | (frameHolder->hasAlphaChannel() ? TextureMapperGL::ShouldBlend : 0));
-                proxy.pushNextBuffer(WTFMove(buffer));
+                frameHolder->updateTexture(layerBuffer->textureGL());
+                layerBuffer->setExtraFlags(texMapFlagFromOrientation(m_videoSourceOrientation) | (frameHolder->hasAlphaChannel() ? TextureMapperGL::ShouldBlend : 0));
             }
+            proxy.pushNextBuffer(WTFMove(layerBuffer));
         };
 
 #if USE(NICOSIA)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to