OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 #include "content/renderer/android/email_detector.h" | 225 #include "content/renderer/android/email_detector.h" |
226 #include "content/renderer/android/phone_number_detector.h" | 226 #include "content/renderer/android/phone_number_detector.h" |
227 #include "content/renderer/media/stream_texture_factory_impl_android.h" | 227 #include "content/renderer/media/stream_texture_factory_impl_android.h" |
228 #include "content/renderer/media/webmediaplayer_proxy_impl_android.h" | 228 #include "content/renderer/media/webmediaplayer_proxy_impl_android.h" |
229 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 229 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
230 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 230 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
231 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHitTestResult.h" | 231 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHitTestResult.h" |
232 #include "ui/gfx/rect_f.h" | 232 #include "ui/gfx/rect_f.h" |
233 #include "webkit/renderer/media/android/webmediaplayer_android.h" | 233 #include "webkit/renderer/media/android/webmediaplayer_android.h" |
234 #include "webkit/renderer/media/android/webmediaplayer_manager_android.h" | 234 #include "webkit/renderer/media/android/webmediaplayer_manager_android.h" |
| 235 |
| 236 #if defined(GOOGLE_TV) |
| 237 #include "content/renderer/media/rtc_video_decoder_bridge_tv.h" |
| 238 #include "content/renderer/media/rtc_video_decoder_factory_tv.h" |
| 239 #endif |
| 240 |
235 #elif defined(OS_WIN) | 241 #elif defined(OS_WIN) |
236 // TODO(port): these files are currently Windows only because they concern: | 242 // TODO(port): these files are currently Windows only because they concern: |
237 // * theming | 243 // * theming |
238 #include "ui/native_theme/native_theme_win.h" | 244 #include "ui/native_theme/native_theme_win.h" |
239 #elif defined(USE_X11) | 245 #elif defined(USE_X11) |
240 #include "ui/native_theme/native_theme.h" | 246 #include "ui/native_theme/native_theme.h" |
241 #elif defined(OS_MACOSX) | 247 #elif defined(OS_MACOSX) |
242 #include "skia/ext/skia_utils_mac.h" | 248 #include "skia/ext/skia_utils_mac.h" |
243 #endif | 249 #endif |
244 | 250 |
(...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2773 routing_id_); | 2779 routing_id_); |
2774 } | 2780 } |
2775 } | 2781 } |
2776 | 2782 |
2777 WebMediaPlayer* RenderViewImpl::createMediaPlayer( | 2783 WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
2778 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { | 2784 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { |
2779 FOR_EACH_OBSERVER( | 2785 FOR_EACH_OBSERVER( |
2780 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); | 2786 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); |
2781 | 2787 |
2782 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2788 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
2783 #if defined(ENABLE_WEBRTC) | 2789 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) |
2784 if (MediaStreamImpl::CheckMediaStream(url)) { | 2790 if (MediaStreamImpl::CheckMediaStream(url)) { |
2785 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2791 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
2786 bool found_neon = | 2792 bool found_neon = |
2787 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 2793 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
2788 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); | 2794 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); |
2789 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2795 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
2790 EnsureMediaStreamImpl(); | 2796 EnsureMediaStreamImpl(); |
2791 return new webkit_media::WebMediaPlayerMS( | 2797 return new webkit_media::WebMediaPlayerMS( |
2792 frame, client, AsWeakPtr(), media_stream_impl_, new RenderMediaLog()); | 2798 frame, client, AsWeakPtr(), media_stream_impl_, new RenderMediaLog()); |
2793 } | 2799 } |
(...skipping 12 matching lines...) Expand all Loading... |
2806 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 2812 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
2807 if (!context_provider) { | 2813 if (!context_provider) { |
2808 LOG(ERROR) << "Failed to get context3d for media player"; | 2814 LOG(ERROR) << "Failed to get context3d for media player"; |
2809 return NULL; | 2815 return NULL; |
2810 } | 2816 } |
2811 | 2817 |
2812 if (!media_player_proxy_) { | 2818 if (!media_player_proxy_) { |
2813 media_player_proxy_ = new WebMediaPlayerProxyImplAndroid( | 2819 media_player_proxy_ = new WebMediaPlayerProxyImplAndroid( |
2814 this, media_player_manager_.get()); | 2820 this, media_player_manager_.get()); |
2815 } | 2821 } |
2816 return new webkit_media::WebMediaPlayerAndroid( | 2822 scoped_ptr<webkit_media::WebMediaPlayerAndroid> web_media_player_android( |
2817 frame, | 2823 new webkit_media::WebMediaPlayerAndroid( |
2818 client, | 2824 frame, |
2819 media_player_manager_.get(), | 2825 client, |
2820 media_player_proxy_, | 2826 media_player_manager_.get(), |
2821 new StreamTextureFactoryImpl( | 2827 media_player_proxy_, |
2822 context_provider->Context3d(), gpu_channel_host, routing_id_), | 2828 new StreamTextureFactoryImpl( |
2823 new RenderMediaLog()); | 2829 context_provider->Context3d(), gpu_channel_host, routing_id_), |
2824 #endif | 2830 new RenderMediaLog())); |
| 2831 #if defined(ENABLE_WEBRTC) && defined(GOOGLE_TV) |
| 2832 if (MediaStreamImpl::CheckMediaStream(url)) { |
| 2833 EnsureMediaStreamImpl(); |
| 2834 RTCVideoDecoderFactoryTv* factory = RenderThreadImpl::current() |
| 2835 ->GetMediaStreamDependencyFactory()->decoder_factory_tv(); |
| 2836 // |media_stream_impl_| and |factory| outlives |web_media_player_android|. |
| 2837 if (!factory->AcquireDemuxer() || |
| 2838 !web_media_player_android->InjectMediaStream( |
| 2839 media_stream_impl_, |
| 2840 factory, |
| 2841 base::Bind( |
| 2842 base::IgnoreResult(&RTCVideoDecoderFactoryTv::ReleaseDemuxer), |
| 2843 base::Unretained(factory)))) { |
| 2844 LOG(ERROR) << "Failed to inject media stream."; |
| 2845 return NULL; |
| 2846 } |
| 2847 } |
| 2848 #endif // defined(ENABLE_WEBRTC) && defined(GOOGLE_TV) |
| 2849 return web_media_player_android.release(); |
| 2850 #endif // defined(OS_ANDROID) |
2825 | 2851 |
2826 scoped_refptr<media::AudioRendererSink> sink; | 2852 scoped_refptr<media::AudioRendererSink> sink; |
2827 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 2853 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
2828 sink = RenderThreadImpl::current()->GetAudioRendererMixerManager()-> | 2854 sink = RenderThreadImpl::current()->GetAudioRendererMixerManager()-> |
2829 CreateInput(routing_id_); | 2855 CreateInput(routing_id_); |
2830 DVLOG(1) << "Using AudioRendererMixerManager-provided sink: " << sink.get(); | 2856 DVLOG(1) << "Using AudioRendererMixerManager-provided sink: " << sink.get(); |
2831 } | 2857 } |
2832 | 2858 |
2833 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories; | 2859 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories; |
2834 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; | 2860 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; |
(...skipping 3813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6648 WebURL url = icon_urls[i].iconURL(); | 6674 WebURL url = icon_urls[i].iconURL(); |
6649 if (!url.isEmpty()) | 6675 if (!url.isEmpty()) |
6650 urls.push_back(FaviconURL(url, | 6676 urls.push_back(FaviconURL(url, |
6651 ToFaviconType(icon_urls[i].iconType()))); | 6677 ToFaviconType(icon_urls[i].iconType()))); |
6652 } | 6678 } |
6653 SendUpdateFaviconURL(urls); | 6679 SendUpdateFaviconURL(urls); |
6654 } | 6680 } |
6655 | 6681 |
6656 | 6682 |
6657 } // namespace content | 6683 } // namespace content |
OLD | NEW |