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 "components/html_viewer/media_factory.h" | 5 #include "components/html_viewer/media_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // media::Renderer implementation. | 37 // media::Renderer implementation. |
38 // TODO(xhwang): Move this to media_switches.h. | 38 // TODO(xhwang): Move this to media_switches.h. |
39 const char kEnableMojoMediaRenderer[] = "enable-mojo-media-renderer"; | 39 const char kEnableMojoMediaRenderer[] = "enable-mojo-media-renderer"; |
40 | 40 |
41 bool AreSecureCodecsSupported() { | 41 bool AreSecureCodecsSupported() { |
42 // Hardware-secure codecs are not currently supported by HTML Viewer on any | 42 // Hardware-secure codecs are not currently supported by HTML Viewer on any |
43 // platform. | 43 // platform. |
44 return false; | 44 return false; |
45 } | 45 } |
46 | 46 |
| 47 void OnGotContentHandlerID(uint32_t content_handler_id) {} |
| 48 |
47 } // namespace | 49 } // namespace |
48 | 50 |
49 MediaFactory::MediaFactory( | 51 MediaFactory::MediaFactory( |
50 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, | 52 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, |
51 mojo::Shell* shell) | 53 mojo::Shell* shell) |
52 : | 54 : |
53 #if !defined(OS_ANDROID) | 55 #if !defined(OS_ANDROID) |
54 media_thread_("Media"), | 56 media_thread_("Media"), |
55 audio_manager_(media::AudioManager::Create(&fake_audio_log_factory_)), | 57 audio_manager_(media::AudioManager::Create(&fake_audio_log_factory_)), |
56 audio_hardware_config_( | 58 audio_hardware_config_( |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 115 } |
114 return web_encrypted_media_client_.get(); | 116 return web_encrypted_media_client_.get(); |
115 } | 117 } |
116 | 118 |
117 media::interfaces::ServiceFactory* MediaFactory::GetMediaServiceFactory() { | 119 media::interfaces::ServiceFactory* MediaFactory::GetMediaServiceFactory() { |
118 if (!media_service_factory_) { | 120 if (!media_service_factory_) { |
119 mojo::ServiceProviderPtr service_provider; | 121 mojo::ServiceProviderPtr service_provider; |
120 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 122 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
121 request->url = mojo::String::From("mojo:media"); | 123 request->url = mojo::String::From("mojo:media"); |
122 shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 124 shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
123 nullptr, nullptr); | 125 nullptr, nullptr, |
| 126 base::Bind(&OnGotContentHandlerID)); |
124 mojo::ConnectToService(service_provider.get(), &media_service_factory_); | 127 mojo::ConnectToService(service_provider.get(), &media_service_factory_); |
125 } | 128 } |
126 | 129 |
127 return media_service_factory_.get(); | 130 return media_service_factory_.get(); |
128 } | 131 } |
129 | 132 |
130 media::MediaPermission* MediaFactory::GetMediaPermission() { | 133 media::MediaPermission* MediaFactory::GetMediaPermission() { |
131 // TODO(xhwang): Replace DefaultMediaPermission with something real when | 134 // TODO(xhwang): Replace DefaultMediaPermission with something real when |
132 // permissions are supported in html_viewer. | 135 // permissions are supported in html_viewer. |
133 NOTIMPLEMENTED(); | 136 NOTIMPLEMENTED(); |
(...skipping 29 matching lines...) Expand all Loading... |
163 scoped_refptr<base::SingleThreadTaskRunner> | 166 scoped_refptr<base::SingleThreadTaskRunner> |
164 MediaFactory::GetMediaThreadTaskRunner() { | 167 MediaFactory::GetMediaThreadTaskRunner() { |
165 if (!media_thread_.IsRunning()) | 168 if (!media_thread_.IsRunning()) |
166 media_thread_.Start(); | 169 media_thread_.Start(); |
167 | 170 |
168 return media_thread_.task_runner(); | 171 return media_thread_.task_runner(); |
169 } | 172 } |
170 #endif // !defined(OS_ANDROID) | 173 #endif // !defined(OS_ANDROID) |
171 | 174 |
172 } // namespace html_viewer | 175 } // namespace html_viewer |
OLD | NEW |