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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 return Call::Config(&event_log_); | 485 return Call::Config(&event_log_); |
486 } | 486 } |
487 | 487 |
488 Call::Config BaseTest::GetReceiverCallConfig() { | 488 Call::Config BaseTest::GetReceiverCallConfig() { |
489 return Call::Config(&event_log_); | 489 return Call::Config(&event_log_); |
490 } | 490 } |
491 | 491 |
492 void BaseTest::OnCallsCreated(Call* sender_call, Call* receiver_call) { | 492 void BaseTest::OnCallsCreated(Call* sender_call, Call* receiver_call) { |
493 } | 493 } |
494 | 494 |
| 495 MediaType BaseTest::SelectMediaType() { |
| 496 if (GetNumVideoStreams() > 0) { |
| 497 if (GetNumAudioStreams() > 0) { |
| 498 // Relies on PayloadDemuxer to set media type from payload type. |
| 499 return MediaType::ANY; |
| 500 } else { |
| 501 return MediaType::VIDEO; |
| 502 } |
| 503 } else { |
| 504 return MediaType::AUDIO; |
| 505 } |
| 506 } |
| 507 |
495 test::PacketTransport* BaseTest::CreateSendTransport(Call* sender_call) { | 508 test::PacketTransport* BaseTest::CreateSendTransport(Call* sender_call) { |
496 return new PacketTransport(sender_call, this, test::PacketTransport::kSender, | 509 return new PacketTransport(sender_call, this, test::PacketTransport::kSender, |
497 MediaType::VIDEO, | 510 SelectMediaType(), |
498 FakeNetworkPipe::Config()); | 511 FakeNetworkPipe::Config()); |
499 } | 512 } |
500 | 513 |
501 test::PacketTransport* BaseTest::CreateReceiveTransport() { | 514 test::PacketTransport* BaseTest::CreateReceiveTransport() { |
502 return new PacketTransport(nullptr, this, test::PacketTransport::kReceiver, | 515 return new PacketTransport(nullptr, this, test::PacketTransport::kReceiver, |
503 MediaType::VIDEO, | 516 SelectMediaType(), |
504 FakeNetworkPipe::Config()); | 517 FakeNetworkPipe::Config()); |
505 } | 518 } |
506 | 519 |
507 size_t BaseTest::GetNumVideoStreams() const { | 520 size_t BaseTest::GetNumVideoStreams() const { |
508 return 1; | 521 return 1; |
509 } | 522 } |
510 | 523 |
511 size_t BaseTest::GetNumAudioStreams() const { | 524 size_t BaseTest::GetNumAudioStreams() const { |
512 return 0; | 525 return 0; |
513 } | 526 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 | 574 |
562 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 575 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
563 } | 576 } |
564 | 577 |
565 bool EndToEndTest::ShouldCreateReceivers() const { | 578 bool EndToEndTest::ShouldCreateReceivers() const { |
566 return true; | 579 return true; |
567 } | 580 } |
568 | 581 |
569 } // namespace test | 582 } // namespace test |
570 } // namespace webrtc | 583 } // namespace webrtc |
OLD | NEW |