| 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 10 matching lines...) Expand all Loading... |
| 21 #include "base/test/simple_test_tick_clock.h" | 21 #include "base/test/simple_test_tick_clock.h" |
| 22 #include "base/time/tick_clock.h" | 22 #include "base/time/tick_clock.h" |
| 23 #include "media/base/video_frame.h" | 23 #include "media/base/video_frame.h" |
| 24 #include "media/cast/cast_config.h" | 24 #include "media/cast/cast_config.h" |
| 25 #include "media/cast/cast_environment.h" | 25 #include "media/cast/cast_environment.h" |
| 26 #include "media/cast/cast_receiver.h" | 26 #include "media/cast/cast_receiver.h" |
| 27 #include "media/cast/cast_sender.h" | 27 #include "media/cast/cast_sender.h" |
| 28 #include "media/cast/logging/simple_event_subscriber.h" | 28 #include "media/cast/logging/simple_event_subscriber.h" |
| 29 #include "media/cast/test/fake_single_thread_task_runner.h" | 29 #include "media/cast/test/fake_single_thread_task_runner.h" |
| 30 #include "media/cast/test/utility/audio_utility.h" | 30 #include "media/cast/test/utility/audio_utility.h" |
| 31 #include "media/cast/test/utility/default_config.h" |
| 31 #include "media/cast/test/utility/video_utility.h" | 32 #include "media/cast/test/utility/video_utility.h" |
| 32 #include "media/cast/transport/cast_transport_config.h" | 33 #include "media/cast/transport/cast_transport_config.h" |
| 33 #include "media/cast/transport/cast_transport_defines.h" | 34 #include "media/cast/transport/cast_transport_defines.h" |
| 34 #include "media/cast/transport/cast_transport_sender.h" | 35 #include "media/cast/transport/cast_transport_sender.h" |
| 35 #include "media/cast/transport/cast_transport_sender_impl.h" | 36 #include "media/cast/transport/cast_transport_sender_impl.h" |
| 36 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
| 37 | 38 |
| 38 namespace media { | 39 namespace media { |
| 39 namespace cast { | 40 namespace cast { |
| 40 | 41 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 &sender_to_receiver_)); | 510 &sender_to_receiver_)); |
| 510 transport_sender_->InitializeAudio(transport_audio_config_); | 511 transport_sender_->InitializeAudio(transport_audio_config_); |
| 511 transport_sender_->InitializeVideo(transport_video_config_); | 512 transport_sender_->InitializeVideo(transport_video_config_); |
| 512 | 513 |
| 513 cast_sender_ = | 514 cast_sender_ = |
| 514 CastSender::Create(cast_environment_sender_, transport_sender_.get()); | 515 CastSender::Create(cast_environment_sender_, transport_sender_.get()); |
| 515 | 516 |
| 516 // Initializing audio and video senders. | 517 // Initializing audio and video senders. |
| 517 cast_sender_->InitializeAudio(audio_sender_config_, | 518 cast_sender_->InitializeAudio(audio_sender_config_, |
| 518 base::Bind(&AudioInitializationStatus)); | 519 base::Bind(&AudioInitializationStatus)); |
| 519 cast_sender_->InitializeVideo( | 520 cast_sender_->InitializeVideo(video_sender_config_, |
| 520 video_sender_config_, base::Bind(&VideoInitializationStatus), NULL); | 521 base::Bind(&VideoInitializationStatus), |
| 522 CreateDefaultVideoEncodeAcceleratorCallback(), |
| 523 CreateDefaultVideoEncodeMemoryCallback()); |
| 521 | 524 |
| 522 receiver_to_sender_.SetPacketReceiver(cast_sender_->packet_receiver()); | 525 receiver_to_sender_.SetPacketReceiver(cast_sender_->packet_receiver()); |
| 523 sender_to_receiver_.SetPacketReceiver(cast_receiver_->packet_receiver()); | 526 sender_to_receiver_.SetPacketReceiver(cast_receiver_->packet_receiver()); |
| 524 | 527 |
| 525 audio_frame_input_ = cast_sender_->audio_frame_input(); | 528 audio_frame_input_ = cast_sender_->audio_frame_input(); |
| 526 video_frame_input_ = cast_sender_->video_frame_input(); | 529 video_frame_input_ = cast_sender_->video_frame_input(); |
| 527 | 530 |
| 528 frame_receiver_ = cast_receiver_->frame_receiver(); | 531 frame_receiver_ = cast_receiver_->frame_receiver(); |
| 529 | 532 |
| 530 audio_bus_factory_.reset( | 533 audio_bus_factory_.reset( |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame); | 1322 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame); |
| 1320 } | 1323 } |
| 1321 | 1324 |
| 1322 // TODO(pwestin): Add repeatable packet loss test. | 1325 // TODO(pwestin): Add repeatable packet loss test. |
| 1323 // TODO(pwestin): Add test for misaligned send get calls. | 1326 // TODO(pwestin): Add test for misaligned send get calls. |
| 1324 // TODO(pwestin): Add more tests that does not resample. | 1327 // TODO(pwestin): Add more tests that does not resample. |
| 1325 // TODO(pwestin): Add test when we have starvation for our RunTask. | 1328 // TODO(pwestin): Add test when we have starvation for our RunTask. |
| 1326 | 1329 |
| 1327 } // namespace cast | 1330 } // namespace cast |
| 1328 } // namespace media | 1331 } // namespace media |
| OLD | NEW |