Viewfinder settings control (2) - version for iOS/OS X

QCameraViewfinderSettingsControl2 - version for AV foundation plugin
(the new settings control interface implemented).

Change-Id: I3fbfb87925e57c914d43eb711fa5422e26981207
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
This commit is contained in:
Timur Pocheptsov
2015-01-28 17:51:19 +01:00
committed by Yoann Lopes
parent d27f493df0
commit 0d783b7303
9 changed files with 716 additions and 3 deletions

View File

@@ -39,6 +39,7 @@
#include "avfcameradevicecontrol.h"
#include "avfaudioinputselectorcontrol.h"
#include "avfmediavideoprobecontrol.h"
#include "avfcameraviewfindersettingscontrol.h"
#include <CoreFoundation/CoreFoundation.h>
#include <Foundation/Foundation.h>
@@ -275,6 +276,7 @@ void AVFCameraSession::setState(QCamera::State newState)
Q_EMIT readyToConfigureConnections();
[m_captureSession commitConfiguration];
[m_captureSession startRunning];
applyViewfinderSettings();
}
if (oldState == QCamera::ActiveState) {
@@ -364,6 +366,15 @@ void AVFCameraSession::attachInputDevices()
}
}
void AVFCameraSession::applyViewfinderSettings()
{
if (AVFCameraViewfinderSettingsControl2 *control = m_service->viewfinderSettingsControl2()) {
QCameraViewfinderSettings settings(control->requestedSettings());
// TODO: Adjust the resolution (from image encoder control), updating 'settings'.
control->setViewfinderSettings(settings);
}
}
void AVFCameraSession::addProbe(AVFMediaVideoProbeControl *probe)
{
m_videoProbesMutex.lock();