| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 config.audio_mixer = audio_mixer_; | 82 config.audio_mixer = audio_mixer_; |
| 83 audio_state_ = AudioState::Create(config); | 83 audio_state_ = AudioState::Create(config); |
| 84 | 84 |
| 85 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId)) | 85 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId)) |
| 86 .WillOnce(Invoke([this](int channel_id) { | 86 .WillOnce(Invoke([this](int channel_id) { |
| 87 EXPECT_FALSE(channel_proxy_); | 87 EXPECT_FALSE(channel_proxy_); |
| 88 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>(); | 88 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>(); |
| 89 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kLocalSsrc)).Times(1); | 89 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kLocalSsrc)).Times(1); |
| 90 EXPECT_CALL(*channel_proxy_, SetNACKStatus(true, 15)).Times(1); | 90 EXPECT_CALL(*channel_proxy_, SetNACKStatus(true, 15)).Times(1); |
| 91 EXPECT_CALL(*channel_proxy_, | 91 EXPECT_CALL(*channel_proxy_, |
| 92 SetReceiveAudioLevelIndicationStatus(true, kAudioLevelId)) | |
| 93 .Times(1); | |
| 94 EXPECT_CALL(*channel_proxy_, | |
| 95 EnableReceiveTransportSequenceNumber(kTransportSequenceNumberId)) | |
| 96 .Times(1); | |
| 97 EXPECT_CALL(*channel_proxy_, | |
| 98 RegisterReceiverCongestionControlObjects(&packet_router_)) | 92 RegisterReceiverCongestionControlObjects(&packet_router_)) |
| 99 .Times(1); | 93 .Times(1); |
| 100 EXPECT_CALL(*channel_proxy_, ResetReceiverCongestionControlObjects()) | 94 EXPECT_CALL(*channel_proxy_, ResetReceiverCongestionControlObjects()) |
| 101 .Times(1); | 95 .Times(1); |
| 102 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr)) | 96 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr)) |
| 103 .Times(1); | 97 .Times(1); |
| 104 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport()) | 98 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport()) |
| 105 .Times(1); | 99 .Times(1); |
| 106 EXPECT_CALL(*channel_proxy_, GetAudioDecoderFactory()) | 100 EXPECT_CALL(*channel_proxy_, GetAudioDecoderFactory()) |
| 107 .WillOnce(ReturnRef(decoder_factory_)); | 101 .WillOnce(ReturnRef(decoder_factory_)); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 kTransportSequenceNumberId, kTransportSequenceNumberValue, 2); | 247 kTransportSequenceNumberId, kTransportSequenceNumberValue, 2); |
| 254 PacketTime packet_time(5678000, 0); | 248 PacketTime packet_time(5678000, 0); |
| 255 | 249 |
| 256 RtpPacketReceived parsed_packet; | 250 RtpPacketReceived parsed_packet; |
| 257 ASSERT_TRUE(parsed_packet.Parse(&rtp_packet[0], rtp_packet.size())); | 251 ASSERT_TRUE(parsed_packet.Parse(&rtp_packet[0], rtp_packet.size())); |
| 258 parsed_packet.set_arrival_time_ms((packet_time.timestamp + 500) / 1000); | 252 parsed_packet.set_arrival_time_ms((packet_time.timestamp + 500) / 1000); |
| 259 | 253 |
| 260 EXPECT_CALL(*helper.channel_proxy(), | 254 EXPECT_CALL(*helper.channel_proxy(), |
| 261 OnRtpPacket(testing::Ref(parsed_packet))); | 255 OnRtpPacket(testing::Ref(parsed_packet))); |
| 262 | 256 |
| 263 recv_stream.OnRtpPacket(parsed_packet); | 257 EXPECT_TRUE(recv_stream.OnRtpPacketReceive(&parsed_packet)); |
| 264 } | 258 } |
| 265 | 259 |
| 266 TEST(AudioReceiveStreamTest, ReceiveRtcpPacket) { | 260 TEST(AudioReceiveStreamTest, ReceiveRtcpPacket) { |
| 267 ConfigHelper helper; | 261 ConfigHelper helper; |
| 268 helper.config().rtp.transport_cc = true; | 262 helper.config().rtp.transport_cc = true; |
| 269 internal::AudioReceiveStream recv_stream( | 263 internal::AudioReceiveStream recv_stream( |
| 270 helper.packet_router(), | 264 helper.packet_router(), |
| 271 helper.config(), helper.audio_state(), helper.event_log()); | 265 helper.config(), helper.audio_state(), helper.event_log()); |
| 272 | 266 |
| 273 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... |
| 352 | 346 |
| 353 EXPECT_CALL(helper.voice_engine(), StartPlayout(_)).WillOnce(Return(0)); | 347 EXPECT_CALL(helper.voice_engine(), StartPlayout(_)).WillOnce(Return(0)); |
| 354 EXPECT_CALL(helper.voice_engine(), StopPlayout(_)); | 348 EXPECT_CALL(helper.voice_engine(), StopPlayout(_)); |
| 355 EXPECT_CALL(*helper.audio_mixer(), AddSource(&recv_stream)) | 349 EXPECT_CALL(*helper.audio_mixer(), AddSource(&recv_stream)) |
| 356 .WillOnce(Return(true)); | 350 .WillOnce(Return(true)); |
| 357 | 351 |
| 358 recv_stream.Start(); | 352 recv_stream.Start(); |
| 359 } | 353 } |
| 360 } // namespace test | 354 } // namespace test |
| 361 } // namespace webrtc | 355 } // namespace webrtc |
| OLD | NEW |