qt: Support RGB format
authorKai Uwe Broulik <kai_uwe.broulik@mbition.io>
Fri, 23 Jul 2021 09:04:00 +0000 (11:04 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 28 Jul 2021 11:42:12 +0000 (11:42 +0000)
In GstQSGTexture::hasAlphaChannel return value based on
whether the video format has alpha channel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1040>

ext/qt/gstqsgtexture.cc
ext/qt/gstqtsink.cc

index 5b7d8b7..1ba33b5 100644 (file)
@@ -228,8 +228,11 @@ GstQSGTexture::textureSize () const
 bool
 GstQSGTexture::hasAlphaChannel () const
 {
-  /* FIXME: support RGB textures */
-  return true;
+  const bool has_alpha = GST_VIDEO_FORMAT_INFO_HAS_ALPHA(this->v_info.finfo);
+
+  GST_LOG ("%p get has alpha channel %u", this, has_alpha);
+
+  return has_alpha;
 }
 
 /* can be called from any thread */
index 8f55b72..ccd0994 100644 (file)
@@ -108,7 +108,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS ("video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), "
-    "format = (string) RGBA, "
+    "format = (string) { RGB, RGBA }, "
     "width = " GST_VIDEO_SIZE_RANGE ", "
     "height = " GST_VIDEO_SIZE_RANGE ", "
     "framerate = " GST_VIDEO_FPS_RANGE ", "