| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; |
| 170 sender_config.event_log = &event_log_; |
| 169 sender_config.audio_state = AudioState::Create(send_audio_state_config); | 171 sender_config.audio_state = AudioState::Create(send_audio_state_config); |
| 170 Call::Config receiver_config; | 172 Call::Config receiver_config; |
| 173 receiver_config.event_log = &event_log_; |
| 171 receiver_config.audio_state = sender_config.audio_state; | 174 receiver_config.audio_state = sender_config.audio_state; |
| 172 CreateCalls(sender_config, receiver_config); | 175 CreateCalls(sender_config, receiver_config); |
| 173 | 176 |
| 174 | 177 |
| 175 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock()); | 178 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock()); |
| 176 | 179 |
| 177 // Helper class to ensure we deliver correct media_type to the receiving call. | 180 // Helper class to ensure we deliver correct media_type to the receiving call. |
| 178 class MediaTypePacketReceiver : public PacketReceiver { | 181 class MediaTypePacketReceiver : public PacketReceiver { |
| 179 public: | 182 public: |
| 180 MediaTypePacketReceiver(PacketReceiver* packet_receiver, | 183 MediaTypePacketReceiver(PacketReceiver* packet_receiver, |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 last_set_bitrate_ = new_target_bitrate_kbps; | 680 last_set_bitrate_ = new_target_bitrate_kbps; |
| 678 if (encoder_inits_ == 2 && | 681 if (encoder_inits_ == 2 && |
| 679 new_target_bitrate_kbps > kReconfigureThresholdKbps) { | 682 new_target_bitrate_kbps > kReconfigureThresholdKbps) { |
| 680 time_to_reconfigure_.Set(); | 683 time_to_reconfigure_.Set(); |
| 681 } | 684 } |
| 682 return FakeEncoder::SetRates(new_target_bitrate_kbps, framerate); | 685 return FakeEncoder::SetRates(new_target_bitrate_kbps, framerate); |
| 683 } | 686 } |
| 684 | 687 |
| 685 Call::Config GetSenderCallConfig() override { | 688 Call::Config GetSenderCallConfig() override { |
| 686 Call::Config config = EndToEndTest::GetSenderCallConfig(); | 689 Call::Config config = EndToEndTest::GetSenderCallConfig(); |
| 690 config.event_log = &event_log_; |
| 687 config.bitrate_config.start_bitrate_bps = kInitialBitrateKbps * 1000; | 691 config.bitrate_config.start_bitrate_bps = kInitialBitrateKbps * 1000; |
| 688 return config; | 692 return config; |
| 689 } | 693 } |
| 690 | 694 |
| 691 void ModifyVideoConfigs( | 695 void ModifyVideoConfigs( |
| 692 VideoSendStream::Config* send_config, | 696 VideoSendStream::Config* send_config, |
| 693 std::vector<VideoReceiveStream::Config>* receive_configs, | 697 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 694 VideoEncoderConfig* encoder_config) override { | 698 VideoEncoderConfig* encoder_config) override { |
| 695 send_config->encoder_settings.encoder = this; | 699 send_config->encoder_settings.encoder = this; |
| 696 encoder_config->video_stream_factory = | 700 encoder_config->video_stream_factory = |
| (...skipping 29 matching lines...) Expand all Loading... |
| 726 uint32_t last_set_bitrate_; | 730 uint32_t last_set_bitrate_; |
| 727 VideoSendStream* send_stream_; | 731 VideoSendStream* send_stream_; |
| 728 test::FrameGeneratorCapturer* frame_generator_; | 732 test::FrameGeneratorCapturer* frame_generator_; |
| 729 VideoEncoderConfig encoder_config_; | 733 VideoEncoderConfig encoder_config_; |
| 730 } test; | 734 } test; |
| 731 | 735 |
| 732 RunBaseTest(&test); | 736 RunBaseTest(&test); |
| 733 } | 737 } |
| 734 | 738 |
| 735 } // namespace webrtc | 739 } // namespace webrtc |
| OLD | NEW |