diff options
author | Eric Laurent <elaurent@google.com> | 2014-11-27 00:06:00 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-27 00:06:00 +0000 |
commit | 61280541836947ce0b281b240ffa4c55bbf5bd55 (patch) | |
tree | 4a287a2b07095295e7f054399fd9fb3052629d70 /include | |
parent | b438123fb1ee0a8c232fd66de658d5382d2083cf (diff) | |
parent | 390ef84373b7edd1397381f780ca235326357094 (diff) | |
download | frameworks_av-61280541836947ce0b281b240ffa4c55bbf5bd55.zip frameworks_av-61280541836947ce0b281b240ffa4c55bbf5bd55.tar.gz frameworks_av-61280541836947ce0b281b240ffa4c55bbf5bd55.tar.bz2 |
am 390ef843: am f20c4356: Merge "AudioRecord: use audio attributes instead of audio source." into lmp-mr1-dev
* commit '390ef84373b7edd1397381f780ca235326357094':
AudioRecord: use audio attributes instead of audio source.
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioRecord.h | 11 | ||||
-rw-r--r-- | include/media/AudioSystem.h | 7 | ||||
-rw-r--r-- | include/media/IAudioPolicyService.h | 13 |
3 files changed, 18 insertions, 13 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 4edc1bf..f70d981 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -152,6 +152,7 @@ public: * transferType: How data is transferred from AudioRecord. * flags: See comments on audio_input_flags_t in <system/audio.h> * threadCanCallJava: Not present in parameter list, and so is fixed at false. + * pAttributes: if not NULL, supersedes inputSource for use case selection */ AudioRecord(audio_source_t inputSource, @@ -164,7 +165,8 @@ public: uint32_t notificationFrames = 0, int sessionId = AUDIO_SESSION_ALLOCATE, transfer_type transferType = TRANSFER_DEFAULT, - audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE); + audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE, + const audio_attributes_t* pAttributes = NULL); /* Terminates the AudioRecord and unregisters it from AudioFlinger. * Also destroys all resources associated with the AudioRecord. @@ -198,7 +200,8 @@ public: bool threadCanCallJava = false, int sessionId = AUDIO_SESSION_ALLOCATE, transfer_type transferType = TRANSFER_DEFAULT, - audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE); + audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE, + const audio_attributes_t* pAttributes = NULL); /* Result of constructing the AudioRecord. This must be checked for successful initialization * before using any AudioRecord API (except for set()), because using @@ -219,7 +222,7 @@ public: uint32_t channelCount() const { return mChannelCount; } size_t frameCount() const { return mFrameCount; } size_t frameSize() const { return mFrameSize; } - audio_source_t inputSource() const { return mInputSource; } + audio_source_t inputSource() const { return mAttributes.source; } /* After it's created the track is not active. Call start() to * make it active. If set, the callback will start being called. @@ -489,7 +492,6 @@ private: audio_format_t mFormat; uint32_t mChannelCount; size_t mFrameSize; // app-level frame size == AudioFlinger frame size - audio_source_t mInputSource; uint32_t mLatency; // in ms audio_channel_mask_t mChannelMask; audio_input_flags_t mFlags; @@ -529,6 +531,7 @@ private: sp<DeathNotifier> mDeathNotifier; uint32_t mSequence; // incremented for each new IAudioRecord attempt + audio_attributes_t mAttributes; }; }; // namespace android diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index 7f1afb3..bf1fc1c 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -236,12 +236,13 @@ public: // Client must successfully hand off the handle reference to AudioFlinger via openRecord(), // or release it with releaseInput(). - static audio_io_handle_t getInput(audio_source_t inputSource, + static status_t getInputForAttr(const audio_attributes_t *attr, + audio_io_handle_t *input, + audio_session_t session, uint32_t samplingRate, audio_format_t format, audio_channel_mask_t channelMask, - audio_session_t sessionId, - audio_input_flags_t); + audio_input_flags_t flags); static status_t startInput(audio_io_handle_t input, audio_session_t session); diff --git a/include/media/IAudioPolicyService.h b/include/media/IAudioPolicyService.h index 2f30304..3e4b873 100644 --- a/include/media/IAudioPolicyService.h +++ b/include/media/IAudioPolicyService.h @@ -74,12 +74,13 @@ public: virtual void releaseOutput(audio_io_handle_t output, audio_stream_type_t stream, audio_session_t session) = 0; - virtual audio_io_handle_t getInput(audio_source_t inputSource, - uint32_t samplingRate, - audio_format_t format, - audio_channel_mask_t channelMask, - audio_session_t audioSession, - audio_input_flags_t flags) = 0; + virtual status_t getInputForAttr(const audio_attributes_t *attr, + audio_io_handle_t *input, + audio_session_t session, + uint32_t samplingRate, + audio_format_t format, + audio_channel_mask_t channelMask, + audio_input_flags_t flags) = 0; virtual status_t startInput(audio_io_handle_t input, audio_session_t session) = 0; virtual status_t stopInput(audio_io_handle_t input, |