Revert "Add AudioDecoderFactory to NetEqTest constructor."

This reverts commit daa970f33e1923c5651a4a63c18e3d5361d0a795.

Reason for revert: Speculative revert due to downstream breakage

Original change's description:
> Add AudioDecoderFactory to NetEqTest constructor.
>
> Update EventLogAnalyzer to not depend on builtin audio decoders.
>
> Bug: webrtc:8396, webrtc:10080
> Change-Id: Ie02ed9cda6d4f11bfdf2e65eb6482283b7520738
> Reviewed-on: https://webrtc-review.googlesource.com/c/114301
> Reviewed-by: Alex Loiko <aleloi@webrtc.org>
> Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26026}

TBR=mbonadei@webrtc.org,aleloi@webrtc.org,kwiberg@webrtc.org,terelius@webrtc.org,nisse@webrtc.org,ivoc@webrtc.org

No-Try: True
Bug: webrtc:8396, webrtc:10080
Change-Id: Ided750d8ed800d8a38f7cce8f72095d8ed1bc6cb
Reviewed-on: https://webrtc-review.googlesource.com/c/114552
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26030}
This commit is contained in:
Oleh Prypin
2018-12-17 15:02:25 +00:00
committed by Commit Bot
parent 74a99e7b74
commit f7f753b320
11 changed files with 38 additions and 54 deletions

View File

@ -57,7 +57,6 @@
#include "rtc_base/numerics/sequence_number_util.h"
#include "rtc_base/rate_statistics.h"
#include "rtc_base/strings/string_builder.h"
#include "test/function_audio_decoder_factory.h"
#ifndef BWE_TEST_LOGGING_COMPILE_TIME_ENABLE
#define BWE_TEST_LOGGING_COMPILE_TIME_ENABLE 0
@ -1711,23 +1710,20 @@ std::unique_ptr<test::NetEqStatsGetter> CreateNetEqTestAndRun(
std::unique_ptr<test::VoidAudioSink> output(new test::VoidAudioSink());
// Factory to create a "replacement decoder" that produces the decoded audio
// by reading from a file rather than from the encoded payloads.
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory =
new rtc::RefCountedObject<test::FunctionAudioDecoderFactory>(
[replacement_file_name, file_sample_rate_hz]() {
std::unique_ptr<test::ResampleInputAudioFile> replacement_file(
new test::ResampleInputAudioFile(replacement_file_name,
file_sample_rate_hz));
replacement_file->set_output_rate_hz(48000);
return absl::make_unique<test::FakeDecodeFromFile>(
std::move(replacement_file), 48000, false);
});
test::NetEqTest::DecoderMap codecs;
codecs[kReplacementPt] = {NetEqDecoder::kDecoderPCM16Bswb48kHz,
"replacement codec"};
// Create a "replacement decoder" that produces the decoded audio by reading
// from a file rather than from the encoded payloads.
std::unique_ptr<test::ResampleInputAudioFile> replacement_file(
new test::ResampleInputAudioFile(replacement_file_name,
file_sample_rate_hz));
replacement_file->set_output_rate_hz(48000);
std::unique_ptr<AudioDecoder> replacement_decoder(
new test::FakeDecodeFromFile(std::move(replacement_file), 48000, false));
test::NetEqTest::ExtDecoderMap ext_codecs;
ext_codecs[kReplacementPt] = {replacement_decoder.get(),
NetEqDecoder::kDecoderArbitrary,
"replacement codec"};
std::unique_ptr<test::NetEqDelayAnalyzer> delay_cb(
new test::NetEqDelayAnalyzer);
@ -1739,9 +1735,8 @@ std::unique_ptr<test::NetEqStatsGetter> CreateNetEqTestAndRun(
callbacks.post_insert_packet = neteq_stats_getter->delay_analyzer();
callbacks.get_audio_callback = neteq_stats_getter.get();
test::NetEqTest::ExtDecoderMap ext_codecs;
test::NetEqTest test(config, decoder_factory, codecs, ext_codecs, nullptr,
std::move(input), std::move(output), callbacks);
test::NetEqTest test(config, codecs, ext_codecs, nullptr, std::move(input),
std::move(output), callbacks);
test.Run();
return neteq_stats_getter;
}