Linux bluetooth development
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 1/7] android/hal-sco: Add support for new Android API
Date: Wed,  5 Nov 2014 10:41:16 +0200	[thread overview]
Message-ID: <1415176882-12397-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> (raw)

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Add new parameters to sco_open_input_stream() and
sco_open_output_stream() for the new API.
---
 android/hal-sco.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 59 insertions(+), 4 deletions(-)

diff --git a/android/hal-sco.c b/android/hal-sco.c
index 91a3baf..d9c9a68 100644
--- a/android/hal-sco.c
+++ b/android/hal-sco.c
@@ -612,12 +612,13 @@ static int out_remove_audio_effect(const struct audio_stream *stream,
 	return -ENOSYS;
 }
 
-static int sco_open_output_stream(struct audio_hw_device *dev,
+static int sco_open_output_stream_real(struct audio_hw_device *dev,
 					audio_io_handle_t handle,
 					audio_devices_t devices,
 					audio_output_flags_t flags,
 					struct audio_config *config,
-					struct audio_stream_out **stream_out)
+					struct audio_stream_out **stream_out,
+					const char *address)
 {
 	struct sco_dev *adev = (struct sco_dev *) dev;
 	struct sco_stream_out *out;
@@ -741,6 +742,31 @@ failed:
 	return ret;
 }
 
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+static int sco_open_output_stream(struct audio_hw_device *dev,
+					audio_io_handle_t handle,
+					audio_devices_t devices,
+					audio_output_flags_t flags,
+					struct audio_config *config,
+					struct audio_stream_out **stream_out,
+					const char *address)
+{
+	return  sco_open_output_stream_real(dev, handle, devices, flags,
+						config, stream_out, address);
+}
+#else
+static int sco_open_output_stream(struct audio_hw_device *dev,
+					audio_io_handle_t handle,
+					audio_devices_t devices,
+					audio_output_flags_t flags,
+					struct audio_config *config,
+					struct audio_stream_out **stream_out)
+{
+	return sco_open_output_stream_real(dev, handle, devices, flags,
+						config, stream_out, NULL);
+}
+#endif
+
 static void sco_close_output_stream(struct audio_hw_device *dev,
 					struct audio_stream_out *stream_out)
 {
@@ -1060,11 +1086,14 @@ static uint32_t in_get_input_frames_lost(struct audio_stream_in *stream)
 	return -ENOSYS;
 }
 
-static int sco_open_input_stream(struct audio_hw_device *dev,
+static int sco_open_input_stream_real(struct audio_hw_device *dev,
 					audio_io_handle_t handle,
 					audio_devices_t devices,
 					struct audio_config *config,
-					struct audio_stream_in **stream_in)
+					struct audio_stream_in **stream_in,
+					audio_input_flags_t flags,
+					const char *address,
+					audio_source_t source)
 {
 	struct sco_dev *sco_dev = (struct sco_dev *) dev;
 	struct sco_stream_in *in;
@@ -1165,6 +1194,32 @@ failed2:
 	return ret;
 }
 
+#if ANDROID_VERSION >= PLATFORM_VER(5, 0, 0)
+static int sco_open_input_stream(struct audio_hw_device *dev,
+					audio_io_handle_t handle,
+					audio_devices_t devices,
+					struct audio_config *config,
+					struct audio_stream_in **stream_in,
+					audio_input_flags_t flags,
+					const char *address,
+					audio_source_t source)
+{
+	return sco_open_input_stream_real(dev, handle, devices, config,
+						stream_in, flags, address,
+						source);
+}
+#else
+static int sco_open_input_stream(struct audio_hw_device *dev,
+					audio_io_handle_t handle,
+					audio_devices_t devices,
+					struct audio_config *config,
+					struct audio_stream_in **stream_in)
+{
+	return sco_open_input_stream_real(dev, handle, devices, config,
+						stream_in, 0, NULL, 0);
+}
+#endif
+
 static void sco_close_input_stream(struct audio_hw_device *dev,
 					struct audio_stream_in *stream_in)
 {
-- 
1.9.1


             reply	other threads:[~2014-11-05  8:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05  8:41 Andrei Emeltchenko [this message]
2014-11-05  8:41 ` [PATCH 2/7] android/hal-sco: Remove deprecated API usage Andrei Emeltchenko
2014-11-05  8:41 ` [PATCH 3/7] android/hal-sco: Implement dummy SCO HAL functions Andrei Emeltchenko
2014-11-05  8:41 ` [PATCH 4/7] android/hal-sco: Save bd_addr for output stream of Audio SCO HAL Andrei Emeltchenko
2014-11-05  8:41 ` [PATCH 5/7] android/hal-sco: Save bd_addr for input " Andrei Emeltchenko
2014-11-05  8:41 ` [PATCH 6/7] android/hal-sco: Add remote address parameter in Get SCO fd command Andrei Emeltchenko
2014-11-05  8:41 ` [PATCH 7/7] android/hal-sco: Use bdaddr " Andrei Emeltchenko
2014-11-05 11:26 ` [PATCH 1/7] android/hal-sco: Add support for new Android API Szymon Janc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415176882-12397-1-git-send-email-Andrei.Emeltchenko.news@gmail.com \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox