Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 882890f5 authored by Mingming Yin's avatar Mingming Yin Committed by Gerrit - the friendly Code Review server
Browse files

hal: expose offload functions only for offload playback

- Expose compress offload related functions only when
  AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD is set.
- Do not use them for direct PCM format to avoid unnecessary
  calls to compress driver.

CRs-Fixed: 913925
Change-Id: I8f93b1c697794e686d19c6c78823a095333b5369
parent 23e4fc37
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2958,6 +2958,12 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        } else {
            ALOGV("%s:: inserting OFFLOAD_USECASE", __func__);
            out->usecase = get_offload_usecase(adev);

            out->stream.set_callback = out_set_callback;
            out->stream.pause = out_pause;
            out->stream.resume = out_resume;
            out->stream.drain = out_drain;
            out->stream.flush = out_flush;
        }
        if (config->offload_info.channel_mask)
            out->channel_mask = config->offload_info.channel_mask;
@@ -2968,11 +2974,6 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        format = out->format = config->offload_info.format;
        out->sample_rate = config->offload_info.sample_rate;

        out->stream.set_callback = out_set_callback;
        out->stream.pause = out_pause;
        out->stream.resume = out_resume;
        out->stream.drain = out_drain;
        out->stream.flush = out_flush;
        out->bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;

        if (audio_extn_is_dolby_format(config->offload_info.format))