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

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

Issue 1806313003: Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
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 #include <limits.h> 5 #include <limits.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <climits> 10 #include <climits>
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 int32_t last_audio_frame_no_; 541 int32_t last_audio_frame_no_;
542 }; 542 };
543 543
544 } // namespace cast 544 } // namespace cast
545 } // namespace media 545 } // namespace media
546 546
547 int main(int argc, char** argv) { 547 int main(int argc, char** argv) {
548 base::AtExitManager at_exit; 548 base::AtExitManager at_exit;
549 base::CommandLine::Init(argc, argv); 549 base::CommandLine::Init(argc, argv);
550 InitLogging(logging::LoggingSettings()); 550 InitLogging(logging::LoggingSettings());
551 base::MessageLoop message_loop;
551 552
552 scoped_refptr<media::cast::CastEnvironment> cast_environment( 553 scoped_refptr<media::cast::CastEnvironment> cast_environment(
553 new media::cast::StandaloneCastEnvironment); 554 new media::cast::StandaloneCastEnvironment);
554 555
555 // Start up Chromium audio system. 556 // Start up Chromium audio system.
556 media::FakeAudioLogFactory fake_audio_log_factory_; 557 const media::ScopedAudioManagerPtr audio_manager(
557 const scoped_ptr<media::AudioManager> audio_manager( 558 media::AudioManager::CreateForTesting(
558 media::AudioManager::Create(&fake_audio_log_factory_)); 559 base::ThreadTaskRunnerHandle::Get()));
559 CHECK(media::AudioManager::Get()); 560 CHECK(media::AudioManager::Get());
560 561
561 media::cast::FrameReceiverConfig audio_config = 562 media::cast::FrameReceiverConfig audio_config =
562 media::cast::GetAudioReceiverConfig(); 563 media::cast::GetAudioReceiverConfig();
563 media::cast::FrameReceiverConfig video_config = 564 media::cast::FrameReceiverConfig video_config =
564 media::cast::GetVideoReceiverConfig(); 565 media::cast::GetVideoReceiverConfig();
565 566
566 // Determine local and remote endpoints. 567 // Determine local and remote endpoints.
567 uint16_t remote_port, local_port; 568 uint16_t remote_port, local_port;
568 media::cast::GetPorts(&remote_port, &local_port); 569 media::cast::GetPorts(&remote_port, &local_port);
(...skipping 24 matching lines...) Expand all
593 #endif // defined(USE_X11) 594 #endif // defined(USE_X11)
594 media::cast::NaivePlayer player(cast_environment, 595 media::cast::NaivePlayer player(cast_environment,
595 local_end_point, 596 local_end_point,
596 remote_end_point, 597 remote_end_point,
597 audio_config, 598 audio_config,
598 video_config, 599 video_config,
599 window_width, 600 window_width,
600 window_height); 601 window_height);
601 player.Start(); 602 player.Start();
602 603
603 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). 604 message_loop.Run(); // Run forever (i.e., until SIGTERM).
604 NOTREACHED(); 605 NOTREACHED();
605 return 0; 606 return 0;
606 } 607 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698