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

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

Issue 2270063006: TimestampScaler no longer depends on NetEqDecoder to figure out scaling. (Closed)
Patch Set: Make sure the diffs are calculated properly as signed. Also use auto. Created 4 years, 4 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 91e1342c704079d85c41ad02205e2dfadb5c7ca3..1b8910ef641e55ce2e141376bce199da665a49b3 100644
--- a/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
@@ -12,6 +12,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
#include "webrtc/modules/audio_coding/neteq/mock/mock_decoder_database.h"
#include "webrtc/modules/audio_coding/neteq/packet.h"
@@ -23,8 +24,10 @@ namespace webrtc {
TEST(TimestampScaler, TestNoScaling) {
MockDecoderDatabase db;
+ auto factory = CreateBuiltinAudioDecoderFactory();
// Use PCMu, because it doesn't use scaled timestamps.
- const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "");
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "",
+ factory);
static const uint8_t kRtpPayloadType = 0;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -43,8 +46,10 @@ TEST(TimestampScaler, TestNoScaling) {
TEST(TimestampScaler, TestNoScalingLargeStep) {
MockDecoderDatabase db;
+ auto factory = CreateBuiltinAudioDecoderFactory();
// Use PCMu, because it doesn't use scaled timestamps.
- const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "");
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "",
+ factory);
static const uint8_t kRtpPayloadType = 0;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -68,8 +73,10 @@ TEST(TimestampScaler, TestNoScalingLargeStep) {
TEST(TimestampScaler, TestG722) {
MockDecoderDatabase db;
+ auto factory = CreateBuiltinAudioDecoderFactory();
// Use G722, which has a factor 2 scaling.
- const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+ factory);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -92,8 +99,10 @@ TEST(TimestampScaler, TestG722) {
TEST(TimestampScaler, TestG722LargeStep) {
MockDecoderDatabase db;
+ auto factory = CreateBuiltinAudioDecoderFactory();
// Use G722, which has a factor 2 scaling.
- const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+ factory);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -120,9 +129,12 @@ TEST(TimestampScaler, TestG722LargeStep) {
TEST(TimestampScaler, TestG722WithCng) {
MockDecoderDatabase db;
+ auto factory = CreateBuiltinAudioDecoderFactory();
// Use G722, which has a factor 2 scaling.
- const DecoderDatabase::DecoderInfo info_g722(NetEqDecoder::kDecoderG722, "");
- const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGwb, "");
+ const DecoderDatabase::DecoderInfo info_g722(NetEqDecoder::kDecoderG722, "",
+ factory);
+ const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGwb, "",
+ factory);
static const uint8_t kRtpPayloadTypeG722 = 17;
static const uint8_t kRtpPayloadTypeCng = 13;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadTypeG722))
@@ -161,8 +173,10 @@ TEST(TimestampScaler, TestG722WithCng) {
// as many tests here.
TEST(TimestampScaler, TestG722Packet) {
MockDecoderDatabase db;
+ auto factory = CreateBuiltinAudioDecoderFactory();
// Use G722, which has a factor 2 scaling.
- const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+ factory);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -189,8 +203,10 @@ TEST(TimestampScaler, TestG722Packet) {
// we are not doing as many tests here.
TEST(TimestampScaler, TestG722PacketList) {
MockDecoderDatabase db;
+ auto factory = CreateBuiltinAudioDecoderFactory();
// Use G722, which has a factor 2 scaling.
- const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+ factory);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -218,8 +234,10 @@ TEST(TimestampScaler, TestG722PacketList) {
TEST(TimestampScaler, TestG722Reset) {
MockDecoderDatabase db;
+ auto factory = CreateBuiltinAudioDecoderFactory();
// Use G722, which has a factor 2 scaling.
- const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+ factory);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@@ -258,7 +276,9 @@ TEST(TimestampScaler, TestG722Reset) {
// timestamp scaler.
TEST(TimestampScaler, TestOpusLargeStep) {
MockDecoderDatabase db;
- const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderOpus, "");
+ auto factory = CreateBuiltinAudioDecoderFactory();
+ const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderOpus, "",
+ factory);
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));

Powered by Google App Engine
This is Rietveld 408576698