Merge "hal: Add support for FAST FLAG in compress path"

This commit is contained in:
qctecmdr 2019-07-08 01:46:40 -07:00 committed by Gerrit - the friendly Code Review server
commit de7166b7b9
4 changed files with 22 additions and 0 deletions

View File

@ -1151,6 +1151,7 @@ int audio_extn_utils_compress_get_dsp_presentation_pos(struct stream_out *out,
int audio_extn_utils_pcm_get_dsp_presentation_pos(struct stream_out *out,
uint64_t *frames, struct timespec *timestamp, int32_t clock_id);
size_t audio_extn_utils_get_input_buffer_size(uint32_t, audio_format_t, int, int64_t, bool);
int audio_extn_utils_get_perf_mode_flag(void);
#ifdef AUDIO_HW_LOOPBACK_ENABLED
/* API to create audio patch */
int audio_extn_hw_loopback_create_audio_patch(struct audio_hw_device *dev,

View File

@ -332,6 +332,11 @@ int cin_configure_input_stream(struct stream_in *in, struct audio_config *in_con
else
cin_data->compr_config.codec->compr_passthr = PASSTHROUGH_GEN;
if (in->flags & AUDIO_INPUT_FLAG_FAST) {
ALOGD("%s: Setting latency mode to true", __func__);
cin_data->compr_config.codec->flags |= audio_extn_utils_get_perf_mode_flag();
}
if ((in->flags & AUDIO_INPUT_FLAG_TIMESTAMP) ||
(in->flags & AUDIO_INPUT_FLAG_PASSTHROUGH)) {
compress_config_set_timstamp_flag(&cin_data->compr_config);

View File

@ -2949,6 +2949,15 @@ int audio_extn_utils_is_vendor_enhanced_fwk()
return is_running_with_enhanced_fwk;
}
int audio_extn_utils_get_perf_mode_flag(void)
{
#ifdef COMPRESSED_PERF_MODE_FLAG
return COMPRESSED_PERF_MODE_FLAG;
#else
return 0;
#endif
}
size_t audio_extn_utils_get_input_buffer_size(uint32_t sample_rate,
audio_format_t format,
int channel_count,

View File

@ -7380,6 +7380,11 @@ int adev_open_output_stream(struct audio_hw_device *dev,
ALOGV("non-offload DIRECT_usecase ... usecase selected %d ", out->usecase);
}
if (out->flags & AUDIO_OUTPUT_FLAG_FAST) {
ALOGD("%s: Setting latency mode to true", __func__);
out->compr_config.codec->flags |= audio_extn_utils_get_perf_mode_flag();
}
if (out->usecase == USECASE_INVALID) {
if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL &&
config->format == 0 && config->sample_rate == 0 &&
@ -8729,6 +8734,8 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
}
if (config->sample_rate == LOW_LATENCY_CAPTURE_SAMPLE_RATE &&
(flags & AUDIO_INPUT_FLAG_TIMESTAMP) == 0 &&
(flags & AUDIO_INPUT_FLAG_COMPRESS) == 0 &&
(flags & AUDIO_INPUT_FLAG_FAST) != 0) {
is_low_latency = true;
#if LOW_LATENCY_CAPTURE_USE_CASE