OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This test generate synthetic data. For audio it's a sinusoid waveform with | 5 // This test generate synthetic data. For audio it's a sinusoid waveform with |
6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern | 6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern |
7 // that is shifting by one pixel per frame, each pixels neighbors right and down | 7 // that is shifting by one pixel per frame, each pixels neighbors right and down |
8 // is this pixels value +1, since the pixel value is 8 bit it will wrap | 8 // is this pixels value +1, since the pixel value is 8 bit it will wrap |
9 // frequently within the image. Visually this will create diagonally color bands | 9 // frequently within the image. Visually this will create diagonally color bands |
10 // that moves across the screen | 10 // that moves across the screen |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 463 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
464 cast_environment_sender_->Logging()->AddRawEventSubscriber( | 464 cast_environment_sender_->Logging()->AddRawEventSubscriber( |
465 &event_subscriber_sender_); | 465 &event_subscriber_sender_); |
466 } | 466 } |
467 | 467 |
468 void Configure(Codec video_codec, | 468 void Configure(Codec video_codec, |
469 Codec audio_codec, | 469 Codec audio_codec, |
470 int audio_sampling_frequency, | 470 int audio_sampling_frequency, |
471 int max_number_of_video_buffers_used) { | 471 int max_number_of_video_buffers_used) { |
472 audio_sender_config_.ssrc = 1; | 472 audio_sender_config_.ssrc = 1; |
473 audio_sender_config_.incoming_feedback_ssrc = 2; | 473 audio_sender_config_.receiver_ssrc = 2; |
474 audio_sender_config_.max_playout_delay = | 474 audio_sender_config_.max_playout_delay = |
475 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs); | 475 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs); |
476 audio_sender_config_.rtp_payload_type = 96; | 476 audio_sender_config_.rtp_payload_type = 96; |
477 audio_sender_config_.use_external_encoder = false; | 477 audio_sender_config_.use_external_encoder = false; |
478 audio_sender_config_.frequency = audio_sampling_frequency; | 478 audio_sender_config_.frequency = audio_sampling_frequency; |
479 audio_sender_config_.channels = kAudioChannels; | 479 audio_sender_config_.channels = kAudioChannels; |
480 audio_sender_config_.bitrate = kDefaultAudioEncoderBitrate; | 480 audio_sender_config_.bitrate = kDefaultAudioEncoderBitrate; |
481 audio_sender_config_.codec = audio_codec; | 481 audio_sender_config_.codec = audio_codec; |
482 | 482 |
483 audio_receiver_config_.feedback_ssrc = | 483 audio_receiver_config_.feedback_ssrc = |
484 audio_sender_config_.incoming_feedback_ssrc; | 484 audio_sender_config_.receiver_ssrc; |
485 audio_receiver_config_.incoming_ssrc = audio_sender_config_.ssrc; | 485 audio_receiver_config_.incoming_ssrc = audio_sender_config_.ssrc; |
486 audio_receiver_config_.rtp_max_delay_ms = kTargetPlayoutDelayMs; | 486 audio_receiver_config_.rtp_max_delay_ms = kTargetPlayoutDelayMs; |
487 audio_receiver_config_.rtp_payload_type = | 487 audio_receiver_config_.rtp_payload_type = |
488 audio_sender_config_.rtp_payload_type; | 488 audio_sender_config_.rtp_payload_type; |
489 audio_receiver_config_.frequency = audio_sender_config_.frequency; | 489 audio_receiver_config_.frequency = audio_sender_config_.frequency; |
490 audio_receiver_config_.channels = kAudioChannels; | 490 audio_receiver_config_.channels = kAudioChannels; |
491 audio_receiver_config_.max_frame_rate = 100; | 491 audio_receiver_config_.max_frame_rate = 100; |
492 audio_receiver_config_.codec = audio_sender_config_.codec; | 492 audio_receiver_config_.codec = audio_sender_config_.codec; |
493 | 493 |
494 test_receiver_audio_callback_->SetExpectedSamplingFrequency( | 494 test_receiver_audio_callback_->SetExpectedSamplingFrequency( |
495 audio_receiver_config_.frequency); | 495 audio_receiver_config_.frequency); |
496 | 496 |
497 video_sender_config_.ssrc = 3; | 497 video_sender_config_.ssrc = 3; |
498 video_sender_config_.incoming_feedback_ssrc = 4; | 498 video_sender_config_.receiver_ssrc = 4; |
499 video_sender_config_.max_playout_delay = | 499 video_sender_config_.max_playout_delay = |
500 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs); | 500 base::TimeDelta::FromMilliseconds(kTargetPlayoutDelayMs); |
501 video_sender_config_.rtp_payload_type = 97; | 501 video_sender_config_.rtp_payload_type = 97; |
502 video_sender_config_.use_external_encoder = false; | 502 video_sender_config_.use_external_encoder = false; |
503 video_sender_config_.width = kVideoHdWidth; | 503 video_sender_config_.width = kVideoHdWidth; |
504 video_sender_config_.height = kVideoHdHeight; | 504 video_sender_config_.height = kVideoHdHeight; |
505 video_sender_config_.max_bitrate = 50000; | 505 video_sender_config_.max_bitrate = 50000; |
506 video_sender_config_.min_bitrate = 10000; | 506 video_sender_config_.min_bitrate = 10000; |
507 video_sender_config_.start_bitrate = 10000; | 507 video_sender_config_.start_bitrate = 10000; |
508 video_sender_config_.max_qp = 30; | 508 video_sender_config_.max_qp = 30; |
509 video_sender_config_.min_qp = 4; | 509 video_sender_config_.min_qp = 4; |
510 video_sender_config_.max_frame_rate = 30; | 510 video_sender_config_.max_frame_rate = 30; |
511 video_sender_config_.max_number_of_video_buffers_used = | 511 video_sender_config_.max_number_of_video_buffers_used = |
512 max_number_of_video_buffers_used; | 512 max_number_of_video_buffers_used; |
513 video_sender_config_.codec = video_codec; | 513 video_sender_config_.codec = video_codec; |
514 | 514 |
515 video_receiver_config_.feedback_ssrc = | 515 video_receiver_config_.feedback_ssrc = |
516 video_sender_config_.incoming_feedback_ssrc; | 516 video_sender_config_.receiver_ssrc; |
517 video_receiver_config_.incoming_ssrc = video_sender_config_.ssrc; | 517 video_receiver_config_.incoming_ssrc = video_sender_config_.ssrc; |
518 video_receiver_config_.rtp_max_delay_ms = kTargetPlayoutDelayMs; | 518 video_receiver_config_.rtp_max_delay_ms = kTargetPlayoutDelayMs; |
519 video_receiver_config_.rtp_payload_type = | 519 video_receiver_config_.rtp_payload_type = |
520 video_sender_config_.rtp_payload_type; | 520 video_sender_config_.rtp_payload_type; |
521 video_receiver_config_.frequency = kVideoFrequency; | 521 video_receiver_config_.frequency = kVideoFrequency; |
522 video_receiver_config_.channels = 1; | 522 video_receiver_config_.channels = 1; |
523 video_receiver_config_.max_frame_rate = video_sender_config_.max_frame_rate; | 523 video_receiver_config_.max_frame_rate = video_sender_config_.max_frame_rate; |
524 video_receiver_config_.codec = video_sender_config_.codec; | 524 video_receiver_config_.codec = video_sender_config_.codec; |
525 } | 525 } |
526 | 526 |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 EXPECT_LT(jump, 220u); | 1505 EXPECT_LT(jump, 220u); |
1506 } | 1506 } |
1507 | 1507 |
1508 // TODO(pwestin): Add repeatable packet loss test. | 1508 // TODO(pwestin): Add repeatable packet loss test. |
1509 // TODO(pwestin): Add test for misaligned send get calls. | 1509 // TODO(pwestin): Add test for misaligned send get calls. |
1510 // TODO(pwestin): Add more tests that does not resample. | 1510 // TODO(pwestin): Add more tests that does not resample. |
1511 // TODO(pwestin): Add test when we have starvation for our RunTask. | 1511 // TODO(pwestin): Add test when we have starvation for our RunTask. |
1512 | 1512 |
1513 } // namespace cast | 1513 } // namespace cast |
1514 } // namespace media | 1514 } // namespace media |
OLD | NEW |