| 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/renderer_config.h" | 5 #include "media/mojo/services/renderer_config.h" |
| 6 | 6 |
| 7 namespace media { | 7 namespace media { |
| 8 | 8 |
| 9 namespace internal { | 9 namespace internal { |
| 10 extern scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig(); | 10 extern scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig(); |
| 11 } // namespace internal | 11 } // namespace internal |
| 12 | 12 |
| 13 static base::LazyInstance<RendererConfig>::Leaky g_platform_config = |
| 14 LAZY_INSTANCE_INITIALIZER; |
| 15 |
| 13 // static | 16 // static |
| 14 RendererConfig* RendererConfig::Get() { | 17 RendererConfig* RendererConfig::Get() { |
| 15 static base::LazyInstance<RendererConfig>::Leaky li = | 18 return g_platform_config.Pointer(); |
| 16 LAZY_INSTANCE_INITIALIZER; | |
| 17 return li.Pointer(); | |
| 18 } | 19 } |
| 19 | 20 |
| 20 ScopedVector<AudioDecoder> RendererConfig::GetAudioDecoders( | 21 ScopedVector<AudioDecoder> RendererConfig::GetAudioDecoders( |
| 21 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 22 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
| 22 const LogCB& media_log_cb) { | 23 const LogCB& media_log_cb) { |
| 23 return renderer_config_->GetAudioDecoders(media_task_runner, media_log_cb); | 24 return renderer_config_->GetAudioDecoders(media_task_runner, media_log_cb); |
| 24 } | 25 } |
| 25 | 26 |
| 26 ScopedVector<VideoDecoder> RendererConfig::GetVideoDecoders( | 27 ScopedVector<VideoDecoder> RendererConfig::GetVideoDecoders( |
| 27 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 28 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 38 } | 39 } |
| 39 | 40 |
| 40 RendererConfig::RendererConfig() | 41 RendererConfig::RendererConfig() |
| 41 : renderer_config_(internal::CreatePlatformRendererConfig().Pass()) { | 42 : renderer_config_(internal::CreatePlatformRendererConfig().Pass()) { |
| 42 } | 43 } |
| 43 | 44 |
| 44 RendererConfig::~RendererConfig() { | 45 RendererConfig::~RendererConfig() { |
| 45 } | 46 } |
| 46 | 47 |
| 47 } // namespace media | 48 } // namespace media |
| OLD | NEW |