| 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 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 #include <limits> | 12 #include <limits> |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
| 17 #include "webrtc/base/constructormagic.h" | 17 #include "webrtc/base/constructormagic.h" |
| 18 #include "webrtc/base/thread_annotations.h" | 18 #include "webrtc/base/thread_annotations.h" |
| 19 #include "webrtc/call.h" | 19 #include "webrtc/call.h" |
| 20 #include "webrtc/call/transport_adapter.h" | 20 #include "webrtc/call/transport_adapter.h" |
| 21 #include "webrtc/config.h" | 21 #include "webrtc/config.h" |
| 22 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
| 22 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 23 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
| 23 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 24 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
| 24 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" |
| 25 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 26 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
| 26 #include "webrtc/system_wrappers/include/metrics_default.h" | 27 #include "webrtc/system_wrappers/include/metrics_default.h" |
| 27 #include "webrtc/system_wrappers/include/rtp_to_ntp.h" | 28 #include "webrtc/system_wrappers/include/rtp_to_ntp.h" |
| 28 #include "webrtc/test/call_test.h" | 29 #include "webrtc/test/call_test.h" |
| 29 #include "webrtc/test/direct_transport.h" | 30 #include "webrtc/test/direct_transport.h" |
| 30 #include "webrtc/test/drifting_clock.h" | 31 #include "webrtc/test/drifting_clock.h" |
| 31 #include "webrtc/test/encoder_settings.h" | 32 #include "webrtc/test/encoder_settings.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 FakeAudioDevice fake_audio_device(Clock::GetRealTimeClock(), audio_filename, | 159 FakeAudioDevice fake_audio_device(Clock::GetRealTimeClock(), audio_filename, |
| 159 audio_rtp_speed); | 160 audio_rtp_speed); |
| 160 EXPECT_EQ(0, voe_base->Init(&fake_audio_device, nullptr, decoder_factory_)); | 161 EXPECT_EQ(0, voe_base->Init(&fake_audio_device, nullptr, decoder_factory_)); |
| 161 VoEBase::ChannelConfig config; | 162 VoEBase::ChannelConfig config; |
| 162 config.enable_voice_pacing = true; | 163 config.enable_voice_pacing = true; |
| 163 int send_channel_id = voe_base->CreateChannel(config); | 164 int send_channel_id = voe_base->CreateChannel(config); |
| 164 int recv_channel_id = voe_base->CreateChannel(); | 165 int recv_channel_id = voe_base->CreateChannel(); |
| 165 | 166 |
| 166 AudioState::Config send_audio_state_config; | 167 AudioState::Config send_audio_state_config; |
| 167 send_audio_state_config.voice_engine = voice_engine; | 168 send_audio_state_config.voice_engine = voice_engine; |
| 168 Call::Config sender_config; | 169 Call::Config sender_config(&event_log_); |
| 169 sender_config.audio_state = AudioState::Create(send_audio_state_config); | 170 sender_config.audio_state = AudioState::Create(send_audio_state_config); |
| 170 Call::Config receiver_config; | 171 Call::Config receiver_config(&event_log_); |
| 171 receiver_config.audio_state = sender_config.audio_state; | 172 receiver_config.audio_state = sender_config.audio_state; |
| 172 CreateCalls(sender_config, receiver_config); | 173 CreateCalls(sender_config, receiver_config); |
| 173 | 174 |
| 174 | 175 |
| 175 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock()); | 176 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock()); |
| 176 | 177 |
| 177 // Helper class to ensure we deliver correct media_type to the receiving call. | 178 // Helper class to ensure we deliver correct media_type to the receiving call. |
| 178 class MediaTypePacketReceiver : public PacketReceiver { | 179 class MediaTypePacketReceiver : public PacketReceiver { |
| 179 public: | 180 public: |
| 180 MediaTypePacketReceiver(PacketReceiver* packet_receiver, | 181 MediaTypePacketReceiver(PacketReceiver* packet_receiver, |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 last_set_bitrate_ = new_target_bitrate_kbps; | 679 last_set_bitrate_ = new_target_bitrate_kbps; |
| 679 if (encoder_inits_ == 2 && | 680 if (encoder_inits_ == 2 && |
| 680 new_target_bitrate_kbps > kReconfigureThresholdKbps) { | 681 new_target_bitrate_kbps > kReconfigureThresholdKbps) { |
| 681 time_to_reconfigure_.Set(); | 682 time_to_reconfigure_.Set(); |
| 682 } | 683 } |
| 683 return FakeEncoder::SetRates(new_target_bitrate_kbps, framerate); | 684 return FakeEncoder::SetRates(new_target_bitrate_kbps, framerate); |
| 684 } | 685 } |
| 685 | 686 |
| 686 Call::Config GetSenderCallConfig() override { | 687 Call::Config GetSenderCallConfig() override { |
| 687 Call::Config config = EndToEndTest::GetSenderCallConfig(); | 688 Call::Config config = EndToEndTest::GetSenderCallConfig(); |
| 689 config.event_log = &event_log_; |
| 688 config.bitrate_config.start_bitrate_bps = kInitialBitrateKbps * 1000; | 690 config.bitrate_config.start_bitrate_bps = kInitialBitrateKbps * 1000; |
| 689 return config; | 691 return config; |
| 690 } | 692 } |
| 691 | 693 |
| 692 void ModifyVideoConfigs( | 694 void ModifyVideoConfigs( |
| 693 VideoSendStream::Config* send_config, | 695 VideoSendStream::Config* send_config, |
| 694 std::vector<VideoReceiveStream::Config>* receive_configs, | 696 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 695 VideoEncoderConfig* encoder_config) override { | 697 VideoEncoderConfig* encoder_config) override { |
| 696 send_config->encoder_settings.encoder = this; | 698 send_config->encoder_settings.encoder = this; |
| 697 encoder_config->video_stream_factory = | 699 encoder_config->video_stream_factory = |
| (...skipping 29 matching lines...) Expand all Loading... |
| 727 uint32_t last_set_bitrate_; | 729 uint32_t last_set_bitrate_; |
| 728 VideoSendStream* send_stream_; | 730 VideoSendStream* send_stream_; |
| 729 test::FrameGeneratorCapturer* frame_generator_; | 731 test::FrameGeneratorCapturer* frame_generator_; |
| 730 VideoEncoderConfig encoder_config_; | 732 VideoEncoderConfig encoder_config_; |
| 731 } test; | 733 } test; |
| 732 | 734 |
| 733 RunBaseTest(&test); | 735 RunBaseTest(&test); |
| 734 } | 736 } |
| 735 | 737 |
| 736 } // namespace webrtc | 738 } // namespace webrtc |
| OLD | NEW |