summaryrefslogtreecommitdiffstats
path: root/media/libmedia/IAudioFlingerClient.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-05-01 11:38:42 -0700
committerEric Laurent <elaurent@google.com>2015-05-06 10:14:42 -0700
commit296fb13dd9b5e90d6a05cce897c3b1e7914a478a (patch)
treed3ed4e6ff2902da6f556d038c71605c091b75f64 /media/libmedia/IAudioFlingerClient.cpp
parent32fa6d0e65dbf956e253a1006e9419dce2fe75c9 (diff)
downloadframeworks_av-296fb13dd9b5e90d6a05cce897c3b1e7914a478a.zip
frameworks_av-296fb13dd9b5e90d6a05cce897c3b1e7914a478a.tar.gz
frameworks_av-296fb13dd9b5e90d6a05cce897c3b1e7914a478a.tar.bz2
Implement audio device callback
Add class AudioSystem::AudioDeviceCallback notifying AudioSystem clients upon device selection change on a given input or output thread. Maintain a list of installed callback per I/O handle in AudioSystem and call registered callbacks when an OPEN of CONFIG_CHANGED event is received on IAudioFlingerClient::ioConfigChanged(). Add methods to AudioTrack and AudioRecord to add and remove device change callbacks. Add methods to AudioTrack and AudioRecord to query currently selected device. ioConfigChanged() events now convey the audio patch describing the input or output thread routing. Fix AudioRecord failure to start when invalidation is handled by start(). Change-Id: I9e938adf025fa712337c63b1e02a8c18f2a20d39
Diffstat (limited to 'media/libmedia/IAudioFlingerClient.cpp')
-rw-r--r--media/libmedia/IAudioFlingerClient.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/media/libmedia/IAudioFlingerClient.cpp b/media/libmedia/IAudioFlingerClient.cpp
index a622241..3429d36 100644
--- a/media/libmedia/IAudioFlingerClient.cpp
+++ b/media/libmedia/IAudioFlingerClient.cpp
@@ -45,6 +45,7 @@ public:
data.writeInterfaceToken(IAudioFlingerClient::getInterfaceDescriptor());
data.writeInt32(event);
data.writeInt32((int32_t)ioDesc->mIoHandle);
+ data.write(&ioDesc->mPatch, sizeof(struct audio_patch));
data.writeInt32(ioDesc->mSamplingRate);
data.writeInt32(ioDesc->mFormat);
data.writeInt32(ioDesc->mChannelMask);
@@ -67,6 +68,7 @@ status_t BnAudioFlingerClient::onTransact(
audio_io_config_event event = (audio_io_config_event)data.readInt32();
sp<AudioIoDescriptor> ioDesc = new AudioIoDescriptor();
ioDesc->mIoHandle = (audio_io_handle_t) data.readInt32();
+ data.read(&ioDesc->mPatch, sizeof(struct audio_patch));
ioDesc->mSamplingRate = data.readInt32();
ioDesc->mFormat = (audio_format_t) data.readInt32();
ioDesc->mChannelMask = (audio_channel_mask_t) data.readInt32();