OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 void InsertAndVerifyPaddingFrame(const uint8_t* payload, | 47 void InsertAndVerifyPaddingFrame(const uint8_t* payload, |
48 WebRtcRTPHeader* header) { | 48 WebRtcRTPHeader* header) { |
49 ASSERT_TRUE(header != NULL); | 49 ASSERT_TRUE(header != NULL); |
50 for (int j = 0; j < 5; ++j) { | 50 for (int j = 0; j < 5; ++j) { |
51 // Padding only packets are passed to the VCM with payload size 0. | 51 // Padding only packets are passed to the VCM with payload size 0. |
52 EXPECT_EQ(0, receiver_->IncomingPacket(payload, 0, *header)); | 52 EXPECT_EQ(0, receiver_->IncomingPacket(payload, 0, *header)); |
53 ++header->header.sequenceNumber; | 53 ++header->header.sequenceNumber; |
54 } | 54 } |
55 receiver_->Process(); | 55 EXPECT_EQ(0, receiver_->Process()); |
56 EXPECT_CALL(decoder_, Decode(_, _, _, _, _)).Times(0); | 56 EXPECT_CALL(decoder_, Decode(_, _, _, _, _)).Times(0); |
57 EXPECT_EQ(VCM_FRAME_NOT_READY, receiver_->Decode(100)); | 57 EXPECT_EQ(VCM_FRAME_NOT_READY, receiver_->Decode(100)); |
58 } | 58 } |
59 | 59 |
60 void InsertAndVerifyDecodableFrame(const uint8_t* payload, | 60 void InsertAndVerifyDecodableFrame(const uint8_t* payload, |
61 size_t length, | 61 size_t length, |
62 WebRtcRTPHeader* header) { | 62 WebRtcRTPHeader* header) { |
63 ASSERT_TRUE(header != NULL); | 63 ASSERT_TRUE(header != NULL); |
64 EXPECT_EQ(0, receiver_->IncomingPacket(payload, length, *header)); | 64 EXPECT_EQ(0, receiver_->IncomingPacket(payload, length, *header)); |
65 ++header->header.sequenceNumber; | 65 ++header->header.sequenceNumber; |
66 EXPECT_CALL(packet_request_callback_, ResendPackets(_, _)).Times(0); | 66 EXPECT_CALL(packet_request_callback_, ResendPackets(_, _)).Times(0); |
67 receiver_->Process();; | 67 EXPECT_EQ(0, receiver_->Process()); |
68 EXPECT_CALL(decoder_, Decode(_, _, _, _, _)).Times(1); | 68 EXPECT_CALL(decoder_, Decode(_, _, _, _, _)).Times(1); |
69 EXPECT_EQ(0, receiver_->Decode(100)); | 69 EXPECT_EQ(0, receiver_->Decode(100)); |
70 } | 70 } |
71 | 71 |
72 SimulatedClock clock_; | 72 SimulatedClock clock_; |
73 NullEventFactory event_factory_; | 73 NullEventFactory event_factory_; |
74 VideoCodec settings_; | 74 VideoCodec settings_; |
75 NiceMock<MockVideoDecoder> decoder_; | 75 NiceMock<MockVideoDecoder> decoder_; |
76 NiceMock<MockPacketRequestCallback> packet_request_callback_; | 76 NiceMock<MockPacketRequestCallback> packet_request_callback_; |
77 | 77 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 TEST_F(TestVideoReceiver, ReceiverDelay) { | 200 TEST_F(TestVideoReceiver, ReceiverDelay) { |
201 EXPECT_EQ(0, receiver_->SetMinReceiverDelay(0)); | 201 EXPECT_EQ(0, receiver_->SetMinReceiverDelay(0)); |
202 EXPECT_EQ(0, receiver_->SetMinReceiverDelay(5000)); | 202 EXPECT_EQ(0, receiver_->SetMinReceiverDelay(5000)); |
203 EXPECT_EQ(-1, receiver_->SetMinReceiverDelay(-100)); | 203 EXPECT_EQ(-1, receiver_->SetMinReceiverDelay(-100)); |
204 EXPECT_EQ(-1, receiver_->SetMinReceiverDelay(10010)); | 204 EXPECT_EQ(-1, receiver_->SetMinReceiverDelay(10010)); |
205 } | 205 } |
206 | 206 |
207 } // namespace | 207 } // namespace |
208 } // namespace vcm | 208 } // namespace vcm |
209 } // namespace webrtc | 209 } // namespace webrtc |
OLD | NEW |