mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Audio : Fix minor comments in r_submix module
Add missing check for StandbyTransition variable Add missing & in const arguments Bug: 286914845 Test: atest VtsHalAudioCoreTargetTest Change-Id: Id7a30e0697da80a272768bbf2aa8e3ed748e93f4
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user