 Chromium Code Reviews
 Chromium Code Reviews| 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/media.h" | 11 #include "media/base/media.h" | 
| 12 #include "media/base/null_video_sink.h" | 12 #include "media/base/null_video_sink.h" | 
| 13 #include "media/cdm/default_cdm_factory.h" | |
| 13 #include "media/renderers/default_renderer_factory.h" | 14 #include "media/renderers/default_renderer_factory.h" | 
| 14 #include "media/renderers/gpu_video_accelerator_factories.h" | 15 #include "media/renderers/gpu_video_accelerator_factories.h" | 
| 15 | 16 | 
| 16 namespace media { | 17 namespace media { | 
| 17 namespace internal { | 18 namespace internal { | 
| 18 | 19 | 
| 19 class DefaultMojoMediaClient : public PlatformMojoMediaClient { | 20 class DefaultMojoMediaClient : public PlatformMojoMediaClient { | 
| 20 public: | 21 public: | 
| 21 DefaultMojoMediaClient() { | 22 DefaultMojoMediaClient() { | 
| 22 InitializeMediaLibrary(); | 23 InitializeMediaLibrary(); | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) override { | 66 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) override { | 
| 66 return make_scoped_ptr( | 67 return make_scoped_ptr( | 
| 67 new NullVideoSink(false, base::TimeDelta::FromSecondsD(1.0 / 60), | 68 new NullVideoSink(false, base::TimeDelta::FromSecondsD(1.0 / 60), | 
| 68 NullVideoSink::NewFrameCB(), task_runner)); | 69 NullVideoSink::NewFrameCB(), task_runner)); | 
| 69 } | 70 } | 
| 70 | 71 | 
| 71 const AudioHardwareConfig& GetAudioHardwareConfig() override { | 72 const AudioHardwareConfig& GetAudioHardwareConfig() override { | 
| 72 return *audio_hardware_config_; | 73 return *audio_hardware_config_; | 
| 73 } | 74 } | 
| 74 | 75 | 
| 76 scoped_ptr<CdmFactory> GetCdmFactory() override { | |
| 77 return make_scoped_ptr(new DefaultCdmFactory()); | |
| 
ddorwin
2015/07/09 18:13:03
It seems odd that this creates a new object each t
 
xhwang
2015/07/09 21:16:31
This makes sense. But then most other methods need
 
ddorwin
2015/07/09 21:19:20
Yes.
 | |
| 78 } | |
| 79 | |
| 75 private: | 80 private: | 
| 76 FakeAudioLogFactory fake_audio_log_factory_; | 81 FakeAudioLogFactory fake_audio_log_factory_; | 
| 77 scoped_ptr<AudioHardwareConfig> audio_hardware_config_; | 82 scoped_ptr<AudioHardwareConfig> audio_hardware_config_; | 
| 78 | 83 | 
| 79 DISALLOW_COPY_AND_ASSIGN(DefaultMojoMediaClient); | 84 DISALLOW_COPY_AND_ASSIGN(DefaultMojoMediaClient); | 
| 80 }; | 85 }; | 
| 81 | 86 | 
| 82 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() { | 87 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() { | 
| 83 return make_scoped_ptr(new DefaultMojoMediaClient()); | 88 return make_scoped_ptr(new DefaultMojoMediaClient()); | 
| 84 } | 89 } | 
| 85 | 90 | 
| 86 } // namespace internal | 91 } // namespace internal | 
| 87 } // namespace media | 92 } // namespace media | 
| OLD | NEW |