summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-07-15 15:31:26 -0700
committerGlenn Kasten <gkasten@google.com>2014-07-17 12:13:07 -0700
commitec40d284218466d8f0e832e7eb88e6ea6c479c88 (patch)
tree46ae774a4f3535d07374bed459b1dcf2bb9d8803
parent6e6704c06d61bc356e30c164081e5bcffb37920c (diff)
downloadframeworks_av-ec40d284218466d8f0e832e7eb88e6ea6c479c88.zip
frameworks_av-ec40d284218466d8f0e832e7eb88e6ea6c479c88.tar.gz
frameworks_av-ec40d284218466d8f0e832e7eb88e6ea6c479c88.tar.bz2
Add audio_input_flags_t to IAudioFlinger::openInput
For backward compatibility, until flags are correctly calculated, we will assume that the request is for a low latency input stream. Change-Id: I76746834e870df00833dc77cbdaa2edd2ffeec95
-rw-r--r--include/media/IAudioFlinger.h3
-rw-r--r--media/libmedia/IAudioFlinger.cpp8
-rw-r--r--services/audioflinger/AudioFlinger.cpp7
-rw-r--r--services/audioflinger/AudioFlinger.h3
-rw-r--r--services/audiopolicy/AudioPolicyClientImpl.cpp5
-rw-r--r--services/audiopolicy/AudioPolicyClientImplLegacy.cpp6
-rw-r--r--services/audiopolicy/AudioPolicyInterface.h3
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp9
-rwxr-xr-xservices/audiopolicy/AudioPolicyService.h3
9 files changed, 31 insertions, 16 deletions
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index a8f4605..31312d3 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -163,7 +163,8 @@ public:
audio_devices_t *pDevices,
uint32_t *pSamplingRate,
audio_format_t *pFormat,
- audio_channel_mask_t *pChannelMask) = 0;
+ audio_channel_mask_t *pChannelMask,
+ audio_input_flags_t flags) = 0;
virtual status_t closeInput(audio_io_handle_t input) = 0;
virtual status_t invalidateStream(audio_stream_type_t stream) = 0;
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp
index 5cf42f7..7795fdb 100644
--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -532,7 +532,8 @@ public:
audio_devices_t *pDevices,
uint32_t *pSamplingRate,
audio_format_t *pFormat,
- audio_channel_mask_t *pChannelMask)
+ audio_channel_mask_t *pChannelMask,
+ audio_input_flags_t flags)
{
Parcel data, reply;
audio_devices_t devices = pDevices != NULL ? *pDevices : AUDIO_DEVICE_NONE;
@@ -547,6 +548,7 @@ public:
data.writeInt32(samplingRate);
data.writeInt32(format);
data.writeInt32(channelMask);
+ data.writeInt32(flags);
remote()->transact(OPEN_INPUT, data, &reply);
audio_io_handle_t input = (audio_io_handle_t) reply.readInt32();
devices = (audio_devices_t)reply.readInt32();
@@ -1157,12 +1159,14 @@ status_t BnAudioFlinger::onTransact(
uint32_t samplingRate = data.readInt32();
audio_format_t format = (audio_format_t) data.readInt32();
audio_channel_mask_t channelMask = (audio_channel_mask_t)data.readInt32();
+ audio_input_flags_t flags = (audio_input_flags_t) data.readInt32();
audio_io_handle_t input = openInput(module,
&devices,
&samplingRate,
&format,
- &channelMask);
+ &channelMask,
+ flags);
reply->writeInt32((int32_t) input);
reply->writeInt32(devices);
reply->writeInt32(samplingRate);
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 5fd7ce8..1ad6285 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1820,7 +1820,8 @@ audio_io_handle_t AudioFlinger::openInput(audio_module_handle_t module,
audio_devices_t *pDevices,
uint32_t *pSamplingRate,
audio_format_t *pFormat,
- audio_channel_mask_t *pChannelMask)
+ audio_channel_mask_t *pChannelMask,
+ audio_input_flags_t flags)
{
struct audio_config config;
memset(&config, 0, sizeof(config));
@@ -1847,15 +1848,15 @@ audio_io_handle_t AudioFlinger::openInput(audio_module_handle_t module,
audio_io_handle_t id = nextUniqueId();
audio_stream_in_t *inStream = NULL;
- audio_input_flags_t flags = AUDIO_INPUT_FLAG_FAST; // FIXME until added to openInput()
status_t status = inHwHal->open_input_stream(inHwHal, id, *pDevices, &config,
&inStream, flags);
ALOGV("openInput() openInputStream returned input %p, SamplingRate %d, Format %#x, Channels %x, "
- "status %d",
+ "flags %#x, status %d",
inStream,
config.sample_rate,
config.format,
config.channel_mask,
+ flags,
status);
// If the input could not be opened with the requested parameters and we can handle the
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index be19554..bae18fd 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -179,7 +179,8 @@ public:
audio_devices_t *pDevices,
uint32_t *pSamplingRate,
audio_format_t *pFormat,
- audio_channel_mask_t *pChannelMask);
+ audio_channel_mask_t *pChannelMask,
+ audio_input_flags_t flags);
virtual status_t closeInput(audio_io_handle_t input);
diff --git a/services/audiopolicy/AudioPolicyClientImpl.cpp b/services/audiopolicy/AudioPolicyClientImpl.cpp
index c322d92..b5af089 100644
--- a/services/audiopolicy/AudioPolicyClientImpl.cpp
+++ b/services/audiopolicy/AudioPolicyClientImpl.cpp
@@ -101,7 +101,8 @@ audio_io_handle_t AudioPolicyService::AudioPolicyClient::openInput(audio_module_
audio_devices_t *pDevices,
uint32_t *pSamplingRate,
audio_format_t *pFormat,
- audio_channel_mask_t *pChannelMask)
+ audio_channel_mask_t *pChannelMask,
+ audio_input_flags_t flags)
{
sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
if (af == 0) {
@@ -109,7 +110,7 @@ audio_io_handle_t AudioPolicyService::AudioPolicyClient::openInput(audio_module_
return 0;
}
- return af->openInput(module, pDevices, pSamplingRate, pFormat, pChannelMask);
+ return af->openInput(module, pDevices, pSamplingRate, pFormat, pChannelMask, flags);
}
status_t AudioPolicyService::AudioPolicyClient::closeInput(audio_io_handle_t input)
diff --git a/services/audiopolicy/AudioPolicyClientImplLegacy.cpp b/services/audiopolicy/AudioPolicyClientImplLegacy.cpp
index 53f3e2d..97e12cc 100644
--- a/services/audiopolicy/AudioPolicyClientImplLegacy.cpp
+++ b/services/audiopolicy/AudioPolicyClientImplLegacy.cpp
@@ -158,7 +158,8 @@ audio_io_handle_t aps_open_input(void *service __unused,
return 0;
}
- return af->openInput((audio_module_handle_t)0, pDevices, pSamplingRate, pFormat, pChannelMask);
+ return af->openInput((audio_module_handle_t)0, pDevices, pSamplingRate, pFormat, pChannelMask,
+ AUDIO_INPUT_FLAG_FAST /*FIXME*/);
}
audio_io_handle_t aps_open_input_on_module(void *service __unused,
@@ -174,7 +175,8 @@ audio_io_handle_t aps_open_input_on_module(void *service __unused,
return 0;
}
- return af->openInput(module, pDevices, pSamplingRate, pFormat, pChannelMask);
+ return af->openInput(module, pDevices, pSamplingRate, pFormat, pChannelMask,
+ AUDIO_INPUT_FLAG_FAST /*FIXME*/);
}
int aps_close_input(void *service __unused, audio_io_handle_t input)
diff --git a/services/audiopolicy/AudioPolicyInterface.h b/services/audiopolicy/AudioPolicyInterface.h
index 33e4397..ed66e58 100644
--- a/services/audiopolicy/AudioPolicyInterface.h
+++ b/services/audiopolicy/AudioPolicyInterface.h
@@ -238,7 +238,8 @@ public:
audio_devices_t *pDevices,
uint32_t *pSamplingRate,
audio_format_t *pFormat,
- audio_channel_mask_t *pChannelMask) = 0;
+ audio_channel_mask_t *pChannelMask,
+ audio_input_flags_t flags) = 0;
// closes an audio input
virtual status_t closeInput(audio_io_handle_t input) = 0;
//
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index f2320de..cca1b34 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -1111,7 +1111,8 @@ audio_io_handle_t AudioPolicyManager::getInput(audio_source_t inputSource,
&inputDesc->mDevice,
&inputDesc->mSamplingRate,
&inputDesc->mFormat,
- &inputDesc->mChannelMask);
+ &inputDesc->mChannelMask,
+ AUDIO_INPUT_FLAG_FAST /*FIXME*/);
// only accept input with the exact requested set of parameters
if (input == 0 ||
@@ -2332,7 +2333,8 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
&inputDesc->mDevice,
&inputDesc->mSamplingRate,
&inputDesc->mFormat,
- &inputDesc->mChannelMask);
+ &inputDesc->mChannelMask,
+ AUDIO_INPUT_FLAG_FAST /*FIXME*/);
if (input != 0) {
for (size_t k = 0; k < inProfile->mSupportedDevices.size(); k++) {
@@ -2898,7 +2900,8 @@ status_t AudioPolicyManager::checkInputsForDevice(audio_devices_t device,
&desc->mDevice,
&desc->mSamplingRate,
&desc->mFormat,
- &desc->mChannelMask);
+ &desc->mChannelMask,
+ AUDIO_INPUT_FLAG_FAST /*FIXME*/);
if (input != 0) {
if (!address.isEmpty()) {
diff --git a/services/audiopolicy/AudioPolicyService.h b/services/audiopolicy/AudioPolicyService.h
index 380fd5e..4a81423 100755
--- a/services/audiopolicy/AudioPolicyService.h
+++ b/services/audiopolicy/AudioPolicyService.h
@@ -388,7 +388,8 @@ private:
audio_devices_t *pDevices,
uint32_t *pSamplingRate,
audio_format_t *pFormat,
- audio_channel_mask_t *pChannelMask);
+ audio_channel_mask_t *pChannelMask,
+ audio_input_flags_t flags);
// closes an audio input
virtual status_t closeInput(audio_io_handle_t input);
//