AudioCodingModuleTest.TestAllCodecs: Create audio encoders the new way
Specifically, don't expect the ACM to be able to create encoders; we have to give it an encoder that we make ourselves. To make it work, I had to add support for the "ptime" parameter to the L16 codec. Bug: webrtc:8396 Change-Id: I3869422882611d2eed65d6c849ea7cd3ad6bd126 Reviewed-on: https://webrtc-review.googlesource.com/87423 Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Commit-Queue: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24217}
This commit is contained in:
@ -15,12 +15,14 @@
|
||||
#include <string>
|
||||
|
||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "modules/audio_coding/codecs/audio_format_conversion.h"
|
||||
#include "modules/audio_coding/include/audio_coding_module.h"
|
||||
#include "modules/audio_coding/include/audio_coding_module_typedefs.h"
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/stringencode.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
@ -405,7 +407,14 @@ void TestAllCodecs::RegisterSendCodec(char side,
|
||||
sampling_freq_hz, 1));
|
||||
my_codec_param.rate = rate;
|
||||
my_codec_param.pacsize = packet_size;
|
||||
CHECK_ERROR(my_acm->RegisterSendCodec(my_codec_param));
|
||||
|
||||
auto factory = CreateBuiltinAudioEncoderFactory();
|
||||
constexpr int payload_type = 17;
|
||||
SdpAudioFormat format = CodecInstToSdp(my_codec_param);
|
||||
format.parameters["ptime"] = rtc::ToString(rtc::CheckedDivExact(
|
||||
packet_size, rtc::CheckedDivExact(sampling_freq_hz, 1000)));
|
||||
my_acm->SetEncoder(
|
||||
factory->MakeAudioEncoder(payload_type, format, absl::nullopt));
|
||||
}
|
||||
|
||||
void TestAllCodecs::Run(TestPack* channel) {
|
||||
|
||||
Reference in New Issue
Block a user