[PATCHv1 17/47] android/client: Support new API for SCO HAL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

Add support for new parameters in open_output_stream() and
open_inut_stream().
---
 android/client/if-sco.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/android/client/if-sco.c b/android/client/if-sco.c
index e7197b2..96dc083 100644
--- a/android/client/if-sco.c
+++ b/android/client/if-sco.c
@@ -62,7 +62,9 @@ SINTMAP(audio_channel_mask_t, -1, "(AUDIO_CHANNEL_INVALID)")
 	DELEMENT(AUDIO_CHANNEL_OUT_MONO),
 	DELEMENT(AUDIO_CHANNEL_OUT_STEREO),
 	DELEMENT(AUDIO_CHANNEL_OUT_QUAD),
+#if ANDROID_VERSION <= PLATFORM_VER(4, 4, 4)
 	DELEMENT(AUDIO_CHANNEL_OUT_SURROUND),
+#endif
 	DELEMENT(AUDIO_CHANNEL_OUT_5POINT1),
 	DELEMENT(AUDIO_CHANNEL_OUT_7POINT1),
 	DELEMENT(AUDIO_CHANNEL_OUT_ALL),
@@ -509,12 +511,21 @@ static void open_output_stream_p(int argc, const char **argv)
 		config->format = AUDIO_FORMAT_PCM_16_BIT;
 	}
 
+#if ANDROID_VERSION > PLATFORM_VER(4, 4, 4)
+	err = if_audio_sco->open_output_stream(if_audio_sco,
+						0,
+						AUDIO_DEVICE_OUT_ALL_SCO,
+						AUDIO_OUTPUT_FLAG_NONE,
+						config,
+						&stream_out, NULL);
+#else
 	err = if_audio_sco->open_output_stream(if_audio_sco,
 						0,
 						AUDIO_DEVICE_OUT_ALL_SCO,
 						AUDIO_OUTPUT_FLAG_NONE,
 						config,
 						&stream_out);
+#endif
 	if (err < 0) {
 		haltest_error("open output stream returned %d\n", err);
 		goto failed;
@@ -572,11 +583,19 @@ static void open_input_stream_p(int argc, const char **argv)
 		config->format = AUDIO_FORMAT_PCM_16_BIT;
 	}
 
+#if ANDROID_VERSION > PLATFORM_VER(4, 4, 4)
+	err = if_audio_sco->open_input_stream(if_audio_sco,
+						0,
+						AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET,
+						config,
+						&stream_in, 0, NULL, 0);
+#else
 	err = if_audio_sco->open_input_stream(if_audio_sco,
 						0,
 						AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET,
 						config,
 						&stream_in);
+#endif
 	if (err < 0) {
 		haltest_error("open output stream returned %d\n", err);
 		goto failed;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux