diff options
author | Eric Laurent <elaurent@google.com> | 2015-05-06 17:51:41 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-06 17:51:42 +0000 |
commit | d7ab7afa57ed1fa6fb9c4ce18ea0df3ec939c067 (patch) | |
tree | ed0fd03c176ba5ae421795f4665d47faec653c52 /include/media/AudioTrack.h | |
parent | eb58c6d9ee8eac81864aaecb38a1831014ebf152 (diff) | |
parent | 296fb13dd9b5e90d6a05cce897c3b1e7914a478a (diff) | |
download | frameworks_av-d7ab7afa57ed1fa6fb9c4ce18ea0df3ec939c067.zip frameworks_av-d7ab7afa57ed1fa6fb9c4ce18ea0df3ec939c067.tar.gz frameworks_av-d7ab7afa57ed1fa6fb9c4ce18ea0df3ec939c067.tar.bz2 |
Merge "Implement audio device callback" into mnc-dev
Diffstat (limited to 'include/media/AudioTrack.h')
-rw-r--r-- | include/media/AudioTrack.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 0ccd19e..458f4b4 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -510,7 +510,7 @@ public: */ status_t setOutputDevice(audio_port_handle_t deviceId); - /* Returns the ID of the audio device used for output of this AudioTrack. + /* Returns the ID of the audio device selected for this AudioTrack. * A value of AUDIO_PORT_HANDLE_NONE indicates default (AudioPolicyManager) routing. * * Parameters: @@ -518,6 +518,15 @@ public: */ audio_port_handle_t getOutputDevice(); + /* Returns the ID of the audio device actually used by the output to which this AudioTrack is + * attached. + * A value of AUDIO_PORT_HANDLE_NONE indicates the audio track is not attached to any output. + * + * Parameters: + * none. + */ + audio_port_handle_t getRoutedDeviceId(); + /* Returns the unique session ID associated with this track. * * Parameters: @@ -664,6 +673,28 @@ public: */ status_t getTimestamp(AudioTimestamp& timestamp); + /* Add an AudioDeviceCallback. The caller will be notified when the audio device to which this + * AudioTrack is routed is updated. + * Replaces any previously installed callback. + * Parameters: + * callback: The callback interface + * Returns NO_ERROR if successful. + * INVALID_OPERATION if the same callback is already installed. + * NO_INIT or PREMISSION_DENIED if AudioFlinger service is not reachable + * BAD_VALUE if the callback is NULL + */ + status_t addAudioDeviceCallback(const sp<AudioSystem::AudioDeviceCallback>& callback); + + /* remove an AudioDeviceCallback. + * Parameters: + * callback: The callback interface + * Returns NO_ERROR if successful. + * INVALID_OPERATION if the callback is not installed + * BAD_VALUE if the callback is NULL + */ + status_t removeAudioDeviceCallback( + const sp<AudioSystem::AudioDeviceCallback>& callback); + protected: /* copying audio tracks is not allowed */ AudioTrack(const AudioTrack& other); @@ -885,6 +916,8 @@ private: uint32_t mSequence; // incremented for each new IAudioTrack attempt int mClientUid; pid_t mClientPid; + + sp<AudioSystem::AudioDeviceCallback> mDeviceCallback; }; class TimedAudioTrack : public AudioTrack |