Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc

Issue 1899733002: NetEq: Simplify DecoderDatabase::DecoderInfo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
diff --git a/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc b/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
index b1cb45d2014299ce0a2c5c1fbd10c35c0cd573c5..144a19db5871c22bbbf2beb4b3819fc9b66d9266 100644
--- a/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
@@ -23,9 +23,9 @@ namespace webrtc {
TEST(TimestampScaler, TestNoScaling) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info;
- info.codec_type =
- NetEqDecoder::kDecoderPCMu; // Does not use scaled timestamps.
+ // Use PCMu, because it doesn't use scaled timestamps.
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "", 8000,
+ nullptr);
static const uint8_t kRtpPayloadType = 0;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -44,9 +44,9 @@ TEST(TimestampScaler, TestNoScaling) {
TEST(TimestampScaler, TestNoScalingLargeStep) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info;
- info.codec_type =
- NetEqDecoder::kDecoderPCMu; // Does not use scaled timestamps.
+ // Use PCMu, because it doesn't use scaled timestamps.
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "", 8000,
+ nullptr);
static const uint8_t kRtpPayloadType = 0;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -70,8 +70,9 @@ TEST(TimestampScaler, TestNoScalingLargeStep) {
TEST(TimestampScaler, TestG722) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info;
- info.codec_type = NetEqDecoder::kDecoderG722; // Uses a factor 2 scaling.
+ // Use G722, which has a factor 2 scaling.
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "", 8000,
hlundin-webrtc 2016/04/19 06:47:00 FYI: This is the typical place where setting an rt
kwiberg-webrtc 2016/04/19 08:57:30 Yes. But when we start using a decoder factory tha
hlundin-webrtc 2016/04/19 09:31:30 Acknowledged.
+ nullptr);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -94,8 +95,9 @@ TEST(TimestampScaler, TestG722) {
TEST(TimestampScaler, TestG722LargeStep) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info;
- info.codec_type = NetEqDecoder::kDecoderG722; // Uses a factor 2 scaling.
+ // Use G722, which has a factor 2 scaling.
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "", 8000,
+ nullptr);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -122,10 +124,11 @@ TEST(TimestampScaler, TestG722LargeStep) {
TEST(TimestampScaler, TestG722WithCng) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info_g722, info_cng;
- info_g722.codec_type =
- NetEqDecoder::kDecoderG722; // Uses a factor 2 scaling.
- info_cng.codec_type = NetEqDecoder::kDecoderCNGwb;
+ // Use G722, which has a factor 2 scaling.
+ const DecoderDatabase::DecoderInfo info_g722(NetEqDecoder::kDecoderG722, "",
+ 8000, nullptr);
hlundin-webrtc 2016/04/19 06:47:00 Hmmm, what does 8000 represent here? Sample rate o
kwiberg-webrtc 2016/04/19 08:57:31 I guess... but I don't know if the current state o
hlundin-webrtc 2016/04/19 09:31:30 Acknowledged.
+ const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGwb, "",
+ 8000, nullptr);
hlundin-webrtc 2016/04/19 06:46:59 This is where things get messy with the current de
kwiberg-webrtc 2016/04/19 08:57:31 The design for audio decoder (and encoder) factori
static const uint8_t kRtpPayloadTypeG722 = 17;
static const uint8_t kRtpPayloadTypeCng = 13;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadTypeG722))
@@ -164,9 +167,9 @@ TEST(TimestampScaler, TestG722WithCng) {
// as many tests here.
TEST(TimestampScaler, TestG722Packet) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info;
- info.codec_type =
- NetEqDecoder::kDecoderG722; // Does uses a factor 2 scaling.
+ // Use G722, which has a factor 2 scaling.
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "", 8000,
hlundin-webrtc 2016/04/19 06:46:59 16000
kwiberg-webrtc 2016/04/19 08:57:31 Done. (I updated all these Herzes to match the act
+ nullptr);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -193,8 +196,9 @@ TEST(TimestampScaler, TestG722Packet) {
// we are not doing as many tests here.
TEST(TimestampScaler, TestG722PacketList) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info;
- info.codec_type = NetEqDecoder::kDecoderG722; // Uses a factor 2 scaling.
+ // Use G722, which has a factor 2 scaling.
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "", 8000,
hlundin-webrtc 2016/04/19 06:47:00 16000
kwiberg-webrtc 2016/04/19 08:57:31 Done.
+ nullptr);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -222,8 +226,9 @@ TEST(TimestampScaler, TestG722PacketList) {
TEST(TimestampScaler, TestG722Reset) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info;
- info.codec_type = NetEqDecoder::kDecoderG722; // Uses a factor 2 scaling.
+ // Use G722, which has a factor 2 scaling.
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "", 8000,
hlundin-webrtc 2016/04/19 06:46:59 16000
kwiberg-webrtc 2016/04/19 08:57:31 Done.
+ nullptr);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -262,8 +267,8 @@ TEST(TimestampScaler, TestG722Reset) {
// timestamp scaler.
TEST(TimestampScaler, TestOpusLargeStep) {
MockDecoderDatabase db;
- DecoderDatabase::DecoderInfo info;
- info.codec_type = NetEqDecoder::kDecoderOpus;
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderOpus, "", 8000,
hlundin-webrtc 2016/04/19 06:47:00 48000 for Opus.
kwiberg-webrtc 2016/04/19 08:57:30 Done.
+ nullptr);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));

Powered by Google App Engine
This is Rietveld 408576698