NetEq: Implement muted output
This CL implements the muted output functionality in NetEq. Tests are added. The feature is currently off by default, and AcmReceiver makes sure that the muted state is not engaged. BUG=webrtc:5608 Review-Url: https://codereview.webrtc.org/1965733002 Cr-Commit-Position: refs/heads/master@{#12711}
This commit is contained in:
committed by
Commit bot
parent
53f7adad08
commit
7a926812d8
@ -45,7 +45,9 @@ void NetEqExternalDecoderTest::InsertPacket(
|
||||
|
||||
void NetEqExternalDecoderTest::GetOutputAudio(AudioFrame* output) {
|
||||
// Get audio from regular instance.
|
||||
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(output));
|
||||
bool muted;
|
||||
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(output, &muted));
|
||||
ASSERT_FALSE(muted);
|
||||
EXPECT_EQ(channels_, output->num_channels_);
|
||||
EXPECT_EQ(static_cast<size_t>(kOutputLengthMs * sample_rate_hz_ / 1000),
|
||||
output->samples_per_channel_);
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/neteq_performance_test.h"
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/include/neteq.h"
|
||||
#include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h"
|
||||
@ -105,7 +106,9 @@ int64_t NetEqPerformanceTest::Run(int runtime_ms,
|
||||
}
|
||||
|
||||
// Get output audio, but don't do anything with it.
|
||||
int error = neteq->GetAudio(&out_frame);
|
||||
bool muted;
|
||||
int error = neteq->GetAudio(&out_frame, &muted);
|
||||
RTC_CHECK(!muted);
|
||||
if (error != NetEq::kOK)
|
||||
return -1;
|
||||
|
||||
|
||||
@ -391,7 +391,9 @@ int NetEqQualityTest::Transmit() {
|
||||
}
|
||||
|
||||
int NetEqQualityTest::DecodeBlock() {
|
||||
int ret = neteq_->GetAudio(&out_frame_);
|
||||
bool muted;
|
||||
int ret = neteq_->GetAudio(&out_frame_, &muted);
|
||||
RTC_CHECK(!muted);
|
||||
|
||||
if (ret != NetEq::kOK) {
|
||||
return -1;
|
||||
|
||||
@ -605,7 +605,9 @@ int main(int argc, char* argv[]) {
|
||||
// Check if it is time to get output audio.
|
||||
while (time_now_ms >= next_output_time_ms && output_event_available) {
|
||||
webrtc::AudioFrame out_frame;
|
||||
int error = neteq->GetAudio(&out_frame);
|
||||
bool muted;
|
||||
int error = neteq->GetAudio(&out_frame, &muted);
|
||||
RTC_CHECK(!muted);
|
||||
if (error != NetEq::kOK) {
|
||||
std::cerr << "GetAudio returned error code " <<
|
||||
neteq->LastError() << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user