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 18 matching lines...) Expand all Loading... |
29 using ::testing::Pointee; | 29 using ::testing::Pointee; |
30 using ::testing::NiceMock; | 30 using ::testing::NiceMock; |
31 using ::testing::Sequence; | 31 using ::testing::Sequence; |
32 | 32 |
33 class VCMRobustnessTest : public ::testing::Test { | 33 class VCMRobustnessTest : public ::testing::Test { |
34 protected: | 34 protected: |
35 static const size_t kPayloadLen = 10; | 35 static const size_t kPayloadLen = 10; |
36 | 36 |
37 virtual void SetUp() { | 37 virtual void SetUp() { |
38 clock_.reset(new SimulatedClock(0)); | 38 clock_.reset(new SimulatedClock(0)); |
39 ASSERT_TRUE(clock_.get() != NULL); | 39 ASSERT_TRUE(clock_.get() != nullptr); |
40 vcm_.reset(VideoCodingModule::Create(clock_.get(), &event_factory_)); | 40 vcm_.reset(VideoCodingModule::Create(clock_.get(), &event_factory_)); |
41 ASSERT_TRUE(vcm_ != NULL); | 41 ASSERT_TRUE(vcm_ != nullptr); |
42 const size_t kMaxNackListSize = 250; | 42 const size_t kMaxNackListSize = 250; |
43 const int kMaxPacketAgeToNack = 450; | 43 const int kMaxPacketAgeToNack = 450; |
44 vcm_->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0); | 44 vcm_->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0); |
45 ASSERT_EQ(0, vcm_->RegisterFrameTypeCallback(&frame_type_callback_)); | 45 ASSERT_EQ(0, vcm_->RegisterFrameTypeCallback(&frame_type_callback_)); |
46 ASSERT_EQ(0, vcm_->RegisterPacketRequestCallback(&request_callback_)); | 46 ASSERT_EQ(0, vcm_->RegisterPacketRequestCallback(&request_callback_)); |
47 VideoCodingModule::Codec(kVideoCodecVP8, &video_codec_); | 47 VideoCodingModule::Codec(kVideoCodecVP8, &video_codec_); |
48 ASSERT_EQ(VCM_OK, vcm_->RegisterReceiveCodec(&video_codec_, 1)); | 48 ASSERT_EQ(VCM_OK, vcm_->RegisterReceiveCodec(&video_codec_, 1)); |
49 vcm_->RegisterExternalDecoder(&decoder_, video_codec_.plType); | 49 vcm_->RegisterExternalDecoder(&decoder_, video_codec_.plType); |
50 } | 50 } |
51 | 51 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 clock_->AdvanceTimeMilliseconds(23); | 220 clock_->AdvanceTimeMilliseconds(23); |
221 InsertPacket(3000, 4, false, false, kVideoFrameDelta); | 221 InsertPacket(3000, 4, false, false, kVideoFrameDelta); |
222 | 222 |
223 InsertPacket(9000, 9, true, false, kVideoFrameDelta); | 223 InsertPacket(9000, 9, true, false, kVideoFrameDelta); |
224 InsertPacket(9000, 10, false, false, kVideoFrameDelta); | 224 InsertPacket(9000, 10, false, false, kVideoFrameDelta); |
225 InsertPacket(9000, 11, false, true, kVideoFrameDelta); | 225 InsertPacket(9000, 11, false, true, kVideoFrameDelta); |
226 EXPECT_EQ(VCM_OK, vcm_->Decode(33)); // Decode timestamp 9000 complete. | 226 EXPECT_EQ(VCM_OK, vcm_->Decode(33)); // Decode timestamp 9000 complete. |
227 } | 227 } |
228 } // namespace webrtc | 228 } // namespace webrtc |
OLD | NEW |