This is to re-open an earlier CL

https://webrtc-codereview.appspot.com/16619005/

which is reverted due to an issue in audio conference mixer.

This issue has been solved in
https://webrtc-codereview.appspot.com/20779004/

BUG=webrtc:3155
R=turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/18819005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6736 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
minyue@webrtc.org
2014-07-18 21:11:27 +00:00
parent 60e65b11c1
commit f563e85ab0
12 changed files with 249 additions and 433 deletions

View File

@ -252,10 +252,14 @@ TEST(TimestampScaler, TestG722Reset) {
EXPECT_CALL(db, Die()); // Called when database object is deleted.
}
// TODO(minyue): This test becomes trivial since Opus does not need a timestamp
// scaler. Therefore, this test may be removed in future. There is no harm to
// keep it, since it can be taken as a test case for the situation of a trivial
// timestamp scaler.
TEST(TimestampScaler, TestOpusLargeStep) {
MockDecoderDatabase db;
DecoderDatabase::DecoderInfo info;
info.codec_type = kDecoderOpus; // Uses a factor 2/3 scaling.
info.codec_type = kDecoderOpus;
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@ -273,8 +277,7 @@ TEST(TimestampScaler, TestOpusLargeStep) {
scaler.ToInternal(external_timestamp, kRtpPayloadType));
// Scale back.
EXPECT_EQ(external_timestamp, scaler.ToExternal(internal_timestamp));
// Internal timestamp should be incremented with twice the step.
internal_timestamp += 2 * kStep / 3;
internal_timestamp += kStep;
}
EXPECT_CALL(db, Die()); // Called when database object is deleted.
@ -283,7 +286,7 @@ TEST(TimestampScaler, TestOpusLargeStep) {
TEST(TimestampScaler, TestIsacFbLargeStep) {
MockDecoderDatabase db;
DecoderDatabase::DecoderInfo info;
info.codec_type = kDecoderISACfb; // Uses a factor 2/3 scaling.
info.codec_type = kDecoderISACfb;
static const uint8_t kRtpPayloadType = 17;
EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
.WillRepeatedly(Return(&info));
@ -301,7 +304,7 @@ TEST(TimestampScaler, TestIsacFbLargeStep) {
scaler.ToInternal(external_timestamp, kRtpPayloadType));
// Scale back.
EXPECT_EQ(external_timestamp, scaler.ToExternal(internal_timestamp));
// Internal timestamp should be incremented with twice the step.
// Internal timestamp should be incremented with two-thirds the step.
internal_timestamp += 2 * kStep / 3;
}