CoreAudio: Create an audio plugin supporting iOS and OS X
This removes the Mac audio backend that was hardcoded into QtMultimedia and adds a new audio plugin using the CoreAudio API. Change-Id: Ib15291825f9452a3763e0eeb281d952deb0bad3d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Christian Stromme <christian.stromme@digia.com> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
044e48d5a4
commit
b357c55f2d
@@ -52,10 +52,6 @@
|
||||
#include "qaudiodeviceinfo_win32_p.h"
|
||||
#include "qaudiooutput_win32_p.h"
|
||||
#include "qaudioinput_win32_p.h"
|
||||
#elif defined(Q_OS_MAC) && !defined(Q_OS_IOS)
|
||||
#include "qaudiodeviceinfo_mac_p.h"
|
||||
#include "qaudiooutput_mac_p.h"
|
||||
#include "qaudioinput_mac_p.h"
|
||||
#elif defined(HAS_ALSA)
|
||||
#include "qaudiodeviceinfo_alsa_p.h"
|
||||
#include "qaudiooutput_alsa_p.h"
|
||||
@@ -137,7 +133,7 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode)
|
||||
{
|
||||
QList<QAudioDeviceInfo> devices;
|
||||
#ifndef QT_NO_AUDIO_BACKEND
|
||||
#if (defined(Q_OS_WIN) || (defined(Q_OS_MAC) && !defined(Q_OS_IOS)) || defined(HAS_ALSA))
|
||||
#if (defined(Q_OS_WIN) || defined(HAS_ALSA))
|
||||
foreach (const QByteArray &handle, QAudioDeviceInfoInternal::availableDevices(mode))
|
||||
devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode);
|
||||
#endif
|
||||
@@ -170,7 +166,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_AUDIO_BACKEND
|
||||
#if (defined(Q_OS_WIN) || (defined(Q_OS_MAC) && !defined(Q_OS_IOS)) || defined(HAS_ALSA))
|
||||
#if (defined(Q_OS_WIN) || defined(HAS_ALSA))
|
||||
return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput);
|
||||
#endif
|
||||
#endif
|
||||
@@ -190,7 +186,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_AUDIO_BACKEND
|
||||
#if (defined(Q_OS_WIN) || (defined(Q_OS_MAC) && !defined(Q_OS_IOS)) || defined(HAS_ALSA))
|
||||
#if (defined(Q_OS_WIN) || defined(HAS_ALSA))
|
||||
return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput);
|
||||
#endif
|
||||
#endif
|
||||
@@ -202,7 +198,7 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re
|
||||
QAbstractAudioDeviceInfo *rc = 0;
|
||||
|
||||
#ifndef QT_NO_AUDIO_BACKEND
|
||||
#if (defined(Q_OS_WIN) || (defined(Q_OS_MAC) && !defined(Q_OS_IOS)) || defined(HAS_ALSA))
|
||||
#if (defined(Q_OS_WIN) || defined(HAS_ALSA))
|
||||
if (realm == QLatin1String("builtin"))
|
||||
return new QAudioDeviceInfoInternal(handle, mode);
|
||||
#endif
|
||||
@@ -234,7 +230,7 @@ QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo con
|
||||
if (deviceInfo.isNull())
|
||||
return new QNullInputDevice();
|
||||
#ifndef QT_NO_AUDIO_BACKEND
|
||||
#if (defined(Q_OS_WIN) || (defined(Q_OS_MAC) && !defined(Q_OS_IOS)) || defined(HAS_ALSA))
|
||||
#if (defined(Q_OS_WIN) || defined(HAS_ALSA))
|
||||
if (deviceInfo.realm() == QLatin1String("builtin")) {
|
||||
QAbstractAudioInput* p = new QAudioInputPrivate(deviceInfo.handle());
|
||||
if (p) p->setFormat(format);
|
||||
@@ -261,7 +257,7 @@ QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo c
|
||||
if (deviceInfo.isNull())
|
||||
return new QNullOutputDevice();
|
||||
#ifndef QT_NO_AUDIO_BACKEND
|
||||
#if (defined(Q_OS_WIN) || (defined(Q_OS_MAC) && !defined(Q_OS_IOS)) || defined(HAS_ALSA))
|
||||
#if (defined(Q_OS_WIN) || defined(HAS_ALSA))
|
||||
if (deviceInfo.realm() == QLatin1String("builtin")) {
|
||||
QAbstractAudioOutput* p = new QAudioOutputPrivate(deviceInfo.handle());
|
||||
if (p) p->setFormat(format);
|
||||
|
||||
Reference in New Issue
Block a user