summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/coreaudio/coreaudiodeviceinfo.mm11
-rw-r--r--src/plugins/coreaudio/coreaudioinput.mm4
-rw-r--r--src/plugins/coreaudio/coreaudiosessionmanager.mm3
3 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/coreaudio/coreaudiodeviceinfo.mm b/src/plugins/coreaudio/coreaudiodeviceinfo.mm
index bb1f046a6..74a692c10 100644
--- a/src/plugins/coreaudio/coreaudiodeviceinfo.mm
+++ b/src/plugins/coreaudio/coreaudiodeviceinfo.mm
@@ -61,6 +61,11 @@ CoreAudioDeviceInfo::CoreAudioDeviceInfo(const QByteArray &device, QAudio::Mode
m_deviceId = AudioDeviceID(deviceID);
#else //iOS
m_device = device;
+ if (mode == QAudio::AudioInput) {
+ if (CoreAudioSessionManager::instance().category() != CoreAudioSessionManager::PlayAndRecord) {
+ CoreAudioSessionManager::instance().setCategory(CoreAudioSessionManager::PlayAndRecord);
+ }
+ }
#endif
}
@@ -379,6 +384,12 @@ QList<QByteArray> CoreAudioDeviceInfo::availableDevices(QAudio::Mode mode)
}
}
#else //iOS
+ if (mode == QAudio::AudioInput) {
+ if (CoreAudioSessionManager::instance().category() != CoreAudioSessionManager::PlayAndRecord) {
+ CoreAudioSessionManager::instance().setCategory(CoreAudioSessionManager::PlayAndRecord);
+ }
+ }
+
CoreAudioSessionManager::instance().setActive(true);
if (mode == QAudio::AudioOutput)
diff --git a/src/plugins/coreaudio/coreaudioinput.mm b/src/plugins/coreaudio/coreaudioinput.mm
index c41e1a51e..a0b9e9d25 100644
--- a/src/plugins/coreaudio/coreaudioinput.mm
+++ b/src/plugins/coreaudio/coreaudioinput.mm
@@ -47,6 +47,10 @@
# include <CoreServices/CoreServices.h>
#endif
+#if defined(Q_OS_IOS)
+# include "coreaudiosessionmanager.h"
+#endif
+
#include <QtMultimedia/private/qaudiohelpers_p.h>
#include <QtCore/QDebug>
diff --git a/src/plugins/coreaudio/coreaudiosessionmanager.mm b/src/plugins/coreaudio/coreaudiosessionmanager.mm
index 4b3bdb7dc..0e795e786 100644
--- a/src/plugins/coreaudio/coreaudiosessionmanager.mm
+++ b/src/plugins/coreaudio/coreaudiosessionmanager.mm
@@ -216,7 +216,8 @@ CoreAudioSessionManager::CoreAudioSessionManager() :
{
m_sessionObserver = [[CoreAudioSessionObserver alloc] initWithAudioSessionManager:this];
setActive(true);
- setCategory(CoreAudioSessionManager::PlayAndRecord, CoreAudioSessionManager::MixWithOthers);
+ //set default category to just Playback and only switch if we need more permissions
+ setCategory(CoreAudioSessionManager::Playback, CoreAudioSessionManager::MixWithOthers);
}
CoreAudioSessionManager::~CoreAudioSessionManager()