diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2012-10-10 12:11:16 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2012-10-10 12:11:16 -0700 |
commit | d7086030fcf731e4bcef6c033cc6418cd04e6b91 (patch) | |
tree | 51f233eeff7c3e17e980d1fb0f41a2ba3f030b16 /services | |
parent | dca0ac2193e87c57d871dd208073107408c13c0a (diff) | |
download | frameworks_av-d7086030fcf731e4bcef6c033cc6418cd04e6b91.zip frameworks_av-d7086030fcf731e4bcef6c033cc6418cd04e6b91.tar.gz frameworks_av-d7086030fcf731e4bcef6c033cc6418cd04e6b91.tar.bz2 |
Support querying active record sources
Add support for querying whether there is currently a recording
underway from the specified audio source.
Bug 7314859
Change-Id: I986b231a10ffd368b08ec2f9c7f348d28eaeb892
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/AudioPolicyService.cpp | 12 | ||||
-rw-r--r-- | services/audioflinger/AudioPolicyService.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp index 155a0b8..8b99bd2 100644 --- a/services/audioflinger/AudioPolicyService.cpp +++ b/services/audioflinger/AudioPolicyService.cpp @@ -483,6 +483,18 @@ bool AudioPolicyService::isStreamActive(audio_stream_type_t stream, uint32_t inP return mpAudioPolicy->is_stream_active(mpAudioPolicy, stream, inPastMs); } +bool AudioPolicyService::isSourceActive(audio_source_t source) const +{ + if (mpAudioPolicy == NULL) { + return false; + } + if (mpAudioPolicy->is_source_active == 0) { + return false; + } + Mutex::Autolock _l(mLock); + return mpAudioPolicy->is_source_active(mpAudioPolicy, source); +} + status_t AudioPolicyService::queryDefaultPreProcessing(int audioSession, effect_descriptor_t *descriptors, uint32_t *count) diff --git a/services/audioflinger/AudioPolicyService.h b/services/audioflinger/AudioPolicyService.h index a086734..63f9549 100644 --- a/services/audioflinger/AudioPolicyService.h +++ b/services/audioflinger/AudioPolicyService.h @@ -104,6 +104,7 @@ public: virtual status_t unregisterEffect(int id); virtual status_t setEffectEnabled(int id, bool enabled); virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const; + virtual bool isSourceActive(audio_source_t source) const; virtual status_t queryDefaultPreProcessing(int audioSession, effect_descriptor_t *descriptors, |