summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@collabora.com>2012-01-30 12:28:13 -0300
committerReynaldo H. Verdejo Pinochet <reynaldo@collabora.com>2012-02-20 16:41:33 -0300
commit399da90e26806197316eb8c6e881beb48e83df14 (patch)
tree6b4396720e8c500436474b1ba8d2f4b4eee56a26
parent1ccad5a70d853886c50a73e5484a8d212cad184b (diff)
Use audio.h macros from Honeycomb onward
Many format and channel output definitions where moved from AudioSystem.h to audio.h. We conditionally include this new header now and rely on its definitions when available.
-rw-r--r--sink/audioflingersink/audioflinger_wrapper.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/sink/audioflingersink/audioflinger_wrapper.cpp b/sink/audioflingersink/audioflinger_wrapper.cpp
index dae199a..27a8d4c 100644
--- a/sink/audioflingersink/audioflinger_wrapper.cpp
+++ b/sink/audioflingersink/audioflinger_wrapper.cpp
@@ -23,6 +23,11 @@
#include <media/MediaPlayerInterface.h>
#include <media/libmediaplayerservice/MediaPlayerService.h>
#include "audioflinger_wrapper.h"
+
+#if __ANDROID_API__ > 13
+#include <system/audio.h>
+#endif
+
//#include <GstLog.h>
@@ -115,7 +120,11 @@ audioflinger_device_set (AudioFlingerDeviceHandle handle,
uint32_t channels = 0;
#endif
+#ifdef ANDROID_AUDIO_CORE_H
+ int format = AUDIO_FORMAT_PCM_16_BIT;
+#else
int format = AudioSystem::PCM_16_BIT;
+#endif
if (handle == NULL)
return -1;
@@ -130,10 +139,17 @@ audioflinger_device_set (AudioFlingerDeviceHandle handle,
#else
switch (channelCount) {
case 1:
+#ifdef ANDROID_AUDIO_CORE_H
+ channels = AUDIO_CHANNEL_OUT_FRONT_LEFT;
+ break;
+ case 2:
+ channels = AUDIO_CHANNEL_OUT_STEREO;
+#else
channels = AudioSystem::CHANNEL_OUT_FRONT_LEFT;
break;
case 2:
channels = AudioSystem::CHANNEL_OUT_STEREO;
+#endif
break;
case 0:
default: