aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2021-09-08 08:07:32 +0300
committerSamuli Piippo <samuli.piippo@qt.io>2021-09-08 08:23:41 +0300
commit6ce601a4d55a5e61f97e34cda7cce860a61e6ffb (patch)
treea7fbad7148a4d8c0b10aba205c01833ff0698405
parent251d89e2ca9f2f800e1371f35d44ba438abae6f3 (diff)
qtmultimedia: fix build with older (<1.16) gstreamerv6.2.0-beta4
Some of the video formats were introduces in GStreamer 1.16 and fail to build with older releases. Change-Id: I56c04f472840ce6b82f480e9e918d2b4245ab14e Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
-rw-r--r--recipes-qt/qt6/qtmultimedia/0001-Only-use-available-gstreamer-video-formats.patch50
-rw-r--r--recipes-qt/qt6/qtmultimedia_git.bb5
2 files changed, 54 insertions, 1 deletions
diff --git a/recipes-qt/qt6/qtmultimedia/0001-Only-use-available-gstreamer-video-formats.patch b/recipes-qt/qt6/qtmultimedia/0001-Only-use-available-gstreamer-video-formats.patch
new file mode 100644
index 0000000..0f77735
--- /dev/null
+++ b/recipes-qt/qt6/qtmultimedia/0001-Only-use-available-gstreamer-video-formats.patch
@@ -0,0 +1,50 @@
+From c1745b55d0ea99f2730b13769c1a2d69c5426077 Mon Sep 17 00:00:00 2001
+From: Samuli Piippo <samuli.piippo@qt.io>
+Date: Wed, 8 Sep 2021 07:47:42 +0300
+Subject: [PATCH] Only use available gstreamer video formats
+
+Check the gstreamer version before using video format that were added
+after GStreamer 1.14 release.
+
+ * @GST_VIDEO_FORMAT_VUYA: packed 4:4:4 YUV with alpha channel (V0-U0-Y0-A0...) (Since: 1.16)
+ * @GST_VIDEO_FORMAT_BGR10A2_LE: packed 4:4:4 RGB with alpha channel(B-G-R-A), 10 bits for R/G/B channel and MSB 2 bits for alpha channel (Since: 1.16)
+
+Pick-to: 6.2
+Change-Id: Ib2cc5265f43e4fcb059e897ef96969154f27c297
+---
+ src/multimedia/platform/gstreamer/common/qgstvideobuffer.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/multimedia/platform/gstreamer/common/qgstvideobuffer.cpp b/src/multimedia/platform/gstreamer/common/qgstvideobuffer.cpp
+index 7cd022a82..b93cb9eac 100644
+--- a/src/multimedia/platform/gstreamer/common/qgstvideobuffer.cpp
++++ b/src/multimedia/platform/gstreamer/common/qgstvideobuffer.cpp
+@@ -46,6 +46,7 @@
+ #include <gst/video/video.h>
+ #include <gst/video/video-frame.h>
+ #include <gst/video/gstvideometa.h>
++#include <gst/pbutils/gstpluginsbaseversion.h>
+
+ #include "qgstutils_p.h"
+
+@@ -208,7 +209,9 @@ fourccFromVideoInfo(const GstVideoInfo * info, int plane)
+ case GST_VIDEO_FORMAT_ABGR:
+ case GST_VIDEO_FORMAT_xBGR:
+ case GST_VIDEO_FORMAT_AYUV:
++#if GST_CHECK_PLUGINS_BASE_VERSION(1,16,0)
+ case GST_VIDEO_FORMAT_VUYA:
++#endif
+ return rgba_fourcc;
+
+ case GST_VIDEO_FORMAT_GRAY8:
+@@ -231,8 +234,10 @@ fourccFromVideoInfo(const GstVideoInfo * info, int plane)
+ case GST_VIDEO_FORMAT_Y444:
+ return DRM_FORMAT_R8;
+
++#if GST_CHECK_PLUGINS_BASE_VERSION(1,16,0)
+ case GST_VIDEO_FORMAT_BGR10A2_LE:
+ return DRM_FORMAT_BGRA1010102;
++#endif
+
+ // case GST_VIDEO_FORMAT_RGB10A2_LE:
+ // return DRM_FORMAT_RGBA1010102;
diff --git a/recipes-qt/qt6/qtmultimedia_git.bb b/recipes-qt/qt6/qtmultimedia_git.bb
index 7f7777f..00562d9 100644
--- a/recipes-qt/qt6/qtmultimedia_git.bb
+++ b/recipes-qt/qt6/qtmultimedia_git.bb
@@ -14,7 +14,10 @@ include recipes-qt/qt6/qt6.inc
DEPENDS += "qtbase qtshadertools qtshadertools-native"
-SRC_URI += "file://0001-Fix-build-issue-with-conflicting-declarations-in-GL-.patch"
+SRC_URI += "\
+ file://0001-Fix-build-issue-with-conflicting-declarations-in-GL-.patch \
+ file://0001-Only-use-available-gstreamer-video-formats.patch \
+"
PACKAGECONFIG ?= "gstreamer qml"
PACKAGECONFIG[alsa] = "-DFEATURE_alsa=ON,-DFEATURE_alsa=OFF,alsa-lib"