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 "mojo/services/html_viewer/webmediaplayer_factory.h" | 5 #include "mojo/services/html_viewer/webmediaplayer_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 media::WebMediaPlayerParams params( | 67 media::WebMediaPlayerParams params( |
68 media::WebMediaPlayerParams::DeferLoadCB(), | 68 media::WebMediaPlayerParams::DeferLoadCB(), |
69 CreateAudioRendererSink(), | 69 CreateAudioRendererSink(), |
70 GetAudioHardwareConfig(), | 70 GetAudioHardwareConfig(), |
71 new media::MediaLog(), | 71 new media::MediaLog(), |
72 scoped_refptr<media::GpuVideoAcceleratorFactories>(), | 72 scoped_refptr<media::GpuVideoAcceleratorFactories>(), |
73 GetMediaThreadTaskRunner(), | 73 GetMediaThreadTaskRunner(), |
74 compositor_task_runner_, | 74 compositor_task_runner_, |
75 base::Bind(&media::NullEncryptedMediaPlayerSupport::Create), | 75 base::Bind(&media::NullEncryptedMediaPlayerSupport::Create), |
76 NULL); | 76 media::Context3DProviderCB(), |
| 77 nullptr); |
77 base::WeakPtr<media::WebMediaPlayerDelegate> delegate; | 78 base::WeakPtr<media::WebMediaPlayerDelegate> delegate; |
78 | 79 |
79 return new media::WebMediaPlayerImpl( | 80 return new media::WebMediaPlayerImpl( |
80 frame, client, delegate, renderer.Pass(), params); | 81 frame, client, delegate, renderer.Pass(), params); |
81 #endif | 82 #endif |
82 } | 83 } |
83 | 84 |
84 const media::AudioHardwareConfig& | 85 const media::AudioHardwareConfig& |
85 WebMediaPlayerFactory::GetAudioHardwareConfig() { | 86 WebMediaPlayerFactory::GetAudioHardwareConfig() { |
86 return audio_hardware_config_; | 87 return audio_hardware_config_; |
87 } | 88 } |
88 | 89 |
89 scoped_refptr<media::AudioRendererSink> | 90 scoped_refptr<media::AudioRendererSink> |
90 WebMediaPlayerFactory::CreateAudioRendererSink() { | 91 WebMediaPlayerFactory::CreateAudioRendererSink() { |
91 // TODO(dalecurtis): Replace this with an interface to an actual mojo service; | 92 // TODO(dalecurtis): Replace this with an interface to an actual mojo service; |
92 // the AudioOutputStreamSink will not work in sandboxed processes. | 93 // the AudioOutputStreamSink will not work in sandboxed processes. |
93 return new media::AudioOutputStreamSink(); | 94 return new media::AudioOutputStreamSink(); |
94 } | 95 } |
95 | 96 |
96 scoped_refptr<base::SingleThreadTaskRunner> | 97 scoped_refptr<base::SingleThreadTaskRunner> |
97 WebMediaPlayerFactory::GetMediaThreadTaskRunner() { | 98 WebMediaPlayerFactory::GetMediaThreadTaskRunner() { |
98 if (!media_thread_.IsRunning()) | 99 if (!media_thread_.IsRunning()) |
99 media_thread_.Start(); | 100 media_thread_.Start(); |
100 | 101 |
101 return media_thread_.message_loop_proxy(); | 102 return media_thread_.message_loop_proxy(); |
102 } | 103 } |
103 | 104 |
104 } // namespace mojo | 105 } // namespace mojo |
OLD | NEW |