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 | 11 |
12 // This file includes unit tests for EncoderStateFeedback. | 12 // This file includes unit tests for EncoderStateFeedback. |
13 #include "webrtc/video/encoder_state_feedback.h" | 13 #include "webrtc/video/encoder_state_feedback.h" |
14 | 14 |
15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 #include "webrtc/base/scoped_ptr.h" | 18 #include "webrtc/base/scoped_ptr.h" |
19 #include "webrtc/common.h" | 19 #include "webrtc/common.h" |
20 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 20 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
21 #include "webrtc/modules/pacing/paced_sender.h" | 21 #include "webrtc/modules/pacing/paced_sender.h" |
22 #include "webrtc/modules/pacing/packet_router.h" | 22 #include "webrtc/modules/pacing/packet_router.h" |
23 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 23 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
24 #include "webrtc/modules/utility/include/mock/mock_process_thread.h" | 24 #include "webrtc/modules/utility/include/mock/mock_process_thread.h" |
25 #include "webrtc/video/overuse_frame_detector.h" | |
mflodman
2016/01/21 08:00:04
Forward declaring OveruseFrameDetector should be e
pbos-webrtc
2016/01/21 14:18:33
Done.
| |
25 #include "webrtc/video/payload_router.h" | 26 #include "webrtc/video/payload_router.h" |
26 #include "webrtc/video/vie_encoder.h" | 27 #include "webrtc/video/vie_encoder.h" |
27 | 28 |
28 using ::testing::NiceMock; | 29 using ::testing::NiceMock; |
29 | 30 |
30 namespace webrtc { | 31 namespace webrtc { |
31 | 32 |
32 class MockVieEncoder : public ViEEncoder { | 33 class MockVieEncoder : public ViEEncoder { |
33 public: | 34 public: |
34 explicit MockVieEncoder(ProcessThread* process_thread, PacedSender* pacer) | 35 explicit MockVieEncoder(ProcessThread* process_thread, PacedSender* pacer) |
35 : ViEEncoder(1, process_thread, nullptr, nullptr, pacer, nullptr) {} | 36 : ViEEncoder(1, |
37 process_thread, | |
38 nullptr, | |
39 nullptr, | |
40 nullptr, | |
41 pacer, | |
42 nullptr) {} | |
36 ~MockVieEncoder() {} | 43 ~MockVieEncoder() {} |
37 | 44 |
38 MOCK_METHOD1(OnReceivedIntraFrameRequest, | 45 MOCK_METHOD1(OnReceivedIntraFrameRequest, |
39 void(uint32_t)); | 46 void(uint32_t)); |
40 MOCK_METHOD2(OnReceivedSLI, | 47 MOCK_METHOD2(OnReceivedSLI, |
41 void(uint32_t ssrc, uint8_t picture_id)); | 48 void(uint32_t ssrc, uint8_t picture_id)); |
42 MOCK_METHOD2(OnReceivedRPSI, | 49 MOCK_METHOD2(OnReceivedRPSI, |
43 void(uint32_t ssrc, uint64_t picture_id)); | 50 void(uint32_t ssrc, uint64_t picture_id)); |
44 MOCK_METHOD2(OnLocalSsrcChanged, | 51 MOCK_METHOD2(OnLocalSsrcChanged, |
45 void(uint32_t old_ssrc, uint32_t new_ssrc)); | 52 void(uint32_t old_ssrc, uint32_t new_ssrc)); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 | 141 |
135 encoder_state_feedback_->RemoveEncoder(&encoder_1); | 142 encoder_state_feedback_->RemoveEncoder(&encoder_1); |
136 EXPECT_CALL(encoder_2, OnReceivedIntraFrameRequest(ssrc_2)) | 143 EXPECT_CALL(encoder_2, OnReceivedIntraFrameRequest(ssrc_2)) |
137 .Times(1); | 144 .Times(1); |
138 encoder_state_feedback_->GetRtcpIntraFrameObserver()-> | 145 encoder_state_feedback_->GetRtcpIntraFrameObserver()-> |
139 OnReceivedIntraFrameRequest(ssrc_2); | 146 OnReceivedIntraFrameRequest(ssrc_2); |
140 encoder_state_feedback_->RemoveEncoder(&encoder_2); | 147 encoder_state_feedback_->RemoveEncoder(&encoder_2); |
141 } | 148 } |
142 | 149 |
143 } // namespace webrtc | 150 } // namespace webrtc |
OLD | NEW |