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

Side by Side Diff: media/cast/test/end2end_unittest.cc

Issue 207593002: Cast: Enable use of VideoEncodeAccelerator for hardware video encoding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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
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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 &sender_to_receiver_)); 514 &sender_to_receiver_));
514 transport_sender_->InitializeAudio(transport_audio_config_); 515 transport_sender_->InitializeAudio(transport_audio_config_);
515 transport_sender_->InitializeVideo(transport_video_config_); 516 transport_sender_->InitializeVideo(transport_video_config_);
516 517
517 cast_sender_ = 518 cast_sender_ =
518 CastSender::Create(cast_environment_sender_, transport_sender_.get()); 519 CastSender::Create(cast_environment_sender_, transport_sender_.get());
519 520
520 // Initializing audio and video senders. 521 // Initializing audio and video senders.
521 cast_sender_->InitializeAudio(audio_sender_config_, 522 cast_sender_->InitializeAudio(audio_sender_config_,
522 base::Bind(&AudioInitializationStatus)); 523 base::Bind(&AudioInitializationStatus));
523 cast_sender_->InitializeVideo( 524 cast_sender_->InitializeVideo(video_sender_config_,
524 video_sender_config_, base::Bind(&VideoInitializationStatus), NULL); 525 base::Bind(&VideoInitializationStatus),
526 CreateDefaultVideoEncodeAcceleratorCallback(),
527 CreateDefaultVideoEncodeMemoryCallback());
525 528
526 receiver_to_sender_.SetPacketReceiver(cast_sender_->packet_receiver()); 529 receiver_to_sender_.SetPacketReceiver(cast_sender_->packet_receiver());
527 sender_to_receiver_.SetPacketReceiver(cast_receiver_->packet_receiver()); 530 sender_to_receiver_.SetPacketReceiver(cast_receiver_->packet_receiver());
528 531
529 audio_frame_input_ = cast_sender_->audio_frame_input(); 532 audio_frame_input_ = cast_sender_->audio_frame_input();
530 video_frame_input_ = cast_sender_->video_frame_input(); 533 video_frame_input_ = cast_sender_->video_frame_input();
531 534
532 frame_receiver_ = cast_receiver_->frame_receiver(); 535 frame_receiver_ = cast_receiver_->frame_receiver();
533 536
534 audio_bus_factory_.reset( 537 audio_bus_factory_.reset(
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame); 1326 EXPECT_EQ(total_event_count_for_frame, expected_event_count_for_frame);
1324 } 1327 }
1325 1328
1326 // TODO(pwestin): Add repeatable packet loss test. 1329 // TODO(pwestin): Add repeatable packet loss test.
1327 // TODO(pwestin): Add test for misaligned send get calls. 1330 // TODO(pwestin): Add test for misaligned send get calls.
1328 // TODO(pwestin): Add more tests that does not resample. 1331 // TODO(pwestin): Add more tests that does not resample.
1329 // TODO(pwestin): Add test when we have starvation for our RunTask. 1332 // TODO(pwestin): Add test when we have starvation for our RunTask.
1330 1333
1331 } // namespace cast 1334 } // namespace cast
1332 } // namespace media 1335 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698