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

Unified Diff: media/mojo/services/test_mojo_media_client.cc

Issue 2299703005: Rename TestMojoMediaClient -> DefaultMojoMediaClient. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/services/test_mojo_media_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/test_mojo_media_client.cc
diff --git a/media/mojo/services/test_mojo_media_client.cc b/media/mojo/services/test_mojo_media_client.cc
deleted file mode 100644
index 4b11fd70131eab5d7f1a49b71c9d5b85fc774c6c..0000000000000000000000000000000000000000
--- a/media/mojo/services/test_mojo_media_client.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "media/mojo/services/test_mojo_media_client.h"
-
-#include "base/memory/ptr_util.h"
-#include "base/message_loop/message_loop.h"
-#include "base/run_loop.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "media/audio/audio_device_description.h"
-#include "media/audio/audio_manager.h"
-#include "media/audio/audio_output_stream_sink.h"
-#include "media/base/cdm_factory.h"
-#include "media/base/media.h"
-#include "media/base/media_log.h"
-#include "media/base/null_video_sink.h"
-#include "media/base/renderer_factory.h"
-#include "media/cdm/default_cdm_factory.h"
-#include "media/renderers/default_renderer_factory.h"
-#include "media/renderers/gpu_video_accelerator_factories.h"
-
-namespace media {
-
-TestMojoMediaClient::TestMojoMediaClient() {}
-
-TestMojoMediaClient::~TestMojoMediaClient() {
- DVLOG(1) << __FUNCTION__;
- // AudioManager destructor requires MessageLoop.
- // Destroy it before the message loop goes away.
- audio_manager_.reset();
- // Flush the message loop to ensure that the audio manager is destroyed.
- base::RunLoop().RunUntilIdle();
-}
-
-void TestMojoMediaClient::Initialize() {
- InitializeMediaLibrary();
- // TODO(dalecurtis): We should find a single owner per process for the audio
- // manager or make it a lazy instance. It's not safe to call Get()/Create()
- // across multiple threads...
- AudioManager* audio_manager = AudioManager::Get();
- if (!audio_manager) {
- audio_manager_ = media::AudioManager::CreateForTesting(
- base::ThreadTaskRunnerHandle::Get());
- audio_manager = audio_manager_.get();
- // Flush the message loop to ensure that the audio manager is initialized.
- base::RunLoop().RunUntilIdle();
- }
-}
-
-scoped_refptr<AudioRendererSink> TestMojoMediaClient::CreateAudioRendererSink(
- const std::string& /* audio_device_id */) {
- return new AudioOutputStreamSink();
-}
-
-std::unique_ptr<VideoRendererSink> TestMojoMediaClient::CreateVideoRendererSink(
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
- return base::MakeUnique<NullVideoSink>(
- false, base::TimeDelta::FromSecondsD(1.0 / 60),
- NullVideoSink::NewFrameCB(), task_runner);
-}
-
-std::unique_ptr<RendererFactory> TestMojoMediaClient::CreateRendererFactory(
- const scoped_refptr<MediaLog>& media_log) {
- return base::MakeUnique<DefaultRendererFactory>(
- std::move(media_log), nullptr,
- DefaultRendererFactory::GetGpuFactoriesCB());
-}
-
-std::unique_ptr<CdmFactory> TestMojoMediaClient::CreateCdmFactory(
- shell::mojom::InterfaceProvider* /* interface_provider */) {
- DVLOG(1) << __FUNCTION__;
- return base::MakeUnique<DefaultCdmFactory>();
-}
-
-} // namespace media
« no previous file with comments | « media/mojo/services/test_mojo_media_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698