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

Commit 9cea7ae8 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "Allow getInputBufferSize for compressed formats" into main am:...

Merge "Allow getInputBufferSize for compressed formats" into main am: 2b558d80 am: 997e5ee8 am: 928e98d8

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2833490



Change-Id: I220152d9541ef2922f77edf98a778cfdce838e7d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f5fad647 928e98d8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1897,7 +1897,7 @@ size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t form
        return 0;
    }
    if ((sampleRate == 0) ||
            !audio_is_valid_format(format) || !audio_has_proportional_frames(format) ||
            !audio_is_valid_format(format) ||
            !audio_is_input_channel(channelMask)) {
        return 0;
    }
@@ -1920,6 +1920,10 @@ size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t form

    std::vector<audio_format_t> formats = {format};
    if (format != AUDIO_FORMAT_PCM_16_BIT) {
        // For compressed format, buffer size may be queried using PCM. Allow this for compatibility
        // in cases the primary hw dev does not support the format.
        // TODO: replace with a table of formats and nominal buffer sizes (based on nominal bitrate
        // and codec frame size).
        formats.push_back(AUDIO_FORMAT_PCM_16_BIT);
    }