diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2018-08-22 10:49:39 +0200 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2018-08-22 12:43:55 +0000 |
commit | c1ca9510af3c3c4134b717f1863651783e338a9e (patch) | |
tree | 3eaa09b8f9ec919547d54464666241e1cad80f33 | |
parent | d84c7d09df16d5e60cd5067005ec97498f8b4e32 (diff) |
Gstreamer: Set video-profile to CameraBin before GST_STATE_READY
CameraBin creates default (application/ogg, video/x-theora) video profile
or sets custom defined one, but ONLY on GST_STATE_CHANGE_NULL_TO_READY.
If the camera is already loaded then it is not possible to change the video profile.
Since a video profile was never defined, video/x-theora was always used to record video.
Moved setting video profile before it gets to READY.
It fixes an issue with ignoring CameraBinRecorder::applySettings().
This also changes previous behavior when video/x-theora was always used.
To apply custom video settings it requires to use QMediaRecorder::setVideoSettings
before the camera enters the READY state.
Task-number: QTBUG-69895
Change-Id: I3afbf1f8e7c953e2e49e9cad7e96ea0b18a29d1a
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
-rw-r--r-- | src/gsttools/qgstcodecsinfo.cpp | 2 | ||||
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinsession.cpp | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/gsttools/qgstcodecsinfo.cpp b/src/gsttools/qgstcodecsinfo.cpp index a05ee92aa..ca43d489b 100644 --- a/src/gsttools/qgstcodecsinfo.cpp +++ b/src/gsttools/qgstcodecsinfo.cpp @@ -106,7 +106,7 @@ void QGstCodecsInfo::updateCodecs(ElementType elementType) QSet<QByteArray> fieldsToAdd; fieldsToAdd << "mpegversion" << "layer" << "layout" << "raversion" - << "wmaversion" << "wmvversion" << "variant"; + << "wmaversion" << "wmvversion" << "variant" << "systemstream"; GList *element = elements; while (element) { diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index 1c14444bb..fdedc5f5a 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -836,6 +836,17 @@ void CameraBinSession::load() return; } +#if QT_CONFIG(gstreamer_encodingprofiles) + GstEncodingContainerProfile *profile = m_recorderControl->videoProfile(); + if (profile) { + g_object_set (G_OBJECT(m_camerabin), + "video-profile", + profile, + NULL); + gst_encoding_profile_unref(profile); + } +#endif + gst_element_set_state(m_camerabin, GST_STATE_READY); } @@ -871,15 +882,6 @@ void CameraBinSession::start() m_recorderControl->applySettings(); -#if QT_CONFIG(gstreamer_encodingprofiles) - GstEncodingContainerProfile *profile = m_recorderControl->videoProfile(); - g_object_set (G_OBJECT(m_camerabin), - "video-profile", - profile, - NULL); - gst_encoding_profile_unref(profile); -#endif - setAudioCaptureCaps(); setupCaptureResolution(); |