Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 4354686

Browse files
Ivo CreusenCommit Bot
authored andcommitted
Notify NetEqController during muted state.
During muted state NetEq shortcircuits a large part of the internals to quickly return a buffer filled with zeros. It can be beneficial for the controller to be aware that it is in muted state. Bug: webrtc:11005 Change-Id: I5fe24b4a3704d953cbd68b5a24bbb7ef58b30be0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186760 Commit-Queue: Ivo Creusen <[email protected]> Reviewed-by: Jakob Ivarsson <[email protected]> Cr-Commit-Position: refs/heads/master@{#32330}
1 parent b1ae5cc commit 4354686

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

api/neteq/neteq_controller.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ class NetEqController {
163163
uint32_t main_timestamp,
164164
int fs_hz) = 0;
165165

166+
// Notify the NetEqController that we are currently in muted state.
167+
// TODO(ivoc): Make pure virtual when downstream is updated.
168+
virtual void NotifyMutedState() {}
169+
166170
// Returns true if a peak was found.
167171
virtual bool PeakFound() const = 0;
168172

modules/audio_coding/neteq/decision_logic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class DecisionLogic : public NetEqController {
8484

8585
void RegisterEmptyPacket() override { delay_manager_->RegisterEmptyPacket(); }
8686

87+
void NotifyMutedState() override {}
88+
8789
bool SetMaximumDelay(int delay_ms) override {
8890
return delay_manager_->SetMaximumDelay(delay_ms);
8991
}

modules/audio_coding/neteq/neteq_impl.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,7 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame,
857857
static_cast<uint32_t>(audio_frame->samples_per_channel_);
858858
audio_frame->num_channels_ = sync_buffer_->Channels();
859859
stats_->ExpandedNoiseSamples(output_size_samples_, false);
860+
controller_->NotifyMutedState();
860861
*muted = true;
861862
return 0;
862863
}

0 commit comments

Comments
 (0)