Chromium Code Reviews| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 #include "content/renderer/android/email_detector.h" | 219 #include "content/renderer/android/email_detector.h" |
| 220 #include "content/renderer/android/phone_number_detector.h" | 220 #include "content/renderer/android/phone_number_detector.h" |
| 221 #include "content/renderer/media/stream_texture_factory_impl_android.h" | 221 #include "content/renderer/media/stream_texture_factory_impl_android.h" |
| 222 #include "content/renderer/media/webmediaplayer_proxy_impl_android.h" | 222 #include "content/renderer/media/webmediaplayer_proxy_impl_android.h" |
| 223 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | 223 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" |
| 224 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 224 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
| 225 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHitTestResult.h" | 225 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHitTestResult.h" |
| 226 #include "ui/gfx/rect_f.h" | 226 #include "ui/gfx/rect_f.h" |
| 227 #include "webkit/media/android/webmediaplayer_android.h" | 227 #include "webkit/media/android/webmediaplayer_android.h" |
| 228 #include "webkit/media/android/webmediaplayer_manager_android.h" | 228 #include "webkit/media/android/webmediaplayer_manager_android.h" |
| 229 | |
| 230 #if defined(GOOGLE_TV) | |
| 231 #include "content/renderer/media/rtc_video_decoder_bridge_tv.h" | |
| 232 #endif | |
| 233 | |
| 229 #elif defined(OS_WIN) | 234 #elif defined(OS_WIN) |
| 230 // TODO(port): these files are currently Windows only because they concern: | 235 // TODO(port): these files are currently Windows only because they concern: |
| 231 // * theming | 236 // * theming |
| 232 #include "ui/native_theme/native_theme_win.h" | 237 #include "ui/native_theme/native_theme_win.h" |
| 233 #elif defined(USE_X11) | 238 #elif defined(USE_X11) |
| 234 #include "ui/native_theme/native_theme.h" | 239 #include "ui/native_theme/native_theme.h" |
| 235 #elif defined(OS_MACOSX) | 240 #elif defined(OS_MACOSX) |
| 236 #include "skia/ext/skia_utils_mac.h" | 241 #include "skia/ext/skia_utils_mac.h" |
| 237 #endif | 242 #endif |
| 238 | 243 |
| (...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2681 routing_id_); | 2686 routing_id_); |
| 2682 } | 2687 } |
| 2683 } | 2688 } |
| 2684 | 2689 |
| 2685 WebMediaPlayer* RenderViewImpl::createMediaPlayer( | 2690 WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
| 2686 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { | 2691 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { |
| 2687 FOR_EACH_OBSERVER( | 2692 FOR_EACH_OBSERVER( |
| 2688 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); | 2693 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); |
| 2689 | 2694 |
| 2690 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2695 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 2691 #if defined(ENABLE_WEBRTC) | 2696 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) |
| 2692 if (MediaStreamImpl::CheckMediaStream(url)) { | 2697 if (MediaStreamImpl::CheckMediaStream(url)) { |
| 2693 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2698 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 2694 bool found_neon = | 2699 bool found_neon = |
| 2695 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 2700 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
| 2696 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); | 2701 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); |
| 2697 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2702 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 2698 EnsureMediaStreamImpl(); | 2703 EnsureMediaStreamImpl(); |
| 2699 return new webkit_media::WebMediaPlayerMS( | 2704 return new webkit_media::WebMediaPlayerMS( |
| 2700 frame, client, AsWeakPtr(), media_stream_impl_, new RenderMediaLog()); | 2705 frame, client, AsWeakPtr(), media_stream_impl_, new RenderMediaLog()); |
| 2701 } | 2706 } |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 2714 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 2719 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 2715 if (!context_provider) { | 2720 if (!context_provider) { |
| 2716 LOG(ERROR) << "Failed to get context3d for media player"; | 2721 LOG(ERROR) << "Failed to get context3d for media player"; |
| 2717 return NULL; | 2722 return NULL; |
| 2718 } | 2723 } |
| 2719 | 2724 |
| 2720 if (!media_player_proxy_) { | 2725 if (!media_player_proxy_) { |
| 2721 media_player_proxy_ = new WebMediaPlayerProxyImplAndroid( | 2726 media_player_proxy_ = new WebMediaPlayerProxyImplAndroid( |
| 2722 this, media_player_manager_.get()); | 2727 this, media_player_manager_.get()); |
| 2723 } | 2728 } |
| 2724 return new webkit_media::WebMediaPlayerAndroid( | 2729 MediaStreamImpl* media_stream_impl = NULL; |
| 2725 frame, | 2730 media::Demuxer* demuxer = NULL; |
| 2726 client, | 2731 #if defined(ENABLE_WEBRTC) |
| 2727 media_player_manager_.get(), | 2732 if (MediaStreamImpl::CheckMediaStream(url)) { |
| 2728 media_player_proxy_, | 2733 EnsureMediaStreamImpl(); |
| 2729 new StreamTextureFactoryImpl( | 2734 demuxer = RTCVideoDecoderBridgeTv::Get()->CreateDemuxer( |
| 2730 context_provider->Context3d(), gpu_channel_host, routing_id_), | 2735 RenderThreadImpl::current()->GetMediaStreamDependencyFactory(), |
| 2731 new RenderMediaLog()); | 2736 base::MessageLoopProxy::current()); |
| 2732 #endif | 2737 if (demuxer) { |
| 2738 media_stream_impl = media_stream_impl_; | |
| 2739 } else { | |
| 2740 LOG(ERROR) << "Multiple MediaStream not supported yet."; | |
| 2741 return NULL; | |
| 2742 } | |
| 2743 } | |
| 2744 #endif // defined(ENABLE_WEBRTC) | |
| 2745 webkit_media::WebMediaPlayerAndroid* web_media_player_android = | |
| 2746 new webkit_media::WebMediaPlayerAndroid( | |
| 2747 frame, | |
| 2748 client, | |
| 2749 media_player_manager_.get(), | |
| 2750 media_player_proxy_, | |
| 2751 new StreamTextureFactoryImpl( | |
| 2752 context_provider->Context3d(), gpu_channel_host, routing_id_), | |
| 2753 new RenderMediaLog(), | |
| 2754 media_stream_impl, | |
| 2755 demuxer); | |
| 2756 #if defined(GOOGLE_TV) | |
| 2757 web_media_player_android->SetDestroyDemuxerCB( | |
|
ycheo (away)
2013/05/06 05:45:34
Should we run this code only if it is the media st
wonsik
2013/05/06 12:28:43
Done.
| |
| 2758 base::Bind(&RTCVideoDecoderBridgeTv::RunDestroyDemuxer)); | |
| 2759 #endif // defined(GOOGLE_TV) | |
| 2760 return web_media_player_android; | |
| 2761 #endif // defined(OS_ANDROID) | |
| 2733 | 2762 |
| 2734 scoped_refptr<media::AudioRendererSink> sink; | 2763 scoped_refptr<media::AudioRendererSink> sink; |
| 2735 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 2764 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
| 2736 if (!cmd_line->HasSwitch(switches::kDisableRendererSideMixing)) { | 2765 if (!cmd_line->HasSwitch(switches::kDisableRendererSideMixing)) { |
| 2737 sink = RenderThreadImpl::current()->GetAudioRendererMixerManager()-> | 2766 sink = RenderThreadImpl::current()->GetAudioRendererMixerManager()-> |
| 2738 CreateInput(routing_id_); | 2767 CreateInput(routing_id_); |
| 2739 DVLOG(1) << "Using AudioRendererMixerManager-provided sink: " << sink; | 2768 DVLOG(1) << "Using AudioRendererMixerManager-provided sink: " << sink; |
| 2740 } else { | 2769 } else { |
| 2741 // The RenderView creating AudioRendererSink will be the source of | 2770 // The RenderView creating AudioRendererSink will be the source of |
| 2742 // the audio (WebMediaPlayer is always associated with a document in a | 2771 // the audio (WebMediaPlayer is always associated with a document in a |
| (...skipping 3792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6535 WebURL url = icon_urls[i].iconURL(); | 6564 WebURL url = icon_urls[i].iconURL(); |
| 6536 if (!url.isEmpty()) | 6565 if (!url.isEmpty()) |
| 6537 urls.push_back(FaviconURL(url, | 6566 urls.push_back(FaviconURL(url, |
| 6538 ToFaviconType(icon_urls[i].iconType()))); | 6567 ToFaviconType(icon_urls[i].iconType()))); |
| 6539 } | 6568 } |
| 6540 SendUpdateFaviconURL(urls); | 6569 SendUpdateFaviconURL(urls); |
| 6541 } | 6570 } |
| 6542 | 6571 |
| 6543 | 6572 |
| 6544 } // namespace content | 6573 } // namespace content |
| OLD | NEW |