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 11 matching lines...) Loading... |
22 #include "webrtc/video/vie_encoder.h" | 22 #include "webrtc/video/vie_encoder.h" |
23 | 23 |
24 using ::testing::NiceMock; | 24 using ::testing::NiceMock; |
25 | 25 |
26 namespace webrtc { | 26 namespace webrtc { |
27 | 27 |
28 class MockVieEncoder : public ViEEncoder { | 28 class MockVieEncoder : public ViEEncoder { |
29 public: | 29 public: |
30 explicit MockVieEncoder(ProcessThread* process_thread, PacedSender* pacer) | 30 explicit MockVieEncoder(ProcessThread* process_thread, PacedSender* pacer) |
31 : ViEEncoder(1, | 31 : ViEEncoder(1, |
| 32 std::vector<uint32_t>(), |
32 process_thread, | 33 process_thread, |
33 nullptr, | 34 nullptr, |
34 nullptr, | 35 nullptr, |
35 nullptr, | 36 nullptr, |
36 pacer, | 37 pacer, |
37 nullptr, | 38 nullptr, |
38 nullptr) {} | 39 nullptr) {} |
39 ~MockVieEncoder() {} | 40 ~MockVieEncoder() {} |
40 | 41 |
41 MOCK_METHOD1(OnReceivedIntraFrameRequest, | 42 MOCK_METHOD1(OnReceivedIntraFrameRequest, |
42 void(uint32_t)); | 43 void(uint32_t)); |
43 MOCK_METHOD2(OnReceivedSLI, | 44 MOCK_METHOD2(OnReceivedSLI, |
44 void(uint32_t ssrc, uint8_t picture_id)); | 45 void(uint32_t ssrc, uint8_t picture_id)); |
45 MOCK_METHOD2(OnReceivedRPSI, | 46 MOCK_METHOD2(OnReceivedRPSI, |
46 void(uint32_t ssrc, uint64_t picture_id)); | 47 void(uint32_t ssrc, uint64_t picture_id)); |
47 MOCK_METHOD2(OnLocalSsrcChanged, | |
48 void(uint32_t old_ssrc, uint32_t new_ssrc)); | |
49 }; | 48 }; |
50 | 49 |
51 TEST(VieKeyRequestTest, CreateAndTriggerRequests) { | 50 TEST(VieKeyRequestTest, CreateAndTriggerRequests) { |
52 static const uint32_t kSsrc = 1234; | 51 static const uint32_t kSsrc = 1234; |
53 NiceMock<MockProcessThread> process_thread; | 52 NiceMock<MockProcessThread> process_thread; |
54 PacketRouter router; | 53 PacketRouter router; |
55 PacedSender pacer(Clock::GetRealTimeClock(), &router, | 54 PacedSender pacer(Clock::GetRealTimeClock(), &router, |
56 BitrateController::kDefaultStartBitrateKbps, | 55 BitrateController::kDefaultStartBitrateKbps, |
57 PacedSender::kDefaultPaceMultiplier * | 56 PacedSender::kDefaultPaceMultiplier * |
58 BitrateController::kDefaultStartBitrateKbps, | 57 BitrateController::kDefaultStartBitrateKbps, |
(...skipping 12 matching lines...) Loading... |
71 .Times(1); | 70 .Times(1); |
72 encoder_state_feedback.OnReceivedSLI(kSsrc, sli_picture_id); | 71 encoder_state_feedback.OnReceivedSLI(kSsrc, sli_picture_id); |
73 | 72 |
74 const uint64_t rpsi_picture_id = 9; | 73 const uint64_t rpsi_picture_id = 9; |
75 EXPECT_CALL(encoder, OnReceivedRPSI(kSsrc, rpsi_picture_id)) | 74 EXPECT_CALL(encoder, OnReceivedRPSI(kSsrc, rpsi_picture_id)) |
76 .Times(1); | 75 .Times(1); |
77 encoder_state_feedback.OnReceivedRPSI(kSsrc, rpsi_picture_id); | 76 encoder_state_feedback.OnReceivedRPSI(kSsrc, rpsi_picture_id); |
78 } | 77 } |
79 | 78 |
80 } // namespace webrtc | 79 } // namespace webrtc |
OLD | NEW |