OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 TEST(AudioReceiveStreamTest, ReceiveRtpPacket) { | 239 TEST(AudioReceiveStreamTest, ReceiveRtpPacket) { |
240 ConfigHelper helper; | 240 ConfigHelper helper; |
241 helper.config().rtp.transport_cc = true; | 241 helper.config().rtp.transport_cc = true; |
242 internal::AudioReceiveStream recv_stream( | 242 internal::AudioReceiveStream recv_stream( |
243 helper.packet_router(), | 243 helper.packet_router(), |
244 helper.config(), helper.audio_state(), helper.event_log()); | 244 helper.config(), helper.audio_state(), helper.event_log()); |
245 const int kTransportSequenceNumberValue = 1234; | 245 const int kTransportSequenceNumberValue = 1234; |
246 std::vector<uint8_t> rtp_packet = CreateRtpHeaderWithOneByteExtension( | 246 std::vector<uint8_t> rtp_packet = CreateRtpHeaderWithOneByteExtension( |
247 kTransportSequenceNumberId, kTransportSequenceNumberValue, 2); | 247 kTransportSequenceNumberId, kTransportSequenceNumberValue, 2); |
248 PacketTime packet_time(5678000, 0); | 248 PacketTime packet_time(5678000, 0); |
| 249 |
| 250 RtpPacketReceived parsed_packet; |
| 251 ASSERT_TRUE(parsed_packet.Parse(&rtp_packet[0], rtp_packet.size())); |
| 252 parsed_packet.set_arrival_time_ms((packet_time.timestamp + 500) / 1000); |
| 253 |
249 EXPECT_CALL(*helper.channel_proxy(), | 254 EXPECT_CALL(*helper.channel_proxy(), |
250 ReceivedRTPPacket(&rtp_packet[0], | 255 OnRtpPacket(testing::Ref(parsed_packet))); |
251 rtp_packet.size(), | 256 |
252 _)) | 257 recv_stream.OnRtpPacket(parsed_packet); |
253 .WillOnce(Return(true)); | |
254 EXPECT_TRUE( | |
255 recv_stream.DeliverRtp(&rtp_packet[0], rtp_packet.size(), packet_time)); | |
256 } | 258 } |
257 | 259 |
258 TEST(AudioReceiveStreamTest, ReceiveRtcpPacket) { | 260 TEST(AudioReceiveStreamTest, ReceiveRtcpPacket) { |
259 ConfigHelper helper; | 261 ConfigHelper helper; |
260 helper.config().rtp.transport_cc = true; | 262 helper.config().rtp.transport_cc = true; |
261 internal::AudioReceiveStream recv_stream( | 263 internal::AudioReceiveStream recv_stream( |
262 helper.packet_router(), | 264 helper.packet_router(), |
263 helper.config(), helper.audio_state(), helper.event_log()); | 265 helper.config(), helper.audio_state(), helper.event_log()); |
264 | 266 |
265 std::vector<uint8_t> rtcp_packet = CreateRtcpSenderReport(); | 267 std::vector<uint8_t> rtcp_packet = CreateRtcpSenderReport(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 346 |
345 EXPECT_CALL(helper.voice_engine(), StartPlayout(_)).WillOnce(Return(0)); | 347 EXPECT_CALL(helper.voice_engine(), StartPlayout(_)).WillOnce(Return(0)); |
346 EXPECT_CALL(helper.voice_engine(), StopPlayout(_)); | 348 EXPECT_CALL(helper.voice_engine(), StopPlayout(_)); |
347 EXPECT_CALL(*helper.audio_mixer(), AddSource(&recv_stream)) | 349 EXPECT_CALL(*helper.audio_mixer(), AddSource(&recv_stream)) |
348 .WillOnce(Return(true)); | 350 .WillOnce(Return(true)); |
349 | 351 |
350 recv_stream.Start(); | 352 recv_stream.Start(); |
351 } | 353 } |
352 } // namespace test | 354 } // namespace test |
353 } // namespace webrtc | 355 } // namespace webrtc |
OLD | NEW |