diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-01-17 15:18:54 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2020-01-20 12:48:28 +0000 |
commit | 2d54cb4f460f2665da64e551927e6dbf153c68c1 (patch) | |
tree | 9ede0d16f7a8c7f2573950bd97647498eee736bf | |
parent | 5e0c4d2fa253922a86378b150852a0ca8bdabc0d (diff) |
GStreamer: Don't create encoding profile if container is not supported
It does not make sense to create a GstEncodingContainerProfile with a
non-supported media container.
The correct way to use it is to provide supported values for
mediaContainer together with videoCodec.
mediaContainer: "video/quicktime, variant=(string)iso"
videoCodec: "video/x-h264"
Task-number: QTBUG-81075
Change-Id: Ia25fff32a39dc9dd512c353d1ced7d7d7e4f6370
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabincontainer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabincontainer.cpp b/src/plugins/gstreamer/camerabin/camerabincontainer.cpp index 0fc51611e..1d28e1a6e 100644 --- a/src/plugins/gstreamer/camerabin/camerabincontainer.cpp +++ b/src/plugins/gstreamer/camerabin/camerabincontainer.cpp @@ -110,7 +110,7 @@ void CameraBinContainer::resetActualContainerFormat() GstEncodingContainerProfile *CameraBinContainer::createProfile() { - GstCaps *caps; + GstCaps *caps = nullptr; if (m_actualFormat.isEmpty()) { return 0; @@ -121,6 +121,7 @@ GstEncodingContainerProfile *CameraBinContainer::createProfile() //if format is not in the list of supported gstreamer mime types, //try to find the mime type with matching extension if (!supportedFormats.contains(format)) { + format.clear(); QString extension = QGstUtils::fileExtensionForMimeType(m_actualFormat); for (const QString &formatCandidate : supportedFormats) { if (QGstUtils::fileExtensionForMimeType(formatCandidate) == extension) { @@ -130,6 +131,9 @@ GstEncodingContainerProfile *CameraBinContainer::createProfile() } } + if (format.isEmpty()) + return nullptr; + caps = gst_caps_from_string(format.toLatin1()); } |