Loading media/libaaudio/src/core/AAudioStreamParameters.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,7 @@ using namespace aaudio; // TODO These defines should be moved to a central place in audio. #define SAMPLES_PER_FRAME_MIN 1 // TODO Remove 8 channel limitation. #define SAMPLES_PER_FRAME_MAX FCC_8 #define SAMPLES_PER_FRAME_MAX FCC_LIMIT #define SAMPLE_RATE_HZ_MIN 8000 // HDMI supports up to 32 channels at 1536000 Hz. #define SAMPLE_RATE_HZ_MAX 1600000 Loading media/libaaudio/src/core/AudioStreamBuilder.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,7 @@ using namespace aaudio; // on the edge of being ridiculous. // TODO These defines should be moved to a central place in audio. #define SAMPLES_PER_FRAME_MIN 1 // TODO Remove 8 channel limitation. #define SAMPLES_PER_FRAME_MAX FCC_8 #define SAMPLES_PER_FRAME_MAX FCC_LIMIT #define SAMPLE_RATE_HZ_MIN 8000 // HDMI supports up to 32 channels at 1536000 Hz. #define SAMPLE_RATE_HZ_MAX 1600000 Loading media/libaudioprocessing/AudioMixerOps.h +3 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ #ifndef ANDROID_AUDIO_MIXER_OPS_H #define ANDROID_AUDIO_MIXER_OPS_H #include <system/audio.h> namespace android { // Hack to make static_assert work in a constexpr Loading Loading @@ -231,7 +233,7 @@ template <int MIXTYPE, int NCHAN, typename TO, typename TI, typename TV, typename F> void stereoVolumeHelper(TO*& out, const TI*& in, const TV *vol, F f) { static_assert(NCHAN > 0 && NCHAN <= 8); static_assert(NCHAN > 0 && NCHAN <= FCC_LIMIT); static_assert(MIXTYPE == MIXTYPE_MULTI_STEREOVOL || MIXTYPE == MIXTYPE_MULTI_SAVEONLY_STEREOVOL || MIXTYPE == MIXTYPE_STEREOEXPAND Loading media/libaudioprocessing/AudioResampler.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ AudioResampler::AudioResampler(int inChannelCount, mPhaseFraction(0), mQuality(quality) { const int maxChannels = quality < DYN_LOW_QUALITY ? 2 : 8; const int maxChannels = quality < DYN_LOW_QUALITY ? FCC_2 : FCC_LIMIT; if (inChannelCount < 1 || inChannelCount > maxChannels) { LOG_ALWAYS_FATAL("Unsupported sample format %d quality %d channels", Loading media/libaudioprocessing/AudioResamplerDyn.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -545,8 +545,8 @@ void AudioResamplerDyn<TC, TI, TO>::setSampleRate(int32_t inSampleRate) // Note: A stride of 2 is achieved with non-SIMD processing. int stride = ((c.mHalfNumCoefs & 7) == 0) ? 16 : 2; LOG_ALWAYS_FATAL_IF(stride < 16, "Resampler stride must be 16 or more"); LOG_ALWAYS_FATAL_IF(mChannelCount < 1 || mChannelCount > 8, "Resampler channels(%d) must be between 1 to 8", mChannelCount); LOG_ALWAYS_FATAL_IF(mChannelCount < 1 || mChannelCount > FCC_LIMIT, "Resampler channels(%d) must be between 1 to %d", mChannelCount, FCC_LIMIT); // stride 16 (falls back to stride 2 for machines that do not support NEON) if (locked) { switch (mChannelCount) { Loading Loading
media/libaaudio/src/core/AAudioStreamParameters.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,7 @@ using namespace aaudio; // TODO These defines should be moved to a central place in audio. #define SAMPLES_PER_FRAME_MIN 1 // TODO Remove 8 channel limitation. #define SAMPLES_PER_FRAME_MAX FCC_8 #define SAMPLES_PER_FRAME_MAX FCC_LIMIT #define SAMPLE_RATE_HZ_MIN 8000 // HDMI supports up to 32 channels at 1536000 Hz. #define SAMPLE_RATE_HZ_MAX 1600000 Loading
media/libaaudio/src/core/AudioStreamBuilder.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,7 @@ using namespace aaudio; // on the edge of being ridiculous. // TODO These defines should be moved to a central place in audio. #define SAMPLES_PER_FRAME_MIN 1 // TODO Remove 8 channel limitation. #define SAMPLES_PER_FRAME_MAX FCC_8 #define SAMPLES_PER_FRAME_MAX FCC_LIMIT #define SAMPLE_RATE_HZ_MIN 8000 // HDMI supports up to 32 channels at 1536000 Hz. #define SAMPLE_RATE_HZ_MAX 1600000 Loading
media/libaudioprocessing/AudioMixerOps.h +3 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ #ifndef ANDROID_AUDIO_MIXER_OPS_H #define ANDROID_AUDIO_MIXER_OPS_H #include <system/audio.h> namespace android { // Hack to make static_assert work in a constexpr Loading Loading @@ -231,7 +233,7 @@ template <int MIXTYPE, int NCHAN, typename TO, typename TI, typename TV, typename F> void stereoVolumeHelper(TO*& out, const TI*& in, const TV *vol, F f) { static_assert(NCHAN > 0 && NCHAN <= 8); static_assert(NCHAN > 0 && NCHAN <= FCC_LIMIT); static_assert(MIXTYPE == MIXTYPE_MULTI_STEREOVOL || MIXTYPE == MIXTYPE_MULTI_SAVEONLY_STEREOVOL || MIXTYPE == MIXTYPE_STEREOEXPAND Loading
media/libaudioprocessing/AudioResampler.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ AudioResampler::AudioResampler(int inChannelCount, mPhaseFraction(0), mQuality(quality) { const int maxChannels = quality < DYN_LOW_QUALITY ? 2 : 8; const int maxChannels = quality < DYN_LOW_QUALITY ? FCC_2 : FCC_LIMIT; if (inChannelCount < 1 || inChannelCount > maxChannels) { LOG_ALWAYS_FATAL("Unsupported sample format %d quality %d channels", Loading
media/libaudioprocessing/AudioResamplerDyn.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -545,8 +545,8 @@ void AudioResamplerDyn<TC, TI, TO>::setSampleRate(int32_t inSampleRate) // Note: A stride of 2 is achieved with non-SIMD processing. int stride = ((c.mHalfNumCoefs & 7) == 0) ? 16 : 2; LOG_ALWAYS_FATAL_IF(stride < 16, "Resampler stride must be 16 or more"); LOG_ALWAYS_FATAL_IF(mChannelCount < 1 || mChannelCount > 8, "Resampler channels(%d) must be between 1 to 8", mChannelCount); LOG_ALWAYS_FATAL_IF(mChannelCount < 1 || mChannelCount > FCC_LIMIT, "Resampler channels(%d) must be between 1 to %d", mChannelCount, FCC_LIMIT); // stride 16 (falls back to stride 2 for machines that do not support NEON) if (locked) { switch (mChannelCount) { Loading