| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include <list> | 13 #include <list> |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/base/location.h" |
| 17 #include "webrtc/common_video/h264/h264_common.h" | 18 #include "webrtc/common_video/h264/h264_common.h" |
| 18 #include "webrtc/modules/video_coding/frame_buffer.h" | 19 #include "webrtc/modules/video_coding/frame_buffer.h" |
| 19 #include "webrtc/modules/video_coding/jitter_buffer.h" | 20 #include "webrtc/modules/video_coding/jitter_buffer.h" |
| 20 #include "webrtc/modules/video_coding/media_opt_util.h" | 21 #include "webrtc/modules/video_coding/media_opt_util.h" |
| 21 #include "webrtc/modules/video_coding/packet.h" | 22 #include "webrtc/modules/video_coding/packet.h" |
| 22 #include "webrtc/modules/video_coding/test/stream_generator.h" | 23 #include "webrtc/modules/video_coding/test/stream_generator.h" |
| 23 #include "webrtc/modules/video_coding/test/test_util.h" | 24 #include "webrtc/modules/video_coding/test/test_util.h" |
| 24 #include "webrtc/system_wrappers/include/clock.h" | 25 #include "webrtc/system_wrappers/include/clock.h" |
| 25 #include "webrtc/system_wrappers/include/field_trial.h" | 26 #include "webrtc/system_wrappers/include/field_trial.h" |
| 26 #include "webrtc/system_wrappers/include/metrics.h" | 27 #include "webrtc/system_wrappers/include/metrics.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 EXPECT_EQ(2U, packet_.video_header.codecHeader.VP9.num_ref_pics); | 193 EXPECT_EQ(2U, packet_.video_header.codecHeader.VP9.num_ref_pics); |
| 193 EXPECT_EQ(1, packet_.video_header.codecHeader.VP9.pid_diff[0]); | 194 EXPECT_EQ(1, packet_.video_header.codecHeader.VP9.pid_diff[0]); |
| 194 EXPECT_EQ(2, packet_.video_header.codecHeader.VP9.pid_diff[1]); | 195 EXPECT_EQ(2, packet_.video_header.codecHeader.VP9.pid_diff[1]); |
| 195 } | 196 } |
| 196 | 197 |
| 197 class ProcessThreadMock : public ProcessThread { | 198 class ProcessThreadMock : public ProcessThread { |
| 198 public: | 199 public: |
| 199 MOCK_METHOD0(Start, void()); | 200 MOCK_METHOD0(Start, void()); |
| 200 MOCK_METHOD0(Stop, void()); | 201 MOCK_METHOD0(Stop, void()); |
| 201 MOCK_METHOD1(WakeUp, void(Module* module)); | 202 MOCK_METHOD1(WakeUp, void(Module* module)); |
| 202 MOCK_METHOD1(RegisterModule, void(Module* module)); | 203 MOCK_METHOD2(RegisterModule, void(Module* module, const rtc::Location&)); |
| 203 MOCK_METHOD1(DeRegisterModule, void(Module* module)); | 204 MOCK_METHOD1(DeRegisterModule, void(Module* module)); |
| 204 void PostTask(std::unique_ptr<rtc::QueuedTask> task) /*override*/ {} | 205 void PostTask(std::unique_ptr<rtc::QueuedTask> task) /*override*/ {} |
| 205 }; | 206 }; |
| 206 | 207 |
| 207 class TestBasicJitterBuffer : public ::testing::TestWithParam<std::string>, | 208 class TestBasicJitterBuffer : public ::testing::TestWithParam<std::string>, |
| 208 public NackSender, | 209 public NackSender, |
| 209 public KeyFrameRequestSender { | 210 public KeyFrameRequestSender { |
| 210 public: | 211 public: |
| 211 void SendNack(const std::vector<uint16_t>& sequence_numbers) override { | 212 void SendNack(const std::vector<uint16_t>& sequence_numbers) override { |
| 212 nack_sent_.insert(nack_sent_.end(), sequence_numbers.begin(), | 213 nack_sent_.insert(nack_sent_.end(), sequence_numbers.begin(), |
| (...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2712 EXPECT_EQ(0u, nack_list.size()); | 2713 EXPECT_EQ(0u, nack_list.size()); |
| 2713 | 2714 |
| 2714 // Stream should be decodable from this point. | 2715 // Stream should be decodable from this point. |
| 2715 clock_->AdvanceTimeMilliseconds(kDefaultFramePeriodMs); | 2716 clock_->AdvanceTimeMilliseconds(kDefaultFramePeriodMs); |
| 2716 InsertFrame(kVideoFrameDelta); | 2717 InsertFrame(kVideoFrameDelta); |
| 2717 EXPECT_TRUE(DecodeCompleteFrame()); | 2718 EXPECT_TRUE(DecodeCompleteFrame()); |
| 2718 nack_list = jitter_buffer_->GetNackList(&extended); | 2719 nack_list = jitter_buffer_->GetNackList(&extended); |
| 2719 EXPECT_EQ(0u, nack_list.size()); | 2720 EXPECT_EQ(0u, nack_list.size()); |
| 2720 } | 2721 } |
| 2721 } // namespace webrtc | 2722 } // namespace webrtc |
| OLD | NEW |