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

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

Issue 2783853002: Reland of Don't hardcode MediaType::ANY in FakeNetworkPipe. (Closed)
Patch Set: Fix braces. Add comment on use of demuxer. 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
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 const MediaType media_type_; 186 const MediaType media_type_;
187 187
188 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MediaTypePacketReceiver); 188 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MediaTypePacketReceiver);
189 }; 189 };
190 190
191 FakeNetworkPipe::Config audio_net_config; 191 FakeNetworkPipe::Config audio_net_config;
192 audio_net_config.queue_delay_ms = 500; 192 audio_net_config.queue_delay_ms = 500;
193 audio_net_config.loss_percent = 5; 193 audio_net_config.loss_percent = 5;
194 test::PacketTransport audio_send_transport(sender_call_.get(), &observer, 194 test::PacketTransport audio_send_transport(sender_call_.get(), &observer,
195 test::PacketTransport::kSender, 195 test::PacketTransport::kSender,
196 MediaType::AUDIO,
196 audio_net_config); 197 audio_net_config);
197 MediaTypePacketReceiver audio_receiver(receiver_call_->Receiver(), 198 MediaTypePacketReceiver audio_receiver(receiver_call_->Receiver(),
198 MediaType::AUDIO); 199 MediaType::AUDIO);
199 audio_send_transport.SetReceiver(&audio_receiver); 200 audio_send_transport.SetReceiver(&audio_receiver);
200 201
201 test::PacketTransport video_send_transport(sender_call_.get(), &observer, 202 test::PacketTransport video_send_transport(sender_call_.get(), &observer,
202 test::PacketTransport::kSender, 203 test::PacketTransport::kSender,
204 MediaType::VIDEO,
203 FakeNetworkPipe::Config()); 205 FakeNetworkPipe::Config());
204 MediaTypePacketReceiver video_receiver(receiver_call_->Receiver(), 206 MediaTypePacketReceiver video_receiver(receiver_call_->Receiver(),
205 MediaType::VIDEO); 207 MediaType::VIDEO);
206 video_send_transport.SetReceiver(&video_receiver); 208 video_send_transport.SetReceiver(&video_receiver);
207 209
208 test::PacketTransport receive_transport( 210 test::PacketTransport receive_transport(
209 receiver_call_.get(), &observer, test::PacketTransport::kReceiver, 211 receiver_call_.get(), &observer, test::PacketTransport::kReceiver,
212 MediaType::VIDEO,
210 FakeNetworkPipe::Config()); 213 FakeNetworkPipe::Config());
211 receive_transport.SetReceiver(sender_call_->Receiver()); 214 receive_transport.SetReceiver(sender_call_->Receiver());
212 215
213 test::FakeDecoder fake_decoder; 216 test::FakeDecoder fake_decoder;
214 217
215 CreateSendConfig(1, 0, 0, &video_send_transport); 218 CreateSendConfig(1, 0, 0, &video_send_transport);
216 CreateMatchingReceiveConfigs(&receive_transport); 219 CreateMatchingReceiveConfigs(&receive_transport);
217 220
218 AudioSendStream::Config audio_send_config(&audio_send_transport); 221 AudioSendStream::Config audio_send_config(&audio_send_transport);
219 audio_send_config.voe_channel_id = send_channel_id; 222 audio_send_config.voe_channel_id = send_channel_id;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 start_time_ms_(start_time_ms), 339 start_time_ms_(start_time_ms),
337 run_time_ms_(run_time_ms), 340 run_time_ms_(run_time_ms),
338 creation_time_ms_(clock_->TimeInMilliseconds()), 341 creation_time_ms_(clock_->TimeInMilliseconds()),
339 capturer_(nullptr), 342 capturer_(nullptr),
340 rtp_start_timestamp_set_(false), 343 rtp_start_timestamp_set_(false),
341 rtp_start_timestamp_(0) {} 344 rtp_start_timestamp_(0) {}
342 345
343 private: 346 private:
344 test::PacketTransport* CreateSendTransport(Call* sender_call) override { 347 test::PacketTransport* CreateSendTransport(Call* sender_call) override {
345 return new test::PacketTransport( 348 return new test::PacketTransport(
346 sender_call, this, test::PacketTransport::kSender, net_config_); 349 sender_call, this, test::PacketTransport::kSender, MediaType::VIDEO,
350 net_config_);
347 } 351 }
348 352
349 test::PacketTransport* CreateReceiveTransport() override { 353 test::PacketTransport* CreateReceiveTransport() override {
350 return new test::PacketTransport( 354 return new test::PacketTransport(
351 nullptr, this, test::PacketTransport::kReceiver, net_config_); 355 nullptr, this, test::PacketTransport::kReceiver, MediaType::VIDEO,
356 net_config_);
352 } 357 }
353 358
354 void OnFrame(const VideoFrame& video_frame) override { 359 void OnFrame(const VideoFrame& video_frame) override {
355 rtc::CritScope lock(&crit_); 360 rtc::CritScope lock(&crit_);
356 if (video_frame.ntp_time_ms() <= 0) { 361 if (video_frame.ntp_time_ms() <= 0) {
357 // Haven't got enough RTCP SR in order to calculate the capture ntp 362 // Haven't got enough RTCP SR in order to calculate the capture ntp
358 // time. 363 // time.
359 return; 364 return;
360 } 365 }
361 366
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 uint32_t last_set_bitrate_kbps_; 744 uint32_t last_set_bitrate_kbps_;
740 VideoSendStream* send_stream_; 745 VideoSendStream* send_stream_;
741 test::FrameGeneratorCapturer* frame_generator_; 746 test::FrameGeneratorCapturer* frame_generator_;
742 VideoEncoderConfig encoder_config_; 747 VideoEncoderConfig encoder_config_;
743 } test; 748 } test;
744 749
745 RunBaseTest(&test); 750 RunBaseTest(&test);
746 } 751 }
747 752
748 } // namespace webrtc 753 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/call/rampup_tests.h » ('j') | webrtc/test/direct_transport.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698