diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2014-06-19 15:33:55 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-18 18:28:24 +0000 |
commit | 29a8b2fe294a34ac7f004203426961a599e725ea (patch) | |
tree | 06769995a441946136147a03e26817167e92bf88 /include | |
parent | 7a4d7d6670f1766442b54045fb420dbf42b75750 (diff) | |
parent | 5bd3f38638acab633d181359cc9ec27b80f84d43 (diff) | |
download | frameworks_av-29a8b2fe294a34ac7f004203426961a599e725ea.zip frameworks_av-29a8b2fe294a34ac7f004203426961a599e725ea.tar.gz frameworks_av-29a8b2fe294a34ac7f004203426961a599e725ea.tar.bz2 |
Merge changes I0fef0584,I322b91fa
* changes:
AudioPolicyManager: return output for audio attributes
AudioTrack construction with audio attributes
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioSystem.h | 9 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 9 | ||||
-rw-r--r-- | include/media/IAudioPolicyService.h | 6 |
3 files changed, 22 insertions, 2 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index a4722cb..c89ceaa 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -99,6 +99,8 @@ public: // to be non-zero if status == NO_ERROR static status_t getOutputSamplingRate(uint32_t* samplingRate, audio_stream_type_t stream); + static status_t getOutputSamplingRateForAttr(uint32_t* samplingRate, + const audio_attributes_t *attr); static status_t getOutputFrameCount(size_t* frameCount, audio_stream_type_t stream); static status_t getOutputLatency(uint32_t* latency, @@ -212,7 +214,12 @@ public: audio_channel_mask_t channelMask = AUDIO_CHANNEL_OUT_STEREO, audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, const audio_offload_info_t *offloadInfo = NULL); - + static audio_io_handle_t getOutputForAttr(const audio_attributes_t *attr, + uint32_t samplingRate = 0, + audio_format_t format = AUDIO_FORMAT_DEFAULT, + audio_channel_mask_t channelMask = AUDIO_CHANNEL_OUT_STEREO, + audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, + const audio_offload_info_t *offloadInfo = NULL); static status_t startOutput(audio_io_handle_t output, audio_stream_type_t stream, int session); diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 79db323..5dc77a3 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -253,7 +253,8 @@ public: transfer_type transferType = TRANSFER_DEFAULT, const audio_offload_info_t *offloadInfo = NULL, int uid = -1, - pid_t pid = -1); + pid_t pid = -1, + audio_attributes_t* pAttributes = NULL); /* Result of constructing the AudioTrack. This must be checked for successful initialization * before using any AudioTrack API (except for set()), because using @@ -586,6 +587,11 @@ protected: AudioTrack(const AudioTrack& other); AudioTrack& operator = (const AudioTrack& other); + void setAttributesFromStreamType(audio_stream_type_t streamType); + void setStreamTypeFromAttributes(audio_attributes_t& aa); + /* paa is guaranteed non-NULL */ + bool isValidAttributes(const audio_attributes_t *paa); + /* a small internal class to handle the callback */ class AudioTrackThread : public Thread { @@ -667,6 +673,7 @@ protected: transfer_type mTransfer; audio_offload_info_t mOffloadInfoCopy; const audio_offload_info_t* mOffloadInfo; + audio_attributes_t mAttributes; // mFrameSize is equal to mFrameSizeAF for non-PCM or 16-bit PCM data. For 8-bit PCM data, it's // twice as large as mFrameSize because data is expanded to 16-bit before it's stored in buffer. diff --git a/include/media/IAudioPolicyService.h b/include/media/IAudioPolicyService.h index d422aa3..959e4c3 100644 --- a/include/media/IAudioPolicyService.h +++ b/include/media/IAudioPolicyService.h @@ -56,6 +56,12 @@ public: audio_channel_mask_t channelMask = 0, audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, const audio_offload_info_t *offloadInfo = NULL) = 0; + virtual audio_io_handle_t getOutputForAttr(const audio_attributes_t *attr, + uint32_t samplingRate = 0, + audio_format_t format = AUDIO_FORMAT_DEFAULT, + audio_channel_mask_t channelMask = 0, + audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, + const audio_offload_info_t *offloadInfo = NULL) = 0; virtual status_t startOutput(audio_io_handle_t output, audio_stream_type_t stream, int session = 0) = 0; |