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 // TODO(dalecurtis): This will not work if the process is sandboxed... | 44 InitializeMediaLibrary(); |
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 } | |
50 | 45 |
51 // TODO(dalecurtis): We should find a single owner per process for the audio | 46 // TODO(dalecurtis): We should find a single owner per process for the audio |
52 // manager or make it a lazy instance. It's not safe to call Get()/Create() | 47 // manager or make it a lazy instance. It's not safe to call Get()/Create() |
53 // across multiple threads... | 48 // across multiple threads... |
54 // | 49 // |
55 // TODO(dalecurtis): Eventually we'll want something other than a fake audio | 50 // TODO(dalecurtis): Eventually we'll want something other than a fake audio |
56 // log factory here too. We should probably at least DVLOG() such info. | 51 // log factory here too. We should probably at least DVLOG() such info. |
57 AudioManager* audio_manager = AudioManager::Get(); | 52 AudioManager* audio_manager = AudioManager::Get(); |
58 if (!audio_manager) | 53 if (!audio_manager) |
59 audio_manager = media::AudioManager::Create(&fake_audio_log_factory_); | 54 audio_manager = media::AudioManager::Create(&fake_audio_log_factory_); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 110 |
116 DISALLOW_COPY_AND_ASSIGN(DefaultRendererConfig); | 111 DISALLOW_COPY_AND_ASSIGN(DefaultRendererConfig); |
117 }; | 112 }; |
118 | 113 |
119 scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig() { | 114 scoped_ptr<PlatformRendererConfig> CreatePlatformRendererConfig() { |
120 return make_scoped_ptr(new DefaultRendererConfig()); | 115 return make_scoped_ptr(new DefaultRendererConfig()); |
121 } | 116 } |
122 | 117 |
123 } // namespace internal | 118 } // namespace internal |
124 } // namespace media | 119 } // namespace media |
OLD | NEW |