AVFoundation: improve viewfinder settings.

Retrieving the supported viewfinder settings don't actually require
a video surface, we just need a capture device. The supported settings
can now be retrieved without calling QCamera::setSurface().
More generally, all viewfinder settings that don't require a video
surface can now be gotten/set before calling setSurface().

Task-number: QTBUG-49170
Change-Id: I39b14eeb40517a9ba399748b5778be8bbc8cfcda
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
This commit is contained in:
Yoann Lopes
2015-11-12 15:40:21 +01:00
committed by Timur Pocheptsov
parent 5135ffaf2a
commit 9b5a67d810
2 changed files with 101 additions and 109 deletions

View File

@@ -78,15 +78,11 @@ private:
bool convertPixelFormatIfSupported(QVideoFrame::PixelFormat format, unsigned &avfFormat) const;
void applySettings();
QCameraViewfinderSettings requestedSettings() const;
// Aux. function to extract things like captureDevice, videoOutput, etc.
bool updateAVFoundationObjects() const;
AVCaptureConnection *videoConnection() const;
AVFCameraService *m_service;
mutable AVFCameraSession *m_session;
QCameraViewfinderSettings m_settings;
mutable AVCaptureDevice *m_captureDevice;
mutable AVCaptureVideoDataOutput *m_videoOutput;
mutable AVCaptureConnection *m_videoConnection;
};
class AVFCameraViewfinderSettingsControl : public QCameraViewfinderSettingsControl