diff options
author | Matthew Gregan <[email protected]> | 2012-12-03 12:53:46 +1300 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2012-12-03 12:53:46 +1300 |
commit | aebe03df937eccda1d0a07300973678b9ea30a07 (patch) | |
tree | 4b7d792b30a1bed24b2e3d2a6ecde1d3ae333fad | |
parent | d2c45250a59c20a16427be0f1eb592b5176f43df (diff) | |
download | cubeb-aebe03df937eccda1d0a07300973678b9ea30a07.tar.gz cubeb-aebe03df937eccda1d0a07300973678b9ea30a07.zip |
audiounit: stop using deprecated component API. clean up OS X build steps.
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | src/cubeb_audiounit.c | 11 |
3 files changed, 9 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am index 86da66f..f3c5f54 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS = foreign 1.11 no-dist-gzip dist-xz subdir-objects +AUTOMAKE_OPTIONS = foreign 1.10 dist-bzip2 subdir-objects ACLOCAL_AMFLAGS = -I m4 INCLUDES = -I$(top_srcdir)/include -I. diff --git a/configure.ac b/configure.ac index 530bb6b..9b87570 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ AM_PROG_LIBTOOL dnl Choose the target platform audio API AC_CHECK_HEADERS([alsa/asoundlib.h pulse/pulseaudio.h \ - AudioToolbox/AudioToolbox.h \ + AudioUnit/AudioUnit.h \ windows.h dsound.h sndio.h SLES/OpenSLES.h]) platform_api="none" platform_lib="none" @@ -57,9 +57,9 @@ if test "x$ac_cv_header_pulse_pulseaudio_h" = "xyes"; then elif test "x$ac_cv_header_alsa_asoundlib_h" = "xyes"; then platform_api="alsa" platform_lib="-lasound" -elif test "x$ac_cv_header_AudioToolbox_AudioToolbox_h" = "xyes"; then +elif test "x$ac_cv_header_AudioUnit_AudioUnit_h" = "xyes"; then platform_api="coreaudio" - platform_lib="-framework AudioToolbox" + platform_lib="-framework AudioUnit" elif test "x$ac_cv_header_sndio_h" = "xyes"; then platform_api="sndio" platform_lib="-lsndio -lm" diff --git a/src/cubeb_audiounit.c b/src/cubeb_audiounit.c index f661a54..4a5966c 100644 --- a/src/cubeb_audiounit.c +++ b/src/cubeb_audiounit.c @@ -8,7 +8,6 @@ #include <assert.h> #include <pthread.h> #include <stdlib.h> -#include <CoreServices/CoreServices.h> #include <AudioUnit/AudioUnit.h> #include "cubeb/cubeb.h" @@ -106,9 +105,9 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n void * user_ptr) { AudioStreamBasicDescription ss; - ComponentDescription desc; + AudioComponentDescription desc; cubeb_stream * stm; - Component comp; + AudioComponent comp; AURenderCallbackStruct input; unsigned int buffer_size; OSStatus r; @@ -162,7 +161,7 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; - comp = FindNextComponent(NULL, &desc); + comp = AudioComponentFindNext(NULL, &desc); assert(comp); stm = calloc(1, sizeof(*stm)); @@ -180,7 +179,7 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n stm->frames_played = 0; stm->frames_queued = 0; - r = OpenAComponent(comp, &stm->unit); + r = AudioComponentInstanceNew(comp, &stm->unit); if (r != 0) { cubeb_stream_destroy(stm); return CUBEB_ERROR; @@ -229,7 +228,7 @@ cubeb_stream_destroy(cubeb_stream * stm) if (stm->unit) { AudioOutputUnitStop(stm->unit); AudioUnitUninitialize(stm->unit); - CloseComponent(stm->unit); + AudioComponentInstanceDispose(stm->unit); } r = pthread_mutex_destroy(&stm->mutex); |