Reland "Remove CodecInst pt.1"
This is a reland of 056f9738bf7a3d16da45398239656e165c4e0851 Original change's description: > Remove CodecInst pt.1 > > Update audio_coding tests to not use CodecInst. > > Bug: webrtc:7626 > Change-Id: I880fb8d72d7d0a915d274e67feb6106f023697c2 > Reviewed-on: https://webrtc-review.googlesource.com/c/112594 > Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#25879} Bug: webrtc:7626 Change-Id: I5d6ca0baf6230bfe9bf95c2c25496d2a56812d90 Reviewed-on: https://webrtc-review.googlesource.com/c/112942 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25902}
This commit is contained in:
committed by
Commit Bot
parent
5b1477839d
commit
657b296ff5
@ -16,15 +16,9 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#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/test/PCMFile.h"
|
||||
#include "modules/audio_coding/test/utility.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
@ -65,25 +59,26 @@ void TwoWayCommunication::SetUpAutotest(
|
||||
const int payload_type1,
|
||||
const SdpAudioFormat& format2,
|
||||
const int payload_type2) {
|
||||
|
||||
//--- Set A codecs
|
||||
_acmA->SetEncoder(
|
||||
encoder_factory->MakeAudioEncoder(payload_type1, format1, absl::nullopt));
|
||||
EXPECT_EQ(true, _acmA->RegisterReceiveCodec(payload_type2, format2));
|
||||
_acmA->SetReceiveCodecs({{payload_type2, format2}});
|
||||
|
||||
//--- Set ref-A codecs
|
||||
_acmRefA->SetEncoder(
|
||||
encoder_factory->MakeAudioEncoder(payload_type1, format1, absl::nullopt));
|
||||
EXPECT_EQ(true, _acmRefA->RegisterReceiveCodec(payload_type2, format2));
|
||||
_acmRefA->SetReceiveCodecs({{payload_type2, format2}});
|
||||
|
||||
//--- Set B codecs
|
||||
_acmB->SetEncoder(
|
||||
encoder_factory->MakeAudioEncoder(payload_type2, format2, absl::nullopt));
|
||||
EXPECT_EQ(true, _acmB->RegisterReceiveCodec(payload_type1, format1));
|
||||
_acmB->SetReceiveCodecs({{payload_type1, format1}});
|
||||
|
||||
//--- Set ref-B codecs
|
||||
_acmRefB->SetEncoder(
|
||||
encoder_factory->MakeAudioEncoder(payload_type2, format2, absl::nullopt));
|
||||
EXPECT_EQ(true, _acmRefB->RegisterReceiveCodec(payload_type1, format1));
|
||||
_acmRefB->SetReceiveCodecs({{payload_type1, format1}});
|
||||
|
||||
uint16_t frequencyHz;
|
||||
|
||||
@ -184,14 +179,13 @@ void TwoWayCommunication::Perform() {
|
||||
if (((secPassed % 5) == 4) && (msecPassed >= 990)) {
|
||||
_acmB->SetEncoder(encoder_factory->MakeAudioEncoder(
|
||||
payload_type2, format2, absl::nullopt));
|
||||
EXPECT_TRUE(_acmB->SendCodec());
|
||||
}
|
||||
// Initialize receiver on side A.
|
||||
if (((secPassed % 7) == 6) && (msecPassed == 0))
|
||||
EXPECT_EQ(0, _acmA->InitializeReceiver());
|
||||
// Re-register codec on side A.
|
||||
if (((secPassed % 7) == 6) && (msecPassed >= 990)) {
|
||||
EXPECT_EQ(true, _acmA->RegisterReceiveCodec(payload_type2, format2));
|
||||
_acmA->SetReceiveCodecs({{payload_type2, format2}});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user