Split QMediaRecorder::setEncodingSettings to separate setters.
It's easier to change only the necessary part of encoding settings. The settings are applied during the next event loop or before recording starts. Change-Id: Ia2b5c93826a302212aa7f79a0c75e4cbaaf1dd7a Reviewed-by: Ling Hu <ling.hu@nokia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
9d3102efe2
commit
a22a0195f1
@@ -94,7 +94,7 @@ void QDeclarativeCameraRecorder::setCaptureResolution(const QSize &resolution)
|
||||
{
|
||||
if (resolution != captureResolution()) {
|
||||
m_videoSettings.setResolution(resolution);
|
||||
applySettings();
|
||||
m_recorder->setVideoSettings(m_videoSettings);
|
||||
emit captureResolutionChanged(resolution);
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ void QDeclarativeCameraRecorder::setAudioCodec(const QString &codec)
|
||||
{
|
||||
if (codec != audioCodec()) {
|
||||
m_audioSettings.setCodec(codec);
|
||||
applySettings();
|
||||
m_recorder->setAudioSettings(m_audioSettings);
|
||||
emit audioCodecChanged(codec);
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void QDeclarativeCameraRecorder::setVideoCodec(const QString &codec)
|
||||
{
|
||||
if (codec != videoCodec()) {
|
||||
m_videoSettings.setCodec(codec);
|
||||
applySettings();
|
||||
m_recorder->setVideoSettings(m_videoSettings);
|
||||
emit videoCodecChanged(codec);
|
||||
}
|
||||
}
|
||||
@@ -121,18 +121,11 @@ void QDeclarativeCameraRecorder::setMediaContainer(const QString &container)
|
||||
{
|
||||
if (container != m_mediaContainer) {
|
||||
m_mediaContainer = container;
|
||||
applySettings();
|
||||
m_recorder->setContainerFormat(container);
|
||||
emit mediaContainerChanged(container);
|
||||
}
|
||||
}
|
||||
|
||||
void QDeclarativeCameraRecorder::applySettings()
|
||||
{
|
||||
m_recorder->setEncodingSettings(m_audioSettings,
|
||||
m_videoSettings,
|
||||
m_mediaContainer);
|
||||
}
|
||||
|
||||
QMediaRecorder::Error QDeclarativeCameraRecorder::error() const
|
||||
{
|
||||
return m_recorder->error();
|
||||
|
||||
Reference in New Issue
Block a user