| 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 |
| 11 #include <memory> |
| 12 |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h" | 15 #include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h" |
| 14 #include "webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h" | 16 #include "webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h" |
| 15 #include "webrtc/modules/video_coding/include/video_coding.h" | 17 #include "webrtc/modules/video_coding/include/video_coding.h" |
| 16 #include "webrtc/modules/video_coding/test/test_util.h" | 18 #include "webrtc/modules/video_coding/test/test_util.h" |
| 17 #include "webrtc/system_wrappers/include/clock.h" | 19 #include "webrtc/system_wrappers/include/clock.h" |
| 18 | 20 |
| 19 namespace webrtc { | 21 namespace webrtc { |
| 20 | 22 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 rtp_info.header.sequenceNumber = seq_no; | 64 rtp_info.header.sequenceNumber = seq_no; |
| 63 rtp_info.header.markerBit = marker_bit; | 65 rtp_info.header.markerBit = marker_bit; |
| 64 rtp_info.header.payloadType = video_codec_.plType; | 66 rtp_info.header.payloadType = video_codec_.plType; |
| 65 rtp_info.type.Video.codec = kRtpVideoVp8; | 67 rtp_info.type.Video.codec = kRtpVideoVp8; |
| 66 rtp_info.type.Video.codecHeader.VP8.InitRTPVideoHeaderVP8(); | 68 rtp_info.type.Video.codecHeader.VP8.InitRTPVideoHeaderVP8(); |
| 67 rtp_info.type.Video.isFirstPacket = first; | 69 rtp_info.type.Video.isFirstPacket = first; |
| 68 | 70 |
| 69 ASSERT_EQ(VCM_OK, vcm_->IncomingPacket(payload, kPayloadLen, rtp_info)); | 71 ASSERT_EQ(VCM_OK, vcm_->IncomingPacket(payload, kPayloadLen, rtp_info)); |
| 70 } | 72 } |
| 71 | 73 |
| 72 rtc::scoped_ptr<VideoCodingModule> vcm_; | 74 std::unique_ptr<VideoCodingModule> vcm_; |
| 73 VideoCodec video_codec_; | 75 VideoCodec video_codec_; |
| 74 MockVCMFrameTypeCallback frame_type_callback_; | 76 MockVCMFrameTypeCallback frame_type_callback_; |
| 75 MockPacketRequestCallback request_callback_; | 77 MockPacketRequestCallback request_callback_; |
| 76 NiceMock<MockVideoDecoder> decoder_; | 78 NiceMock<MockVideoDecoder> decoder_; |
| 77 NiceMock<MockVideoDecoder> decoderCopy_; | 79 NiceMock<MockVideoDecoder> decoderCopy_; |
| 78 rtc::scoped_ptr<SimulatedClock> clock_; | 80 std::unique_ptr<SimulatedClock> clock_; |
| 79 NullEventFactory event_factory_; | 81 NullEventFactory event_factory_; |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 TEST_F(VCMRobustnessTest, TestHardNack) { | 84 TEST_F(VCMRobustnessTest, TestHardNack) { |
| 83 Sequence s; | 85 Sequence s; |
| 84 EXPECT_CALL(request_callback_, ResendPackets(_, 2)) | 86 EXPECT_CALL(request_callback_, ResendPackets(_, 2)) |
| 85 .With(Args<0, 1>(ElementsAre(6, 7))) | 87 .With(Args<0, 1>(ElementsAre(6, 7))) |
| 86 .Times(1); | 88 .Times(1); |
| 87 for (int ts = 0; ts <= 6000; ts += 3000) { | 89 for (int ts = 0; ts <= 6000; ts += 3000) { |
| 88 EXPECT_CALL(decoder_, | 90 EXPECT_CALL(decoder_, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 219 |
| 218 clock_->AdvanceTimeMilliseconds(23); | 220 clock_->AdvanceTimeMilliseconds(23); |
| 219 InsertPacket(3000, 4, false, false, kVideoFrameDelta); | 221 InsertPacket(3000, 4, false, false, kVideoFrameDelta); |
| 220 | 222 |
| 221 InsertPacket(9000, 9, true, false, kVideoFrameDelta); | 223 InsertPacket(9000, 9, true, false, kVideoFrameDelta); |
| 222 InsertPacket(9000, 10, false, false, kVideoFrameDelta); | 224 InsertPacket(9000, 10, false, false, kVideoFrameDelta); |
| 223 InsertPacket(9000, 11, false, true, kVideoFrameDelta); | 225 InsertPacket(9000, 11, false, true, kVideoFrameDelta); |
| 224 EXPECT_EQ(VCM_OK, vcm_->Decode(33)); // Decode timestamp 9000 complete. | 226 EXPECT_EQ(VCM_OK, vcm_->Decode(33)); // Decode timestamp 9000 complete. |
| 225 } | 227 } |
| 226 } // namespace webrtc | 228 } // namespace webrtc |
| OLD | NEW |