diff options
author | Andrew den Exter <andrew.den.exter@jollamobile.com> | 2013-12-10 17:20:59 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-17 13:03:49 +0100 |
commit | dda1bb47163a39e07ba559d16684b9891193cc85 (patch) | |
tree | 5965b1904f5a0172cd19f7681777b152a3b76bf1 /src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp | |
parent | 4565cf26af8131a5c060598fd22e597f8aa9ba5d (diff) |
Fix incorrect/missing application of recording settings in camerabin.
Don't set profiles if no settings are specified.
Apply all settings before starting a pipeline as the mode can switch
without being restarted and incompatible video recording settings can
prevent the pipeline starting even in image capture mode.
Set audio encoding settings and encoder profiles if they are supplied.
Change-Id: I06febf977c2cae306383f9dbaae0f81f531b4757
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp b/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp index 47a61c9a3..cb479d8df 100644 --- a/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinvideoencoder.cpp @@ -160,18 +160,25 @@ QPair<int,int> CameraBinVideoEncoder::rateAsRational(qreal frameRate) const GstEncodingProfile *CameraBinVideoEncoder::createProfile() { QString codec = m_actualVideoSettings.codec(); + QString preset = m_actualVideoSettings.encodingOption(QStringLiteral("preset")).toString(); + GstCaps *caps; if (codec.isEmpty()) - caps = gst_caps_new_any(); + caps = 0; else caps = gst_caps_from_string(codec.toLatin1()); - return (GstEncodingProfile *)gst_encoding_video_profile_new( + GstEncodingVideoProfile *profile = gst_encoding_video_profile_new( caps, - NULL, //preset + !preset.isEmpty() ? preset.toLatin1().constData() : NULL, //preset NULL, //restriction - 0); //presence + 1); //presence + + gst_encoding_video_profile_set_pass(profile, 0); + gst_encoding_video_profile_set_variableframerate(profile, TRUE); + + return (GstEncodingProfile *)profile; } QT_END_NAMESPACE |