Pass a real audio codec pair ID to decoders that we create
Bug: webrtc:8941 Change-Id: Ic2aed2ca759eb378164f3f65465e23fd7c13a9f8 Reviewed-on: https://webrtc-review.googlesource.com/63261 Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Commit-Queue: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22538}
This commit is contained in:
@ -28,7 +28,8 @@ using testing::Invoke;
|
||||
namespace webrtc {
|
||||
|
||||
TEST(DecoderDatabase, CreateAndDestroy) {
|
||||
DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
|
||||
DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>,
|
||||
rtc::nullopt);
|
||||
EXPECT_EQ(0, db.Size());
|
||||
EXPECT_TRUE(db.Empty());
|
||||
}
|
||||
@ -41,7 +42,7 @@ TEST(DecoderDatabase, InsertAndRemove) {
|
||||
EXPECT_EQ("pcmu", format.name);
|
||||
return true;
|
||||
}));
|
||||
DecoderDatabase db(factory);
|
||||
DecoderDatabase db(factory, rtc::nullopt);
|
||||
const uint8_t kPayloadType = 0;
|
||||
const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
||||
EXPECT_EQ(
|
||||
@ -66,7 +67,7 @@ TEST(DecoderDatabase, InsertAndRemoveAll) {
|
||||
EXPECT_EQ("pcma", format.name);
|
||||
return true;
|
||||
}));
|
||||
DecoderDatabase db(factory);
|
||||
DecoderDatabase db(factory, rtc::nullopt);
|
||||
const std::string kCodecName1 = "Robert\'); DROP TABLE Students;";
|
||||
const std::string kCodecName2 = "https://xkcd.com/327/";
|
||||
EXPECT_EQ(DecoderDatabase::kOK,
|
||||
@ -96,7 +97,7 @@ TEST(DecoderDatabase, GetDecoderInfo) {
|
||||
EXPECT_EQ("pcmu", format.name);
|
||||
dec->reset(decoder);
|
||||
}));
|
||||
DecoderDatabase db(factory);
|
||||
DecoderDatabase db(factory, rtc::nullopt);
|
||||
const uint8_t kPayloadType = 0;
|
||||
const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
||||
EXPECT_EQ(
|
||||
@ -113,7 +114,7 @@ TEST(DecoderDatabase, GetDecoderInfo) {
|
||||
}
|
||||
|
||||
TEST(DecoderDatabase, GetDecoder) {
|
||||
DecoderDatabase db(CreateBuiltinAudioDecoderFactory());
|
||||
DecoderDatabase db(CreateBuiltinAudioDecoderFactory(), rtc::nullopt);
|
||||
const uint8_t kPayloadType = 0;
|
||||
const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
||||
EXPECT_EQ(DecoderDatabase::kOK,
|
||||
@ -131,7 +132,7 @@ TEST(DecoderDatabase, TypeTests) {
|
||||
EXPECT_EQ("pcmu", format.name);
|
||||
return true;
|
||||
}));
|
||||
DecoderDatabase db(factory);
|
||||
DecoderDatabase db(factory, rtc::nullopt);
|
||||
const uint8_t kPayloadTypePcmU = 0;
|
||||
const uint8_t kPayloadTypeCng = 13;
|
||||
const uint8_t kPayloadTypeDtmf = 100;
|
||||
@ -166,7 +167,8 @@ TEST(DecoderDatabase, TypeTests) {
|
||||
}
|
||||
|
||||
TEST(DecoderDatabase, ExternalDecoder) {
|
||||
DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>);
|
||||
DecoderDatabase db(new rtc::RefCountedObject<MockAudioDecoderFactory>,
|
||||
rtc::nullopt);
|
||||
const uint8_t kPayloadType = 0;
|
||||
const std::string kCodecName = "Robert\'); DROP TABLE Students;";
|
||||
MockAudioDecoder decoder;
|
||||
@ -203,7 +205,7 @@ TEST(DecoderDatabase, CheckPayloadTypes) {
|
||||
EXPECT_EQ("pcmu", format.name);
|
||||
return true;
|
||||
}));
|
||||
DecoderDatabase db(factory);
|
||||
DecoderDatabase db(factory, rtc::nullopt);
|
||||
// Load a number of payloads into the database. Payload types are 0, 1, ...,
|
||||
// while the decoder type is the same for all payload types (this does not
|
||||
// matter for the test).
|
||||
@ -243,7 +245,7 @@ TEST(DecoderDatabase, CheckPayloadTypes) {
|
||||
|
||||
// Test the methods for setting and getting active speech and CNG decoders.
|
||||
TEST(DecoderDatabase, IF_ISAC(ActiveDecoders)) {
|
||||
DecoderDatabase db(CreateBuiltinAudioDecoderFactory());
|
||||
DecoderDatabase db(CreateBuiltinAudioDecoderFactory(), rtc::nullopt);
|
||||
// Load payload types.
|
||||
ASSERT_EQ(DecoderDatabase::kOK,
|
||||
db.RegisterPayload(0, NetEqDecoder::kDecoderPCMu, "pcmu"));
|
||||
|
Reference in New Issue
Block a user