This sets up API to release OutputSurface from LTHClient.
[chromium-blink-merge.git] / media / mojo / services / mojo_media_client.cc
blobfb7e7ad90e9f7bd50b23fcc7651a216dc7ee7690
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
3 // found in the LICENSE file.
5 #include "media/mojo/services/mojo_media_client.h"
7 namespace media {
9 namespace internal {
10 extern scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient();
11 } // namespace internal
13 static base::LazyInstance<MojoMediaClient>::Leaky g_mojo_media_client =
14 LAZY_INSTANCE_INITIALIZER;
16 // static
17 MojoMediaClient* MojoMediaClient::Get() {
18 return g_mojo_media_client.Pointer();
21 scoped_ptr<RendererFactory> MojoMediaClient::CreateRendererFactory(
22 const scoped_refptr<MediaLog>& media_log) {
23 return mojo_media_client_->CreateRendererFactory(media_log);
26 ScopedVector<AudioDecoder> MojoMediaClient::CreateAudioDecoders(
27 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
28 const scoped_refptr<MediaLog>& media_log) {
29 return mojo_media_client_->CreateAudioDecoders(media_task_runner, media_log);
32 ScopedVector<VideoDecoder> MojoMediaClient::CreateVideoDecoders(
33 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
34 const scoped_refptr<MediaLog>& media_log) {
35 return mojo_media_client_->CreateVideoDecoders(media_task_runner, media_log);
38 scoped_refptr<AudioRendererSink> MojoMediaClient::CreateAudioRendererSink() {
39 return mojo_media_client_->CreateAudioRendererSink();
42 scoped_ptr<VideoRendererSink> MojoMediaClient::CreateVideoRendererSink(
43 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
44 return mojo_media_client_->CreateVideoRendererSink(task_runner);
47 const AudioHardwareConfig& MojoMediaClient::GetAudioHardwareConfig() {
48 return mojo_media_client_->GetAudioHardwareConfig();
51 scoped_ptr<CdmFactory> MojoMediaClient::CreateCdmFactory() {
52 return mojo_media_client_->CreateCdmFactory();
55 MojoMediaClient::MojoMediaClient()
56 : mojo_media_client_(internal::CreatePlatformMojoMediaClient().Pass()) {
59 MojoMediaClient::~MojoMediaClient() {
62 } // namespace media