diff options
author | Henrik Thillman <heth@ambu.com> | 2023-01-06 12:46:18 +0100 |
---|---|---|
committer | Lars Knoll <lars@knoll.priv.no> | 2023-03-04 18:50:26 +0000 |
commit | e6c476d407fd282d064065941eba477a911bb3c9 (patch) | |
tree | c71813dfbd28ae9723794378dd666d64051111e0 | |
parent | f3c7bef42e7b154f34227bee418a8009352447e2 (diff) |
Add NVidia specific conversion element to already existing IMX workaround
The NVidia conversion element is necessary for the QT videoSinkBin to
be able to work together with the Nvidia formats used by the
nvv4l2decoder.
Fixes: QTBUG-110995
Change-Id: Icb88caf91eeaf5beeeed18e7ac5b3971ef5a83ca
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7d0563ae811f3a6783c068a039a840db4c8400ce)
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
-rw-r--r-- | src/plugins/multimedia/gstreamer/common/qgstreamervideosink.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/multimedia/gstreamer/common/qgstreamervideosink.cpp b/src/plugins/multimedia/gstreamer/common/qgstreamervideosink.cpp index 1df0f5df6..99907d313 100644 --- a/src/plugins/multimedia/gstreamer/common/qgstreamervideosink.cpp +++ b/src/plugins/multimedia/gstreamer/common/qgstreamervideosink.cpp @@ -40,17 +40,20 @@ QGstreamerVideoSink::QGstreamerVideoSink(QVideoSink *parent) : QPlatformVideoSink(parent) { sinkBin = QGstBin("videoSinkBin"); - // This is a hack for some iMX platforms. Thos require the use of a special video + // This is a hack for some iMX and NVidia platforms. These require the use of a special video // conversion element in the pipeline before the video sink, as they unfortunately - // output some proprietary format from the decoder even though it's marked as + // output some proprietary format from the decoder even though it's sometimes marked as // a regular supported video/x-raw format. // // To fix this, simply insert the element into the pipeline if it's available. Otherwise // we simply use an identity element. gstQueue = QGstElement("queue"); auto imxVideoConvert = QGstElement("imxvideoconvert_g2d"); + auto nvidiaVideoConvert = QGstElement("nvvidconv"); if (!imxVideoConvert.isNull()) gstPreprocess = imxVideoConvert; + else if (!nvidiaVideoConvert.isNull()) + gstPreprocess = nvidiaVideoConvert; else gstPreprocess = QGstElement("identity"); sinkBin.add(gstQueue, gstPreprocess); |