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>
This commit is contained in:
Andrew den Exter
2013-12-10 17:20:59 +10:00
committed by The Qt Project
parent 4565cf26af
commit dda1bb4716
5 changed files with 55 additions and 17 deletions

View File

@@ -106,18 +106,19 @@ void CameraBinAudioEncoder::resetActualSettings()
GstEncodingProfile *CameraBinAudioEncoder::createProfile()
{
QString codec = m_actualAudioSettings.codec();
QString preset = m_actualAudioSettings.encodingOption(QStringLiteral("preset")).toString();
GstCaps *caps;
if (codec.isEmpty())
caps = gst_caps_new_any();
return 0;
else
caps = gst_caps_from_string(codec.toLatin1());
return (GstEncodingProfile *)gst_encoding_audio_profile_new(
caps,
NULL, //preset
NULL, //restriction
0); //presence
!preset.isEmpty() ? preset.toLatin1().constData() : NULL, //preset
NULL, //restriction
0); //presence
}
QT_END_NAMESPACE