blob: 07f84f535190af2d6322577afbcecffed3936d64 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/media/audio/audio_core/pipeline_config.h"
namespace media::audio {
uint16_t PipelineConfig::channels() const {
// The bottommost effect that defines output_channels will define our channelization.
for (auto it = root_.effects.rbegin(); it != root_.effects.rend(); ++it) {
if (it->output_channels) {
return *it->output_channels;
}
}
// If no effect performs rechannelization, then our channelization is determined by the mix stage
// itself.
return root_.output_channels;
}
} // namespace media::audio