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

Side by Side Diff: media/mojo/services/mojo_media_client.cc

Issue 1529063004: Pass MojoMediaClient instance to MojoMediaApplication constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added bug number Created 5 years 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
« no previous file with comments | « media/mojo/services/mojo_media_client.h ('k') | media/mojo/services/service_factory_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/mojo/services/mojo_media_client.h" 5 #include "media/mojo/services/mojo_media_client.h"
6 6
7 namespace media { 7 namespace media {
8 8
9 // PlatformMojoMediaClient default implementations. 9 // PlatformMojoMediaClient default implementations.
10 10
11 PlatformMojoMediaClient::~PlatformMojoMediaClient(){}; 11 PlatformMojoMediaClient::~PlatformMojoMediaClient(){};
12 12
13 void PlatformMojoMediaClient::Initialize() {}
14
13 scoped_ptr<RendererFactory> PlatformMojoMediaClient::CreateRendererFactory( 15 scoped_ptr<RendererFactory> PlatformMojoMediaClient::CreateRendererFactory(
14 const scoped_refptr<MediaLog>& media_log) { 16 const scoped_refptr<MediaLog>& media_log) {
15 return nullptr; 17 return nullptr;
16 }; 18 };
17 19
18 scoped_refptr<AudioRendererSink> 20 scoped_refptr<AudioRendererSink>
19 PlatformMojoMediaClient::CreateAudioRendererSink() { 21 PlatformMojoMediaClient::CreateAudioRendererSink() {
20 return nullptr; 22 return nullptr;
21 }; 23 };
22 24
23 scoped_ptr<VideoRendererSink> PlatformMojoMediaClient::CreateVideoRendererSink( 25 scoped_ptr<VideoRendererSink> PlatformMojoMediaClient::CreateVideoRendererSink(
24 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { 26 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
25 return nullptr; 27 return nullptr;
26 } 28 }
27 29
28 scoped_ptr<CdmFactory> PlatformMojoMediaClient::CreateCdmFactory( 30 scoped_ptr<CdmFactory> PlatformMojoMediaClient::CreateCdmFactory(
29 mojo::ServiceProvider* service_provider) { 31 mojo::ServiceProvider* service_provider) {
30 return nullptr; 32 return nullptr;
31 } 33 }
32 34
33 namespace internal { 35 namespace internal {
34 extern scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient(); 36 extern scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient();
35 } // namespace internal 37 } // namespace internal
36 38
37 static base::LazyInstance<MojoMediaClient>::Leaky g_mojo_media_client = 39 // static
38 LAZY_INSTANCE_INITIALIZER; 40 scoped_ptr<MojoMediaClient> MojoMediaClient::Create() {
41 return make_scoped_ptr(
42 new MojoMediaClient(internal::CreatePlatformMojoMediaClient()));
43 }
39 44
40 // static 45 void MojoMediaClient::Initialize() {
41 MojoMediaClient* MojoMediaClient::Get() { 46 platform_client_->Initialize();
42 return g_mojo_media_client.Pointer();
43 } 47 }
44 48
45 scoped_ptr<RendererFactory> MojoMediaClient::CreateRendererFactory( 49 scoped_ptr<RendererFactory> MojoMediaClient::CreateRendererFactory(
46 const scoped_refptr<MediaLog>& media_log) { 50 const scoped_refptr<MediaLog>& media_log) {
47 return mojo_media_client_->CreateRendererFactory(media_log); 51 return platform_client_->CreateRendererFactory(media_log);
48 } 52 }
49 53
50 scoped_refptr<AudioRendererSink> MojoMediaClient::CreateAudioRendererSink() { 54 scoped_refptr<AudioRendererSink> MojoMediaClient::CreateAudioRendererSink() {
51 return mojo_media_client_->CreateAudioRendererSink(); 55 return platform_client_->CreateAudioRendererSink();
52 } 56 }
53 57
54 scoped_ptr<VideoRendererSink> MojoMediaClient::CreateVideoRendererSink( 58 scoped_ptr<VideoRendererSink> MojoMediaClient::CreateVideoRendererSink(
55 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { 59 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
56 return mojo_media_client_->CreateVideoRendererSink(task_runner); 60 return platform_client_->CreateVideoRendererSink(task_runner);
57 } 61 }
58 62
59 scoped_ptr<CdmFactory> MojoMediaClient::CreateCdmFactory( 63 scoped_ptr<CdmFactory> MojoMediaClient::CreateCdmFactory(
60 mojo::ServiceProvider* service_provider) { 64 mojo::ServiceProvider* service_provider) {
61 return mojo_media_client_->CreateCdmFactory(service_provider); 65 return platform_client_->CreateCdmFactory(service_provider);
62 } 66 }
63 67
64 MojoMediaClient::MojoMediaClient() 68 MojoMediaClient::MojoMediaClient(
65 : mojo_media_client_(internal::CreatePlatformMojoMediaClient()) { 69 scoped_ptr<PlatformMojoMediaClient> platform_client)
66 DCHECK(mojo_media_client_); 70 : platform_client_(std::move(platform_client)) {
71 DCHECK(platform_client_);
67 } 72 }
68 73
69 MojoMediaClient::~MojoMediaClient() { 74 MojoMediaClient::~MojoMediaClient() {
70 } 75 }
71 76
72 } // namespace media 77 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_media_client.h ('k') | media/mojo/services/service_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698