summaryrefslogtreecommitdiffstats
path: root/audio/audio_policy_hal.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-01-17 17:34:58 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-01-17 17:34:58 -0800
commitf6fc420a79f98d93d953a60b1fc0a5b5f71a3fe2 (patch)
tree0afc84b502a6687ef52343489bf9308deaa27675 /audio/audio_policy_hal.cpp
parent9038c346d76d6f9e33be34b7760f39804553d993 (diff)
parentc6f331b3f48455c9a9cdf00fc82894badd0a7da6 (diff)
downloadhardware_libhardware_legacy-f6fc420a79f98d93d953a60b1fc0a5b5f71a3fe2.zip
hardware_libhardware_legacy-f6fc420a79f98d93d953a60b1fc0a5b5f71a3fe2.tar.gz
hardware_libhardware_legacy-f6fc420a79f98d93d953a60b1fc0a5b5f71a3fe2.tar.bz2
Merge "audio policy manager: stream volume per device"
Diffstat (limited to 'audio/audio_policy_hal.cpp')
-rw-r--r--audio/audio_policy_hal.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/audio/audio_policy_hal.cpp b/audio/audio_policy_hal.cpp
index a0100a8..7d2e1e0 100644
--- a/audio/audio_policy_hal.cpp
+++ b/audio/audio_policy_hal.cpp
@@ -216,7 +216,8 @@ static int ap_set_stream_volume_index(struct audio_policy *pol,
{
struct legacy_audio_policy *lap = to_lap(pol);
return lap->apm->setStreamVolumeIndex((AudioSystem::stream_type)stream,
- index);
+ index,
+ AUDIO_DEVICE_OUT_DEFAULT);
}
static int ap_get_stream_volume_index(const struct audio_policy *pol,
@@ -225,7 +226,30 @@ static int ap_get_stream_volume_index(const struct audio_policy *pol,
{
const struct legacy_audio_policy *lap = to_clap(pol);
return lap->apm->getStreamVolumeIndex((AudioSystem::stream_type)stream,
- index);
+ index,
+ AUDIO_DEVICE_OUT_DEFAULT);
+}
+
+static int ap_set_stream_volume_index_for_device(struct audio_policy *pol,
+ audio_stream_type_t stream,
+ int index,
+ audio_devices_t device)
+{
+ struct legacy_audio_policy *lap = to_lap(pol);
+ return lap->apm->setStreamVolumeIndex((AudioSystem::stream_type)stream,
+ index,
+ device);
+}
+
+static int ap_get_stream_volume_index_for_device(const struct audio_policy *pol,
+ audio_stream_type_t stream,
+ int *index,
+ audio_devices_t device)
+{
+ const struct legacy_audio_policy *lap = to_clap(pol);
+ return lap->apm->getStreamVolumeIndex((AudioSystem::stream_type)stream,
+ index,
+ device);
}
static uint32_t ap_get_strategy_for_stream(const struct audio_policy *pol,
@@ -320,6 +344,8 @@ static int create_legacy_ap(const struct audio_policy_device *device,
lap->policy.init_stream_volume = ap_init_stream_volume;
lap->policy.set_stream_volume_index = ap_set_stream_volume_index;
lap->policy.get_stream_volume_index = ap_get_stream_volume_index;
+ lap->policy.set_stream_volume_index_for_device = ap_set_stream_volume_index_for_device;
+ lap->policy.get_stream_volume_index_for_device = ap_get_stream_volume_index_for_device;
lap->policy.get_strategy_for_stream = ap_get_strategy_for_stream;
lap->policy.get_devices_for_stream = ap_get_devices_for_stream;
lap->policy.get_output_for_effect = ap_get_output_for_effect;