diff options
author | Glenn Kasten <gkasten@google.com> | 2014-07-24 13:46:44 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2014-07-27 12:18:08 -0700 |
commit | cbd48023d0a0e3fd59955011538c0087a439f905 (patch) | |
tree | 4353758603d1e8df57f05e51a8bc5a8b1d13d4e3 /services/audiopolicy/AudioPolicyManager.h | |
parent | 0fb47759256ecdaedbc34c880238bc9d102ef160 (diff) | |
download | frameworks_av-cbd48023d0a0e3fd59955011538c0087a439f905.zip frameworks_av-cbd48023d0a0e3fd59955011538c0087a439f905.tar.gz frameworks_av-cbd48023d0a0e3fd59955011538c0087a439f905.tar.bz2 |
audio policy: compatible sample rates and channel masks
Change-Id: I50d068a968aa6bd9e53e5b3111a1b09a6c2d219c
Diffstat (limited to 'services/audiopolicy/AudioPolicyManager.h')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.h b/services/audiopolicy/AudioPolicyManager.h index a420192..62b3ce5 100644 --- a/services/audiopolicy/AudioPolicyManager.h +++ b/services/audiopolicy/AudioPolicyManager.h @@ -240,8 +240,15 @@ protected: void loadGain(cnode *root, int index); void loadGains(cnode *root); - status_t checkSamplingRate(uint32_t samplingRate) const; - status_t checkChannelMask(audio_channel_mask_t channelMask) const; + // searches for an exact match + status_t checkExactSamplingRate(uint32_t samplingRate) const; + // searches for a compatible match, and returns the best match via updatedSamplingRate + status_t checkCompatibleSamplingRate(uint32_t samplingRate, + uint32_t *updatedSamplingRate) const; + // searches for an exact match + status_t checkExactChannelMask(audio_channel_mask_t channelMask) const; + // searches for a compatible match, currently implemented for input channel masks only + status_t checkCompatibleChannelMask(audio_channel_mask_t channelMask) const; status_t checkFormat(audio_format_t format) const; status_t checkGain(const struct audio_gain_config *gainConfig, int index) const; @@ -358,8 +365,13 @@ protected: IOProfile(const String8& name, audio_port_role_t role, const sp<HwModule>& module); virtual ~IOProfile(); + // This method is used for both output and input. + // If parameter updatedSamplingRate is non-NULL, it is assigned the actual sample rate. + // For input, flags is interpreted as audio_input_flags_t. + // TODO: merge audio_output_flags_t and audio_input_flags_t. bool isCompatibleProfile(audio_devices_t device, uint32_t samplingRate, + uint32_t *updatedSamplingRate, audio_format_t format, audio_channel_mask_t channelMask, audio_output_flags_t flags) const; @@ -676,8 +688,9 @@ protected: audio_io_handle_t selectOutput(const SortedVector<audio_io_handle_t>& outputs, audio_output_flags_t flags); + // samplingRate parameter is an in/out and so may be modified sp<IOProfile> getInputProfile(audio_devices_t device, - uint32_t samplingRate, + uint32_t& samplingRate, audio_format_t format, audio_channel_mask_t channelMask, audio_input_flags_t flags); |