| OLD | NEW |
| 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 namespace internal { | 9 namespace internal { |
| 10 extern scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient(); | 10 extern scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient(); |
| 11 } // namespace internal | 11 } // namespace internal |
| 12 | 12 |
| 13 static base::LazyInstance<MojoMediaClient>::Leaky g_mojo_media_client = | 13 static base::LazyInstance<MojoMediaClient>::Leaky g_mojo_media_client = |
| 14 LAZY_INSTANCE_INITIALIZER; | 14 LAZY_INSTANCE_INITIALIZER; |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 MojoMediaClient* MojoMediaClient::Get() { | 17 MojoMediaClient* MojoMediaClient::Get() { |
| 18 return g_mojo_media_client.Pointer(); | 18 return g_mojo_media_client.Pointer(); |
| 19 } | 19 } |
| 20 | 20 |
| 21 scoped_ptr<RendererFactory> MojoMediaClient::GetRendererFactory( |
| 22 const scoped_refptr<MediaLog>& media_log) { |
| 23 return mojo_media_client_->GetRendererFactory(media_log); |
| 24 } |
| 25 |
| 21 ScopedVector<AudioDecoder> MojoMediaClient::GetAudioDecoders( | 26 ScopedVector<AudioDecoder> MojoMediaClient::GetAudioDecoders( |
| 22 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 27 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
| 23 const LogCB& media_log_cb) { | 28 const scoped_refptr<MediaLog>& media_log) { |
| 24 return mojo_media_client_->GetAudioDecoders(media_task_runner, media_log_cb); | 29 return mojo_media_client_->GetAudioDecoders(media_task_runner, media_log); |
| 25 } | 30 } |
| 26 | 31 |
| 27 ScopedVector<VideoDecoder> MojoMediaClient::GetVideoDecoders( | 32 ScopedVector<VideoDecoder> MojoMediaClient::GetVideoDecoders( |
| 28 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 33 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
| 29 const LogCB& media_log_cb) { | 34 const scoped_refptr<MediaLog>& media_log) { |
| 30 return mojo_media_client_->GetVideoDecoders(media_task_runner, media_log_cb); | 35 return mojo_media_client_->GetVideoDecoders(media_task_runner, media_log); |
| 31 } | 36 } |
| 32 | 37 |
| 33 scoped_refptr<AudioRendererSink> MojoMediaClient::GetAudioRendererSink() { | 38 scoped_refptr<AudioRendererSink> MojoMediaClient::GetAudioRendererSink() { |
| 34 return mojo_media_client_->GetAudioRendererSink(); | 39 return mojo_media_client_->GetAudioRendererSink(); |
| 35 } | 40 } |
| 36 | 41 |
| 37 scoped_ptr<VideoRendererSink> MojoMediaClient::GetVideoRendererSink( | 42 scoped_ptr<VideoRendererSink> MojoMediaClient::GetVideoRendererSink( |
| 38 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { | 43 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { |
| 39 return mojo_media_client_->GetVideoRendererSink(task_runner); | 44 return mojo_media_client_->GetVideoRendererSink(task_runner); |
| 40 } | 45 } |
| 41 | 46 |
| 42 const AudioHardwareConfig& MojoMediaClient::GetAudioHardwareConfig() { | 47 const AudioHardwareConfig& MojoMediaClient::GetAudioHardwareConfig() { |
| 43 return mojo_media_client_->GetAudioHardwareConfig(); | 48 return mojo_media_client_->GetAudioHardwareConfig(); |
| 44 } | 49 } |
| 45 | 50 |
| 46 MojoMediaClient::MojoMediaClient() | 51 MojoMediaClient::MojoMediaClient() |
| 47 : mojo_media_client_(internal::CreatePlatformMojoMediaClient().Pass()) { | 52 : mojo_media_client_(internal::CreatePlatformMojoMediaClient().Pass()) { |
| 48 } | 53 } |
| 49 | 54 |
| 50 MojoMediaClient::~MojoMediaClient() { | 55 MojoMediaClient::~MojoMediaClient() { |
| 51 } | 56 } |
| 52 | 57 |
| 53 } // namespace media | 58 } // namespace media |
| OLD | NEW |