diff options
author | Eric Laurent <elaurent@google.com> | 2014-07-27 18:39:40 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-08-05 12:10:27 -0700 |
commit | df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871 (patch) | |
tree | e54724362f700e3e72fc72604a3b5f568d8cee7b /services/audiopolicy/AudioPolicyManager.h | |
parent | d0fded31e473e909c018f534d3019fb5168bdcd6 (diff) | |
download | frameworks_av-df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871.zip frameworks_av-df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871.tar.gz frameworks_av-df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871.tar.bz2 |
Add sound trigger control by audio policy
Audio policy:
- Added active capture indication to sound trigger service:
recognition stops if concurrent capture is not supported.
- Added generation of reserved I/O handle and session ID for
utterance capture.
Sound trigger service
- Added sound model update callback handling.
- Added service state callback
- Simplified callback shared memory allocation.
Bug: 12378680.
Change-Id: Ib0292c2733e6df90fdae480633dd9953d0016ef1
Diffstat (limited to 'services/audiopolicy/AudioPolicyManager.h')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.h b/services/audiopolicy/AudioPolicyManager.h index e28a362..dd0f00f 100644 --- a/services/audiopolicy/AudioPolicyManager.h +++ b/services/audiopolicy/AudioPolicyManager.h @@ -172,6 +172,12 @@ public: virtual status_t setAudioPortConfig(const struct audio_port_config *config); virtual void clearAudioPatches(uid_t uid); + virtual status_t acquireSoundTriggerSession(audio_session_t *session, + audio_io_handle_t *ioHandle, + audio_devices_t *device); + + virtual status_t releaseSoundTriggerSession(audio_session_t session); + protected: enum routing_strategy { @@ -477,15 +483,18 @@ protected: status_t dump(int fd); - audio_port_handle_t mId; - audio_io_handle_t mIoHandle; // input handle - audio_devices_t mDevice; // current device this input is routed to - audio_patch_handle_t mPatchHandle; - uint32_t mRefCount; // number of AudioRecord clients using this output - uint32_t mOpenRefCount; - audio_source_t mInputSource; // input source selected by application (mediarecorder.h) - const sp<IOProfile> mProfile; // I/O profile this output derives from - SortedVector<audio_session_t> mSessions; // audio sessions attached to this input + audio_port_handle_t mId; + audio_io_handle_t mIoHandle; // input handle + audio_devices_t mDevice; // current device this input is routed to + audio_patch_handle_t mPatchHandle; + uint32_t mRefCount; // number of AudioRecord clients using + // this input + uint32_t mOpenRefCount; + audio_source_t mInputSource; // input source selected by application + //(mediarecorder.h) + const sp<IOProfile> mProfile; // I/O profile this output derives from + SortedVector<audio_session_t> mSessions; // audio sessions attached to this input + bool mIsSoundTrigger; // used by a soundtrigger capture virtual void toAudioPortConfig(struct audio_port_config *dstConfig, const struct audio_port_config *srcConfig = NULL) const; @@ -569,6 +578,8 @@ protected: // ignoreVirtualInputs is true. audio_io_handle_t getActiveInput(bool ignoreVirtualInputs = true); + uint32_t activeInputsCount() const; + // initialize volume curves for each strategy and device category void initializeVolumeCurves(); @@ -769,6 +780,8 @@ protected: DefaultKeyedVector<audio_patch_handle_t, sp<AudioPatch> > mAudioPatches; + DefaultKeyedVector<audio_session_t, audio_io_handle_t> mSoundTriggerSessions; + #ifdef AUDIO_POLICY_TEST Mutex mLock; Condition mWaitWorkCV; |