OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 4717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4728 } | 4728 } |
4729 | 4729 |
4730 WebMediaPlayer* RenderFrameImpl::CreateWebMediaPlayerForMediaStream( | 4730 WebMediaPlayer* RenderFrameImpl::CreateWebMediaPlayerForMediaStream( |
4731 WebMediaPlayerClient* client) { | 4731 WebMediaPlayerClient* client) { |
4732 #if defined(ENABLE_WEBRTC) | 4732 #if defined(ENABLE_WEBRTC) |
4733 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 4733 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
4734 bool found_neon = | 4734 bool found_neon = |
4735 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 4735 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
4736 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); | 4736 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); |
4737 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 4737 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
4738 return new WebMediaPlayerMS(frame_, client, weak_factory_.GetWeakPtr(), | 4738 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner = |
4739 new RenderMediaLog(), | 4739 RenderThreadImpl::current()->compositor_task_runner(); |
4740 CreateRendererFactory()); | 4740 if (!compositor_task_runner.get()) |
| 4741 compositor_task_runner = base::MessageLoop::current()->task_runner(); |
| 4742 return new WebMediaPlayerMS( |
| 4743 frame_, client, weak_factory_.GetWeakPtr(), new RenderMediaLog(), |
| 4744 CreateRendererFactory(), |
| 4745 compositor_task_runner); |
4741 #else | 4746 #else |
4742 return NULL; | 4747 return NULL; |
4743 #endif // defined(ENABLE_WEBRTC) | 4748 #endif // defined(ENABLE_WEBRTC) |
4744 } | 4749 } |
4745 | 4750 |
4746 scoped_ptr<MediaStreamRendererFactory> | 4751 scoped_ptr<MediaStreamRendererFactory> |
4747 RenderFrameImpl::CreateRendererFactory() { | 4752 RenderFrameImpl::CreateRendererFactory() { |
4748 scoped_ptr<MediaStreamRendererFactory> factory = | 4753 scoped_ptr<MediaStreamRendererFactory> factory = |
4749 GetContentClient()->renderer()->CreateMediaStreamRendererFactory(); | 4754 GetContentClient()->renderer()->CreateMediaStreamRendererFactory(); |
4750 if (factory.get()) | 4755 if (factory.get()) |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5100 mojo::ServiceProviderPtr service_provider; | 5105 mojo::ServiceProviderPtr service_provider; |
5101 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 5106 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
5102 request->url = mojo::String::From(url); | 5107 request->url = mojo::String::From(url); |
5103 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 5108 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
5104 nullptr, nullptr, | 5109 nullptr, nullptr, |
5105 base::Bind(&OnGotContentHandlerID)); | 5110 base::Bind(&OnGotContentHandlerID)); |
5106 return service_provider.Pass(); | 5111 return service_provider.Pass(); |
5107 } | 5112 } |
5108 | 5113 |
5109 } // namespace content | 5114 } // namespace content |
OLD | NEW |