GCC: Avoid symbol clash in RenderBuffer

GCC fails to resolve getter for RenderBuffer::Block() because
its return type has the same name with the getter method.
Rename getter method with the prefix "Get" as guided in the
https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/blink-c++.md#Precede-setters-with-the-word-Set_use-bare-words-for-getters
"If a getter’s name collides with a type name, prefix it with “Get”."

Bug: chromium:819294, webrtc:14089
Change-Id: Ieaa3af27415eb8c39806aa8480897b47fd07baa8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263420
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36982}
This commit is contained in:
Ivan Murashov 2022-05-24 10:49:50 +03:00 committed by WebRTC LUCI CQ
parent 794c54faf0
commit 1e8bb67295
7 changed files with 7 additions and 6 deletions

View file

@ -138,6 +138,7 @@ Google Inc. <*@google.com>
Highfive, Inc. <*@highfive.com>
HyperConnect Inc. <*@hpcnt.com>
Intel Corporation <*@intel.com>
LG Electronics, Inc. <*@lge.com>
Life On Air Inc. <*@lifeonair.com>
Microsoft Corporation <*@microsoft.com>
MIPS Technologies <*@mips.com>

View file

@ -207,7 +207,7 @@ void AecState::Update(
}
const Block& aligned_render_block =
render_buffer.Block(-delay_state_.MinDirectPathFilterDelay());
render_buffer.GetBlock(-delay_state_.MinDirectPathFilterDelay());
// Update render counters.
bool active_render = false;

View file

@ -321,7 +321,7 @@ TEST(BlockProcessor, ExternalDelayAppliedCorrectlyWithInitialCaptureCalls) {
const absl::optional<DelayEstimate>& /*external_delay*/,
RenderBuffer* render_buffer, Block* /*linear_output*/,
Block* capture) {
const auto& render = render_buffer->Block(0);
const auto& render = render_buffer->GetBlock(0);
const auto render_view = render.View(/*band=*/0, /*channel=*/0);
const auto capture_view = capture->View(/*band=*/0, /*channel=*/0);
for (size_t i = 0; i < kBlockSize; ++i) {

View file

@ -245,7 +245,7 @@ void EchoRemoverImpl::ProcessCapture(
Block* linear_output,
Block* capture) {
++block_counter_;
const Block& x = render_buffer->Block(0);
const Block& x = render_buffer->GetBlock(0);
Block* y = capture;
RTC_DCHECK(render_buffer);
RTC_DCHECK(y);

View file

@ -131,7 +131,7 @@ void FilterAnalyzer::AnalyzeRegion(
st_ch.consistent_estimate = st_ch.consistent_filter_detector.Detect(
h_highpass_[ch], region_,
render_buffer.Block(-filter_delays_blocks_[ch]), st_ch.peak_index,
render_buffer.GetBlock(-filter_delays_blocks_[ch]), st_ch.peak_index,
filter_delays_blocks_[ch]);
}
}

View file

@ -40,7 +40,7 @@ class RenderBuffer {
~RenderBuffer();
// Get a block.
const Block& Block(int buffer_offset_blocks) const {
const Block& GetBlock(int buffer_offset_blocks) const {
int position =
block_buffer_->OffsetIndex(block_buffer_->read, buffer_offset_blocks);
return block_buffer_->buffer[position];

View file

@ -66,7 +66,7 @@ void IdentifyStrongNarrowBandComponent(const RenderBuffer& render_buffer,
*narrow_peak_band = absl::nullopt;
}
const Block& x_latest = render_buffer.Block(0);
const Block& x_latest = render_buffer.GetBlock(0);
float max_peak_level = 0.f;
for (int channel = 0; channel < x_latest.NumChannels(); ++channel) {
rtc::ArrayView<const float, kFftLengthBy2Plus1> X2_latest =