qt: Support RGB format

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>
This commit is contained in:
Kai Uwe Broulik 2021-07-23 11:04:00 +02:00 committed by GStreamer Marge Bot
parent 2f9fa71ab3
commit 4ed342db5d
2 changed files with 6 additions and 3 deletions

View 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 */

View 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 ", "