NetEq: Simplify DecoderDatabase::DecoderInfo
By eliminating one of the two constructors, handling decoder ownership with a unique_ptr instead of a raw pointer, and making all member variables const (except one, which is made private instead). BUG=webrtc:5801 Review URL: https://codereview.webrtc.org/1899733002 Cr-Commit-Position: refs/heads/master@{#12425}
This commit is contained in:
@ -53,10 +53,9 @@ TEST(DecoderDatabase, GetDecoderInfo) {
|
||||
info = db.GetDecoderInfo(kPayloadType);
|
||||
ASSERT_TRUE(info != NULL);
|
||||
EXPECT_EQ(NetEqDecoder::kDecoderPCMu, info->codec_type);
|
||||
EXPECT_EQ(NULL, info->decoder);
|
||||
EXPECT_EQ(nullptr, info->external_decoder);
|
||||
EXPECT_EQ(8000, info->fs_hz);
|
||||
EXPECT_EQ(kCodecName, info->name);
|
||||
EXPECT_FALSE(info->external);
|
||||
info = db.GetDecoderInfo(kPayloadType + 1); // Other payload type.
|
||||
EXPECT_TRUE(info == NULL); // Should not be found.
|
||||
}
|
||||
@ -139,9 +138,8 @@ TEST(DecoderDatabase, ExternalDecoder) {
|
||||
ASSERT_TRUE(info != NULL);
|
||||
EXPECT_EQ(NetEqDecoder::kDecoderPCMu, info->codec_type);
|
||||
EXPECT_EQ(kCodecName, info->name);
|
||||
EXPECT_EQ(&decoder, info->decoder);
|
||||
EXPECT_EQ(&decoder, info->external_decoder);
|
||||
EXPECT_EQ(8000, info->fs_hz);
|
||||
EXPECT_TRUE(info->external);
|
||||
// Expect not to delete the decoder when removing it from the database, since
|
||||
// it was declared externally.
|
||||
EXPECT_CALL(decoder, Die()).Times(0);
|
||||
|
||||
Reference in New Issue
Block a user