From 9e6891076c58d977abc32c3da3ce750f4ccfb918 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 6 Sep 2023 20:28:39 +1000 Subject: [PATCH] qml6glmixer: add support for non-RGBA inputs Part-of: --- subprojects/gst-plugins-good/ext/qt6/gstqml6glmixer.cc | 4 ++-- .../gst-plugins-good/tests/examples/qt6/qmlmixer/main.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/qt6/gstqml6glmixer.cc b/subprojects/gst-plugins-good/ext/qt6/gstqml6glmixer.cc index 6c9372986f..b616cd4ad0 100644 --- a/subprojects/gst-plugins-good/ext/qt6/gstqml6glmixer.cc +++ b/subprojects/gst-plugins-good/ext/qt6/gstqml6glmixer.cc @@ -121,7 +121,7 @@ gst_qml6_gl_mixer_pad_prepare_frame (GstVideoAggregatorPad *vagg_pad, GstVideoAg GstCaps *in_caps; GstGLContext *context; - in_caps = gst_video_info_to_caps (&vagg->info); + in_caps = gst_video_info_to_caps (&vagg_pad->info); gst_caps_set_features_simple (in_caps, gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); pad->widget->setCaps (in_caps); gst_clear_caps (&in_caps); @@ -273,7 +273,7 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%u", GST_PAD_REQUEST, GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, - "RGBA")) + "{ RGBA, BGRA, YV12 }")) ); struct _GstQml6GLMixer { diff --git a/subprojects/gst-plugins-good/tests/examples/qt6/qmlmixer/main.cpp b/subprojects/gst-plugins-good/tests/examples/qt6/qmlmixer/main.cpp index 011e3460c4..5d9743932c 100644 --- a/subprojects/gst-plugins-good/tests/examples/qt6/qmlmixer/main.cpp +++ b/subprojects/gst-plugins-good/tests/examples/qt6/qmlmixer/main.cpp @@ -67,6 +67,10 @@ int main(int argc, char *argv[]) GstElement *pipeline = gst_pipeline_new (NULL); GstElement *src0 = gst_element_factory_make ("videotestsrc", NULL); + GstElement *capsfilter = gst_element_factory_make ("capsfilter", NULL); + GstCaps *caps = gst_caps_from_string ("video/x-raw,format=YV12"); + g_object_set (capsfilter, "caps", caps, NULL); + gst_clear_caps (&caps); GstElement *glupload0 = gst_element_factory_make ("glupload", NULL); GstElement *src1 = gst_element_factory_make ("videotestsrc", NULL); gst_util_set_object_arg ((GObject *) src1, "pattern", "ball"); @@ -78,8 +82,8 @@ int main(int argc, char *argv[]) g_assert (src0 && glupload0 && mixer && sink); - gst_bin_add_many (GST_BIN (pipeline), src0, glupload0, src1, glupload1, mixer, sink, NULL); - gst_element_link_many (src0, glupload0, mixer, sink, NULL); + gst_bin_add_many (GST_BIN (pipeline), src0, capsfilter, glupload0, src1, glupload1, mixer, sink, NULL); + gst_element_link_many (src0, capsfilter, glupload0, mixer, sink, NULL); gst_element_link_many (src1, glupload1, mixer, NULL); /* load qmlglsink output */