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

Commit 73d4d4c3 authored by Shraddha Basantwani's avatar Shraddha Basantwani Committed by Automerger Merge Worker
Browse files

Audio : Fix minor comments in r_submix module am: 7770c158 am: f0506fad...

Audio : Fix minor comments in r_submix module am: 7770c158 am: f0506fad am: 41d85448 am: 2d057fc8

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2664716



Change-Id: I263bf7aee2558246fc81e105da1f570bf69afc8f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6d81089d 2d057fc8
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ using aidl::android::hardware::audio::common::getChannelCount;
namespace aidl::android::hardware::audio::core::r_submix {

// Verify a submix input or output stream can be opened.
bool SubmixRoute::isStreamConfigValid(bool isInput, const AudioConfig streamConfig) {
bool SubmixRoute::isStreamConfigValid(bool isInput, const AudioConfig& streamConfig) {
    // If the stream is already open, don't open it again.
    // ENABLE_LEGACY_INPUT_OPEN is default behaviour
    if (!isInput && isStreamOutOpen()) {
@@ -43,7 +43,7 @@ bool SubmixRoute::isStreamConfigValid(bool isInput, const AudioConfig streamConf

// Compare this stream config with existing pipe config, returning false if they do *not*
// match, true otherwise.
bool SubmixRoute::isStreamConfigCompatible(const AudioConfig streamConfig) {
bool SubmixRoute::isStreamConfigCompatible(const AudioConfig& streamConfig) {
    if (streamConfig.channelLayout != mPipeConfig.channelLayout) {
        LOG(ERROR) << __func__ << ": channel count mismatch, stream channels = "
                   << streamConfig.channelLayout.toString()
@@ -126,7 +126,7 @@ void SubmixRoute::closeStream(bool isInput) {

// If SubmixRoute doesn't exist for a port, create a pipe for the submix audio device of size
// buffer_size_frames and store config of the submix audio device.
::android::status_t SubmixRoute::createPipe(const AudioConfig streamConfig) {
::android::status_t SubmixRoute::createPipe(const AudioConfig& streamConfig) {
    const int channelCount = getChannelCount(streamConfig.channelLayout);
    const audio_format_t audioFormat = VALUE_OR_RETURN_STATUS(
            aidl2legacy_AudioFormatDescription_audio_format_t(streamConfig.format));
@@ -201,9 +201,9 @@ void SubmixRoute::standby(bool isInput) {

    if (isInput) {
        mStreamInStandby = true;
    } else {
    } else if (!mStreamOutStandby) {
        mStreamOutStandby = true;
        mStreamOutStandbyTransition = !mStreamOutStandbyTransition;
        mStreamOutStandbyTransition = true;
    }
}

+3 −3
Original line number Diff line number Diff line
@@ -93,9 +93,9 @@ class SubmixRoute {
        return mSource;
    }

    bool isStreamConfigValid(bool isInput, const AudioConfig streamConfig);
    bool isStreamConfigValid(bool isInput, const AudioConfig& streamConfig);
    void closeStream(bool isInput);
    ::android::status_t createPipe(const AudioConfig streamConfig);
    ::android::status_t createPipe(const AudioConfig& streamConfig);
    void exitStandby(bool isInput);
    bool hasAtleastOneStreamOpen();
    int notifyReadError();
@@ -107,7 +107,7 @@ class SubmixRoute {
    long updateReadCounterFrames(size_t frameCount);

  private:
    bool isStreamConfigCompatible(const AudioConfig streamConfig);
    bool isStreamConfigCompatible(const AudioConfig& streamConfig);

    std::mutex mLock;