OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 media_type = MediaType::VIDEO; | 44 media_type = MediaType::VIDEO; |
45 } else { | 45 } else { |
46 media_type = MediaType::AUDIO; | 46 media_type = MediaType::AUDIO; |
47 } | 47 } |
48 } | 48 } |
49 return receiver_->DeliverPacket(media_type, packet, length, packet_time); | 49 return receiver_->DeliverPacket(media_type, packet, length, packet_time); |
50 } | 50 } |
51 | 51 |
52 CallTest::CallTest() | 52 CallTest::CallTest() |
53 : clock_(Clock::GetRealTimeClock()), | 53 : clock_(Clock::GetRealTimeClock()), |
| 54 event_log_(RtcEventLog::CreateNull()), |
54 video_send_config_(nullptr), | 55 video_send_config_(nullptr), |
55 video_send_stream_(nullptr), | 56 video_send_stream_(nullptr), |
56 audio_send_config_(nullptr), | 57 audio_send_config_(nullptr), |
57 audio_send_stream_(nullptr), | 58 audio_send_stream_(nullptr), |
58 fake_encoder_(clock_), | 59 fake_encoder_(clock_), |
59 num_video_streams_(1), | 60 num_video_streams_(1), |
60 num_audio_streams_(0), | 61 num_audio_streams_(0), |
61 num_flexfec_streams_(0), | 62 num_flexfec_streams_(0), |
62 decoder_factory_(CreateBuiltinAudioDecoderFactory()), | 63 decoder_factory_(CreateBuiltinAudioDecoderFactory()), |
63 fake_send_audio_device_(nullptr), | 64 fake_send_audio_device_(nullptr), |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 const uint32_t CallTest::kSendRtxSsrcs[kNumSsrcs] = {0xBADCAFD, 0xBADCAFE, | 455 const uint32_t CallTest::kSendRtxSsrcs[kNumSsrcs] = {0xBADCAFD, 0xBADCAFE, |
455 0xBADCAFF}; | 456 0xBADCAFF}; |
456 const uint32_t CallTest::kVideoSendSsrcs[kNumSsrcs] = {0xC0FFED, 0xC0FFEE, | 457 const uint32_t CallTest::kVideoSendSsrcs[kNumSsrcs] = {0xC0FFED, 0xC0FFEE, |
457 0xC0FFEF}; | 458 0xC0FFEF}; |
458 const uint32_t CallTest::kAudioSendSsrc = 0xDEADBEEF; | 459 const uint32_t CallTest::kAudioSendSsrc = 0xDEADBEEF; |
459 const uint32_t CallTest::kFlexfecSendSsrc = 0xBADBEEF; | 460 const uint32_t CallTest::kFlexfecSendSsrc = 0xBADBEEF; |
460 const uint32_t CallTest::kReceiverLocalVideoSsrc = 0x123456; | 461 const uint32_t CallTest::kReceiverLocalVideoSsrc = 0x123456; |
461 const uint32_t CallTest::kReceiverLocalAudioSsrc = 0x1234567; | 462 const uint32_t CallTest::kReceiverLocalAudioSsrc = 0x1234567; |
462 const int CallTest::kNackRtpHistoryMs = 1000; | 463 const int CallTest::kNackRtpHistoryMs = 1000; |
463 | 464 |
464 BaseTest::BaseTest() {} | 465 BaseTest::BaseTest() : event_log_(RtcEventLog::CreateNull()) {} |
465 | 466 |
466 BaseTest::BaseTest(unsigned int timeout_ms) : RtpRtcpObserver(timeout_ms) { | 467 BaseTest::BaseTest(unsigned int timeout_ms) |
467 } | 468 : RtpRtcpObserver(timeout_ms), event_log_(RtcEventLog::CreateNull()) {} |
468 | 469 |
469 BaseTest::~BaseTest() { | 470 BaseTest::~BaseTest() { |
470 } | 471 } |
471 | 472 |
472 std::unique_ptr<FakeAudioDevice::Capturer> BaseTest::CreateCapturer() { | 473 std::unique_ptr<FakeAudioDevice::Capturer> BaseTest::CreateCapturer() { |
473 return FakeAudioDevice::CreatePulsedNoiseCapturer(256, 48000); | 474 return FakeAudioDevice::CreatePulsedNoiseCapturer(256, 48000); |
474 } | 475 } |
475 | 476 |
476 std::unique_ptr<FakeAudioDevice::Renderer> BaseTest::CreateRenderer() { | 477 std::unique_ptr<FakeAudioDevice::Renderer> BaseTest::CreateRenderer() { |
477 return FakeAudioDevice::CreateDiscardRenderer(48000); | 478 return FakeAudioDevice::CreateDiscardRenderer(48000); |
478 } | 479 } |
479 | 480 |
480 void BaseTest::OnFakeAudioDevicesCreated(FakeAudioDevice* send_audio_device, | 481 void BaseTest::OnFakeAudioDevicesCreated(FakeAudioDevice* send_audio_device, |
481 FakeAudioDevice* recv_audio_device) { | 482 FakeAudioDevice* recv_audio_device) { |
482 } | 483 } |
483 | 484 |
484 Call::Config BaseTest::GetSenderCallConfig() { | 485 Call::Config BaseTest::GetSenderCallConfig() { |
485 return Call::Config(&event_log_); | 486 return Call::Config(event_log_.get()); |
486 } | 487 } |
487 | 488 |
488 Call::Config BaseTest::GetReceiverCallConfig() { | 489 Call::Config BaseTest::GetReceiverCallConfig() { |
489 return Call::Config(&event_log_); | 490 return Call::Config(event_log_.get()); |
490 } | 491 } |
491 | 492 |
492 void BaseTest::OnCallsCreated(Call* sender_call, Call* receiver_call) { | 493 void BaseTest::OnCallsCreated(Call* sender_call, Call* receiver_call) { |
493 } | 494 } |
494 | 495 |
495 MediaType BaseTest::SelectMediaType() { | 496 MediaType BaseTest::SelectMediaType() { |
496 if (GetNumVideoStreams() > 0) { | 497 if (GetNumVideoStreams() > 0) { |
497 if (GetNumAudioStreams() > 0) { | 498 if (GetNumAudioStreams() > 0) { |
498 // Relies on PayloadDemuxer to set media type from payload type. | 499 // Relies on PayloadDemuxer to set media type from payload type. |
499 return MediaType::ANY; | 500 return MediaType::ANY; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 575 |
575 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 576 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
576 } | 577 } |
577 | 578 |
578 bool EndToEndTest::ShouldCreateReceivers() const { | 579 bool EndToEndTest::ShouldCreateReceivers() const { |
579 return true; | 580 return true; |
580 } | 581 } |
581 | 582 |
582 } // namespace test | 583 } // namespace test |
583 } // namespace webrtc | 584 } // namespace webrtc |
OLD | NEW |