Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 ASSERT_TRUE(clock_.get() != NULL); | 37 ASSERT_TRUE(clock_.get() != NULL); |
| 38 vcm_ = VideoCodingModule::Create(clock_.get(), &event_factory_); | 38 vcm_ = VideoCodingModule::Create(clock_.get(), &event_factory_); |
| 39 ASSERT_TRUE(vcm_ != NULL); | 39 ASSERT_TRUE(vcm_ != NULL); |
| 40 const size_t kMaxNackListSize = 250; | 40 const size_t kMaxNackListSize = 250; |
| 41 const int kMaxPacketAgeToNack = 450; | 41 const int kMaxPacketAgeToNack = 450; |
| 42 vcm_->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0); | 42 vcm_->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0); |
| 43 ASSERT_EQ(0, vcm_->RegisterFrameTypeCallback(&frame_type_callback_)); | 43 ASSERT_EQ(0, vcm_->RegisterFrameTypeCallback(&frame_type_callback_)); |
| 44 ASSERT_EQ(0, vcm_->RegisterPacketRequestCallback(&request_callback_)); | 44 ASSERT_EQ(0, vcm_->RegisterPacketRequestCallback(&request_callback_)); |
| 45 ASSERT_EQ(VCM_OK, vcm_->Codec(kVideoCodecVP8, &video_codec_)); | 45 ASSERT_EQ(VCM_OK, vcm_->Codec(kVideoCodecVP8, &video_codec_)); |
| 46 ASSERT_EQ(VCM_OK, vcm_->RegisterReceiveCodec(&video_codec_, 1)); | 46 ASSERT_EQ(VCM_OK, vcm_->RegisterReceiveCodec(&video_codec_, 1)); |
| 47 vcm_->RegisterExternalDecoder(&decoder_, video_codec_.plType, true); | 47 vcm_->RegisterExternalDecoder(&decoder_, video_codec_.plType); |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual void TearDown() { | 50 virtual void TearDown() { |
| 51 VideoCodingModule::Destroy(vcm_); | 51 VideoCodingModule::Destroy(vcm_); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void InsertPacket(uint32_t timestamp, | 54 void InsertPacket(uint32_t timestamp, |
| 55 uint16_t seq_no, | 55 uint16_t seq_no, |
| 56 bool first, | 56 bool first, |
| 57 bool marker_bit, | 57 bool marker_bit, |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 .Times(1) | 197 .Times(1) |
| 198 .InSequence(s1); | 198 .InSequence(s1); |
| 199 | 199 |
| 200 ASSERT_EQ(VCM_OK, vcm_->SetReceiverRobustnessMode( | 200 ASSERT_EQ(VCM_OK, vcm_->SetReceiverRobustnessMode( |
| 201 VideoCodingModule::kNone, | 201 VideoCodingModule::kNone, |
| 202 kWithErrors)); | 202 kWithErrors)); |
| 203 | 203 |
| 204 InsertPacket(0, 0, true, false, kVideoFrameKey); | 204 InsertPacket(0, 0, true, false, kVideoFrameKey); |
| 205 InsertPacket(0, 1, false, false, kVideoFrameKey); | 205 InsertPacket(0, 1, false, false, kVideoFrameKey); |
| 206 InsertPacket(0, 2, false, true, kVideoFrameKey); | 206 InsertPacket(0, 2, false, true, kVideoFrameKey); |
| 207 EXPECT_EQ(VCM_OK, vcm_->Decode(0)); // Decode timestamp 0. | 207 EXPECT_EQ(VCM_OK, vcm_->Decode(33)); // Decode timestamp 0. |
|
pbos-webrtc
2015/12/10 11:27:20
git cl format please
| |
| 208 EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. | 208 EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. |
| 209 | 209 |
| 210 clock_->AdvanceTimeMilliseconds(33); | 210 clock_->AdvanceTimeMilliseconds(33); |
| 211 InsertPacket(3000, 3, true, false, kVideoFrameDelta); | 211 InsertPacket(3000, 3, true, false, kVideoFrameDelta); |
| 212 // Packet 4 missing | 212 // Packet 4 missing |
| 213 InsertPacket(3000, 5, false, true, kVideoFrameDelta); | 213 InsertPacket(3000, 5, false, true, kVideoFrameDelta); |
| 214 EXPECT_EQ(VCM_FRAME_NOT_READY, vcm_->Decode(0)); | 214 EXPECT_EQ(VCM_FRAME_NOT_READY, vcm_->Decode(0)); |
| 215 EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. | 215 EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. |
| 216 | 216 |
| 217 clock_->AdvanceTimeMilliseconds(33); | 217 clock_->AdvanceTimeMilliseconds(33); |
| 218 InsertPacket(6000, 6, true, false, kVideoFrameDelta); | 218 InsertPacket(6000, 6, true, false, kVideoFrameDelta); |
| 219 InsertPacket(6000, 7, false, false, kVideoFrameDelta); | 219 InsertPacket(6000, 7, false, false, kVideoFrameDelta); |
| 220 InsertPacket(6000, 8, false, true, kVideoFrameDelta); | 220 InsertPacket(6000, 8, false, true, kVideoFrameDelta); |
| 221 EXPECT_EQ(VCM_OK, vcm_->Decode(0)); // Decode timestamp 3000 incomplete. | 221 EXPECT_EQ(VCM_OK, vcm_->Decode(0)); // Decode timestamp 3000 incomplete. |
| 222 EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. | 222 EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. |
| 223 | 223 |
| 224 clock_->AdvanceTimeMilliseconds(10); | 224 clock_->AdvanceTimeMilliseconds(10); |
| 225 EXPECT_EQ(VCM_OK, vcm_->Decode(0)); // Decode timestamp 6000 complete. | 225 EXPECT_EQ(VCM_OK, vcm_->Decode(23)); // Decode timestamp 6000 complete. |
| 226 EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. | 226 EXPECT_EQ(VCM_OK, vcm_->Process()); // Expect no NACK list. |
| 227 | 227 |
| 228 clock_->AdvanceTimeMilliseconds(23); | 228 clock_->AdvanceTimeMilliseconds(23); |
| 229 InsertPacket(3000, 4, false, false, kVideoFrameDelta); | 229 InsertPacket(3000, 4, false, false, kVideoFrameDelta); |
| 230 | 230 |
| 231 InsertPacket(9000, 9, true, false, kVideoFrameDelta); | 231 InsertPacket(9000, 9, true, false, kVideoFrameDelta); |
| 232 InsertPacket(9000, 10, false, false, kVideoFrameDelta); | 232 InsertPacket(9000, 10, false, false, kVideoFrameDelta); |
| 233 InsertPacket(9000, 11, false, true, kVideoFrameDelta); | 233 InsertPacket(9000, 11, false, true, kVideoFrameDelta); |
| 234 EXPECT_EQ(VCM_OK, vcm_->Decode(0)); // Decode timestamp 9000 complete. | 234 EXPECT_EQ(VCM_OK, vcm_->Decode(33)); // Decode timestamp 9000 complete. |
| 235 } | 235 } |
| 236 } // namespace webrtc | 236 } // namespace webrtc |
| OLD | NEW |