| 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 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "media/audio/audio_manager_base.h" | 8 #include "media/audio/audio_manager_base.h" |
| 9 #include "media/audio/audio_output_stream_sink.h" | 9 #include "media/audio/audio_output_stream_sink.h" |
| 10 #include "media/audio/fake_audio_log_factory.h" | 10 #include "media/audio/fake_audio_log_factory.h" |
| 11 #include "media/base/audio_hardware_config.h" |
| 11 #include "media/base/media.h" | 12 #include "media/base/media.h" |
| 12 #include "media/base/null_video_sink.h" | 13 #include "media/base/null_video_sink.h" |
| 13 #include "media/cdm/default_cdm_factory.h" | 14 #include "media/cdm/default_cdm_factory.h" |
| 14 #include "media/renderers/default_renderer_factory.h" | 15 #include "media/renderers/default_renderer_factory.h" |
| 15 #include "media/renderers/gpu_video_accelerator_factories.h" | 16 #include "media/renderers/gpu_video_accelerator_factories.h" |
| 16 | 17 |
| 17 namespace media { | 18 namespace media { |
| 18 namespace internal { | 19 namespace internal { |
| 19 | 20 |
| 20 class DefaultMojoMediaClient : public PlatformMojoMediaClient { | 21 class DefaultMojoMediaClient : public PlatformMojoMediaClient { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 48 return new AudioOutputStreamSink(); | 49 return new AudioOutputStreamSink(); |
| 49 } | 50 } |
| 50 | 51 |
| 51 scoped_ptr<VideoRendererSink> CreateVideoRendererSink( | 52 scoped_ptr<VideoRendererSink> CreateVideoRendererSink( |
| 52 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) override { | 53 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) override { |
| 53 return make_scoped_ptr( | 54 return make_scoped_ptr( |
| 54 new NullVideoSink(false, base::TimeDelta::FromSecondsD(1.0 / 60), | 55 new NullVideoSink(false, base::TimeDelta::FromSecondsD(1.0 / 60), |
| 55 NullVideoSink::NewFrameCB(), task_runner)); | 56 NullVideoSink::NewFrameCB(), task_runner)); |
| 56 } | 57 } |
| 57 | 58 |
| 58 const AudioHardwareConfig* GetAudioHardwareConfig() override { | |
| 59 return audio_hardware_config_.get(); | |
| 60 } | |
| 61 | |
| 62 scoped_ptr<CdmFactory> CreateCdmFactory( | 59 scoped_ptr<CdmFactory> CreateCdmFactory( |
| 63 mojo::ServiceProvider* /* service_provider */) override { | 60 mojo::ServiceProvider* /* service_provider */) override { |
| 64 return make_scoped_ptr(new DefaultCdmFactory()); | 61 return make_scoped_ptr(new DefaultCdmFactory()); |
| 65 } | 62 } |
| 66 | 63 |
| 67 private: | 64 private: |
| 68 FakeAudioLogFactory fake_audio_log_factory_; | 65 FakeAudioLogFactory fake_audio_log_factory_; |
| 69 scoped_ptr<AudioHardwareConfig> audio_hardware_config_; | 66 scoped_ptr<AudioHardwareConfig> audio_hardware_config_; |
| 70 | 67 |
| 71 DISALLOW_COPY_AND_ASSIGN(DefaultMojoMediaClient); | 68 DISALLOW_COPY_AND_ASSIGN(DefaultMojoMediaClient); |
| 72 }; | 69 }; |
| 73 | 70 |
| 74 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() { | 71 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() { |
| 75 return make_scoped_ptr(new DefaultMojoMediaClient()); | 72 return make_scoped_ptr(new DefaultMojoMediaClient()); |
| 76 } | 73 } |
| 77 | 74 |
| 78 } // namespace internal | 75 } // namespace internal |
| 79 } // namespace media | 76 } // namespace media |
| OLD | NEW |