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 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "media/audio/audio_manager_base.h" | 9 #include "media/audio/audio_manager_base.h" |
10 #include "media/audio/audio_output_stream_sink.h" | 10 #include "media/audio/audio_output_stream_sink.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 void PaintFrameUsingOldRenderingPath( | 34 void PaintFrameUsingOldRenderingPath( |
35 const scoped_refptr<VideoFrame>& frame) override {} | 35 const scoped_refptr<VideoFrame>& frame) override {} |
36 | 36 |
37 private: | 37 private: |
38 DISALLOW_COPY_AND_ASSIGN(DummyVideoRendererSink); | 38 DISALLOW_COPY_AND_ASSIGN(DummyVideoRendererSink); |
39 }; | 39 }; |
40 | 40 |
41 class DefaultRendererConfig : public PlatformRendererConfig { | 41 class DefaultRendererConfig : public PlatformRendererConfig { |
42 public: | 42 public: |
43 DefaultRendererConfig() { | 43 DefaultRendererConfig() { |
44 InitializeMediaLibrary(); | 44 // TODO(dalecurtis): This will not work if the process is sandboxed... |
| 45 if (!media::IsMediaLibraryInitialized()) { |
| 46 base::FilePath module_dir; |
| 47 CHECK(PathService::Get(base::DIR_EXE, &module_dir)); |
| 48 CHECK(media::InitializeMediaLibrary(module_dir)); |
| 49 } |
45 | 50 |
46 // TODO(dalecurtis): We should find a single owner per process for the audio | 51 // TODO(dalecurtis): We should find a single owner per process for the audio |
47 // manager or make it a lazy instance. It's not safe to call Get()/Create() | 52 // manager or make it a lazy instance. It's not safe to call Get()/Create() |
48 // across multiple threads... | 53 // across multiple threads... |
49 // | 54 // |
50 // TODO(dalecurtis): Eventually we'll want something other than a fake audio | 55 // TODO(dalecurtis): Eventually we'll want something other than a fake audio |
51 // log factory here too. We should probably at least DVLOG() such info. | 56 // log factory here too. We should probably at least DVLOG() such info. |
52 AudioManager* audio_manager = AudioManager::Get(); | 57 AudioManager* audio_manager = AudioManager::Get(); |
53 if (!audio_manager) | 58 if (!audio_manager) |
54 audio_manager = media::AudioManager::Create(&fake_audio_log_factory_); | 59 audio_manager = media::AudioManager::Create(&fake_audio_log_factory_); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 115 |
111 DISALLOW_COPY_AND_ASSIGN(DefaultRendererConfig); | 116 DISALLOW_COPY_AND_ASSIGN(DefaultRendererConfig); |
112 }; | 117 }; |
113 | 118 |
114 scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig() { | 119 scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig() { |
115 return make_scoped_ptr(new DefaultRendererConfig()); | 120 return make_scoped_ptr(new DefaultRendererConfig()); |
116 } | 121 } |
117 | 122 |
118 } // namespace internal | 123 } // namespace internal |
119 } // namespace media | 124 } // namespace media |
OLD | NEW |