Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: webrtc/call/call_perf_tests.cc

Issue 2794243002: Making FakeNetworkPipe demux audio and video packets. (Closed)
Patch Set: further fixing Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/video/video_quality_test.h » ('j') | webrtc/video/video_quality_test.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 #include "webrtc/test/fake_decoder.h" 31 #include "webrtc/test/fake_decoder.h"
32 #include "webrtc/test/fake_encoder.h" 32 #include "webrtc/test/fake_encoder.h"
33 #include "webrtc/test/field_trial.h" 33 #include "webrtc/test/field_trial.h"
34 #include "webrtc/test/frame_generator.h" 34 #include "webrtc/test/frame_generator.h"
35 #include "webrtc/test/frame_generator_capturer.h" 35 #include "webrtc/test/frame_generator_capturer.h"
36 #include "webrtc/test/gtest.h" 36 #include "webrtc/test/gtest.h"
37 #include "webrtc/test/rtp_rtcp_observer.h" 37 #include "webrtc/test/rtp_rtcp_observer.h"
38 #include "webrtc/test/testsupport/fileutils.h" 38 #include "webrtc/test/testsupport/fileutils.h"
39 #include "webrtc/test/testsupport/perf_test.h" 39 #include "webrtc/test/testsupport/perf_test.h"
40 #include "webrtc/video/transport_adapter.h" 40 #include "webrtc/video/transport_adapter.h"
41 #include "webrtc/video/video_quality_test.h"
41 #include "webrtc/voice_engine/include/voe_base.h" 42 #include "webrtc/voice_engine/include/voe_base.h"
42 43
43 using webrtc::test::DriftingClock; 44 using webrtc::test::DriftingClock;
44 using webrtc::test::FakeAudioDevice; 45 using webrtc::test::FakeAudioDevice;
45 46
46 namespace webrtc { 47 namespace webrtc {
47 48
48 class CallPerfTest : public test::CallTest { 49 class CallPerfTest : public test::CallTest {
49 protected: 50 protected:
50 enum class FecMode { 51 enum class FecMode {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 send_audio_state_config.audio_mixer = AudioMixerImpl::Create(); 161 send_audio_state_config.audio_mixer = AudioMixerImpl::Create();
161 Call::Config sender_config(&event_log_); 162 Call::Config sender_config(&event_log_);
162 sender_config.audio_state = AudioState::Create(send_audio_state_config); 163 sender_config.audio_state = AudioState::Create(send_audio_state_config);
163 Call::Config receiver_config(&event_log_); 164 Call::Config receiver_config(&event_log_);
164 receiver_config.audio_state = sender_config.audio_state; 165 receiver_config.audio_state = sender_config.audio_state;
165 CreateCalls(sender_config, receiver_config); 166 CreateCalls(sender_config, receiver_config);
166 167
167 168
168 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock()); 169 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock());
169 170
170 // Helper class to ensure we deliver correct media_type to the receiving call.
171 class MediaTypePacketReceiver : public PacketReceiver {
172 public:
173 MediaTypePacketReceiver(PacketReceiver* packet_receiver,
174 MediaType media_type)
175 : packet_receiver_(packet_receiver), media_type_(media_type) {}
176
177 DeliveryStatus DeliverPacket(MediaType media_type,
178 const uint8_t* packet,
179 size_t length,
180 const PacketTime& packet_time) override {
181 return packet_receiver_->DeliverPacket(media_type_, packet, length,
182 packet_time);
183 }
184 private:
185 PacketReceiver* packet_receiver_;
186 const MediaType media_type_;
187
188 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MediaTypePacketReceiver);
189 };
190
191 FakeNetworkPipe::Config audio_net_config; 171 FakeNetworkPipe::Config audio_net_config;
192 audio_net_config.queue_delay_ms = 500; 172 audio_net_config.queue_delay_ms = 500;
193 audio_net_config.loss_percent = 5; 173 audio_net_config.loss_percent = 5;
194 test::PacketTransport audio_send_transport(sender_call_.get(), &observer, 174 test::PacketTransport audio_send_transport(sender_call_.get(), &observer,
195 test::PacketTransport::kSender, 175 test::PacketTransport::kSender,
196 MediaType::AUDIO, 176 MediaType::AUDIO,
197 audio_net_config); 177 audio_net_config);
198 MediaTypePacketReceiver audio_receiver(receiver_call_->Receiver(), 178 MediaTypePacketReceiver audio_receiver(receiver_call_->Receiver(),
199 MediaType::AUDIO); 179 MediaType::AUDIO);
200 audio_send_transport.SetReceiver(&audio_receiver); 180 audio_send_transport.SetReceiver(&audio_receiver);
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 uint32_t last_set_bitrate_kbps_; 743 uint32_t last_set_bitrate_kbps_;
764 VideoSendStream* send_stream_; 744 VideoSendStream* send_stream_;
765 test::FrameGeneratorCapturer* frame_generator_; 745 test::FrameGeneratorCapturer* frame_generator_;
766 VideoEncoderConfig encoder_config_; 746 VideoEncoderConfig encoder_config_;
767 } test; 747 } test;
768 748
769 RunBaseTest(&test); 749 RunBaseTest(&test);
770 } 750 }
771 751
772 } // namespace webrtc 752 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/video_quality_test.h » ('j') | webrtc/video/video_quality_test.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698