osxaudio: Fix build on iOS

These device-provider functions are only valid on macOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7340>
This commit is contained in:
Nirbheek Chauhan 2024-08-12 22:33:42 +05:30
parent f537f22522
commit daaeb57eca
3 changed files with 7 additions and 1 deletions

View file

@ -23,7 +23,6 @@
#include "gstosxcoreaudio.h" #include "gstosxcoreaudio.h"
#include "gstosxcoreaudiocommon.h" #include "gstosxcoreaudiocommon.h"
#include <CoreAudio/CoreAudio.h>
GST_DEBUG_CATEGORY (osx_coreaudio_debug); GST_DEBUG_CATEGORY (osx_coreaudio_debug);
#define GST_CAT_DEFAULT osx_coreaudio_debug #define GST_CAT_DEFAULT osx_coreaudio_debug
@ -34,6 +33,7 @@ G_DEFINE_TYPE (GstCoreAudio, gst_core_audio, G_TYPE_OBJECT);
#include "gstosxcoreaudioremoteio.c" #include "gstosxcoreaudioremoteio.c"
#else #else
#include "gstosxcoreaudiohal.c" #include "gstosxcoreaudiohal.c"
#include <CoreAudio/CoreAudio.h>
#endif #endif
enum enum
@ -425,10 +425,12 @@ gst_core_audio_select_device (GstCoreAudio * core_audio)
{ {
gboolean ret = gst_core_audio_select_device_impl (core_audio); gboolean ret = gst_core_audio_select_device_impl (core_audio);
#ifndef HAVE_IOS
if (core_audio->device_id != kAudioDeviceUnknown) if (core_audio->device_id != kAudioDeviceUnknown)
core_audio->unique_id = core_audio->unique_id =
gst_core_audio_device_get_prop (core_audio->device_id, gst_core_audio_device_get_prop (core_audio->device_id,
kAudioDevicePropertyDeviceUID); kAudioDevicePropertyDeviceUID);
#endif
return ret; return ret;
} }

View file

@ -560,6 +560,7 @@ gst_core_audio_dump_channel_layout (AudioChannelLayout * channel_layout)
} }
} }
#ifndef HAVE_IOS
char * char *
gst_core_audio_device_get_prop (AudioDeviceID device_id, gst_core_audio_device_get_prop (AudioDeviceID device_id,
AudioObjectPropertyElement prop_id) AudioObjectPropertyElement prop_id)
@ -607,3 +608,4 @@ gst_core_audio_device_get_prop (AudioDeviceID device_id,
beach: beach:
return result; return result;
} }
#endif

View file

@ -69,7 +69,9 @@ AudioChannelLabel gst_audio_channel_position_to_core_audio (GstAudioChannelPosit
GstAudioChannelPosition gst_core_audio_channel_label_to_gst (AudioChannelLabel label, int channel, gboolean warn); GstAudioChannelPosition gst_core_audio_channel_label_to_gst (AudioChannelLabel label, int channel, gboolean warn);
#ifndef HAVE_IOS
char * gst_core_audio_device_get_prop (AudioDeviceID device_id, char * gst_core_audio_device_get_prop (AudioDeviceID device_id,
AudioObjectPropertyElement prop_id); AudioObjectPropertyElement prop_id);
#endif
G_END_DECLS G_END_DECLS