diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-07-01 11:35:42 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-07-30 10:18:23 +0200 |
commit | 77e47a0a695a4efa552c6b595b92e7c508cd7446 (patch) | |
tree | cfb99f4412df3007c4ac4afae28b62fb9e609932 | |
parent | c1fefff0cd436a4225670c6636275bb967025a39 (diff) |
Add support for imx8 video conversions
The iMX8 pipeline is somewhat broken as they send the data over in a
format that can't be handled directly by the sinks (although it's
marked as a supported format). To handle this a special imxvideoconvert_g2d
conversion element is required in the pipeline before the sink.
To make this work, we simply check whether the element is available and in
that case assume that it's required and use it.
Change-Id: I68ee38b56ca21ed7d3d8d8134b4c9b443bf6037d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/multimedia/platform/gstreamer/common/qgstreamervideosink.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/multimedia/platform/gstreamer/common/qgstreamervideosink.cpp b/src/multimedia/platform/gstreamer/common/qgstreamervideosink.cpp index e505060be..443d6b40d 100644 --- a/src/multimedia/platform/gstreamer/common/qgstreamervideosink.cpp +++ b/src/multimedia/platform/gstreamer/common/qgstreamervideosink.cpp @@ -52,7 +52,18 @@ QGstreamerVideoSink::QGstreamerVideoSink(QVideoSink *parent) : QPlatformVideoSink(parent) { sinkBin = QGstBin("videoSinkBin"); - gstPreprocess = QGstElement("identity"); + // This is a hack for some iMX platforms. Thos 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 + // 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. + auto imxVideoConvert = QGstElement("imxvideoconvert_g2d"); + if (!imxVideoConvert.isNull()) + gstPreprocess = imxVideoConvert; + else + gstPreprocess = QGstElement("identity"); sinkBin.add(gstPreprocess); sinkBin.addGhostPad(gstPreprocess, "sink"); createOverlay(); |