summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2012-03-21 17:42:25 -0700
committerMike Lockwood <lockwood@google.com>2012-03-21 17:42:25 -0700
commit0b934ade258294987f8bde9cd338d7b635522719 (patch)
treec4275d7c16157f0f195850f9cdecd14131224de6 /audio
parent7c85ce853421f6299eb5fd05782cf9e25a8f2071 (diff)
parent617c80a82e5620b2f16348e4bd3d7fc3b76e9021 (diff)
downloadhardware_libhardware_legacy-0b934ade258294987f8bde9cd338d7b635522719.tar.gz
hardware_libhardware_legacy-0b934ade258294987f8bde9cd338d7b635522719.tar.bz2
hardware_libhardware_legacy-0b934ade258294987f8bde9cd338d7b635522719.zip
Merge commit '617c80a'
Add a bridge implementation of get_master_volume. Conflicts: audio/audio_hw_hal.cpp Change-Id: Icff9d8dce05d1d811fca815cc39cb38a1df293f9
Diffstat (limited to 'audio')
-rw-r--r--audio/AudioHardwareInterface.cpp5
-rw-r--r--audio/audio_hw_hal.cpp7
2 files changed, 12 insertions, 0 deletions
diff --git a/audio/AudioHardwareInterface.cpp b/audio/AudioHardwareInterface.cpp
index d1b9351..53c64b5 100644
--- a/audio/AudioHardwareInterface.cpp
+++ b/audio/AudioHardwareInterface.cpp
@@ -122,6 +122,11 @@ size_t AudioHardwareBase::getInputBufferSize(uint32_t sampleRate, int format, in
return 320;
}
+status_t AudioHardwareBase::getMasterVolume(float *volume)
+{
+ return INVALID_OPERATION;
+}
+
status_t AudioHardwareBase::dumpState(int fd, const Vector<String16>& args)
{
const size_t SIZE = 256;
diff --git a/audio/audio_hw_hal.cpp b/audio/audio_hw_hal.cpp
index a87db2f..dd66f76 100644
--- a/audio/audio_hw_hal.cpp
+++ b/audio/audio_hw_hal.cpp
@@ -348,6 +348,12 @@ static int adev_set_master_volume(struct audio_hw_device *dev, float volume)
return ladev->hwif->setMasterVolume(volume);
}
+static int adev_get_master_volume(struct audio_hw_device *dev, float* volume)
+{
+ struct legacy_audio_device *ladev = to_ladev(dev);
+ return ladev->hwif->getMasterVolume(volume);
+}
+
static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode)
{
struct legacy_audio_device *ladev = to_ladev(dev);
@@ -556,6 +562,7 @@ static int legacy_adev_open(const hw_module_t* module, const char* name,
ladev->device.init_check = adev_init_check;
ladev->device.set_voice_volume = adev_set_voice_volume;
ladev->device.set_master_volume = adev_set_master_volume;
+ ladev->device.get_master_volume = adev_get_master_volume;
ladev->device.set_mode = adev_set_mode;
ladev->device.set_mic_mute = adev_set_mic_mute;
ladev->device.get_mic_mute = adev_get_mic_mute;