summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/camera/avfcamerasession.mm
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-05-05 11:48:21 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-05-05 11:48:21 +0200
commit9d2943bce8a3706a05bea57ff8ce6586b52eb8b0 (patch)
tree933bb2a4996afd9c7bdfb824af03b9bce16843eb /src/plugins/avfoundation/camera/avfcamerasession.mm
parentfe13f5bb05ef278eb5109a9518118dda7ddb0b9d (diff)
parentcc0569a038f6116df559508518b6dacb15be8520 (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts: .qmake.conf src/plugins/avfoundation/camera/avfcamerasession.h src/plugins/avfoundation/camera/avfcamerasession.mm Change-Id: Ib2e25d907a7069591920d2f69e007f314cc0fd85
Diffstat (limited to 'src/plugins/avfoundation/camera/avfcamerasession.mm')
-rw-r--r--src/plugins/avfoundation/camera/avfcamerasession.mm38
1 files changed, 4 insertions, 34 deletions
diff --git a/src/plugins/avfoundation/camera/avfcamerasession.mm b/src/plugins/avfoundation/camera/avfcamerasession.mm
index 48fe428d8..6e4803f30 100644
--- a/src/plugins/avfoundation/camera/avfcamerasession.mm
+++ b/src/plugins/avfoundation/camera/avfcamerasession.mm
@@ -143,7 +143,6 @@ AVFCameraSession::AVFCameraSession(AVFCameraService *service, QObject *parent)
, m_state(QCamera::UnloadedState)
, m_active(false)
, m_videoInput(nil)
- , m_audioInput(nil)
, m_defaultCodec(0)
{
m_captureSession = [[AVCaptureSession alloc] init];
@@ -160,11 +159,6 @@ AVFCameraSession::~AVFCameraSession()
[m_videoInput release];
}
- if (m_audioInput) {
- [m_captureSession removeInput:m_audioInput];
- [m_audioInput release];
- }
-
[m_observer release];
[m_captureSession release];
}
@@ -283,10 +277,9 @@ void AVFCameraSession::setState(QCamera::State newState)
QCamera::State oldState = m_state;
m_state = newState;
- //attach audio and video inputs during Unloaded->Loaded transition
- if (oldState == QCamera::UnloadedState) {
- attachInputDevices();
- }
+ //attach video input during Unloaded->Loaded transition
+ if (oldState == QCamera::UnloadedState)
+ attachVideoInputDevice();
if (m_state == QCamera::ActiveState) {
Q_EMIT readyToConfigureConnections();
@@ -332,7 +325,7 @@ void AVFCameraSession::processSessionStopped()
}
}
-void AVFCameraSession::attachInputDevices()
+void AVFCameraSession::attachVideoInputDevice()
{
//Attach video input device:
if (m_service->videoDeviceControl()->isDirty()) {
@@ -360,29 +353,6 @@ void AVFCameraSession::attachInputDevices()
}
}
}
-
- //Attach audio input device:
- if (m_service->audioInputSelectorControl()->isDirty()) {
- if (m_audioInput) {
- [m_captureSession removeInput:m_audioInput];
- [m_audioInput release];
- m_audioInput = 0;
- }
-
- AVCaptureDevice *audioDevice = m_service->audioInputSelectorControl()->createCaptureDevice();
-
- NSError *error = nil;
- m_audioInput = [AVCaptureDeviceInput
- deviceInputWithDevice:audioDevice
- error:&error];
-
- if (!m_audioInput) {
- qWarning() << "Failed to create audio device input";
- } else {
- [m_audioInput retain];
- [m_captureSession addInput:m_audioInput];
- }
- }
}
void AVFCameraSession::applyImageEncoderSettings()