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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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/media_player_bridge_manager_impl.h" | 227 #include "webkit/media/android/media_player_bridge_manager_impl.h" |
| 228 #include "webkit/media/android/webmediaplayer_android.h" | 228 #include "webkit/media/android/webmediaplayer_android.h" |
| 229 #include "webkit/media/android/webmediaplayer_manager_android.h" | 229 #include "webkit/media/android/webmediaplayer_manager_android.h" |
| 230 | |
| 231 #if defined(GOOGLE_TV) | |
| 232 #include "content/renderer/media/rtc_video_decoder_bridge_tv.h" | |
| 233 #include "webkit/media/android/webmediaplayer_tv.h" | |
| 234 #endif | |
| 235 | |
| 230 #elif defined(OS_WIN) | 236 #elif defined(OS_WIN) |
| 231 // TODO(port): these files are currently Windows only because they concern: | 237 // TODO(port): these files are currently Windows only because they concern: |
| 232 // * theming | 238 // * theming |
| 233 #include "ui/native_theme/native_theme_win.h" | 239 #include "ui/native_theme/native_theme_win.h" |
| 234 #elif defined(USE_X11) | 240 #elif defined(USE_X11) |
| 235 #include "ui/native_theme/native_theme.h" | 241 #include "ui/native_theme/native_theme.h" |
| 236 #elif defined(OS_MACOSX) | 242 #elif defined(OS_MACOSX) |
| 237 #include "skia/ext/skia_utils_mac.h" | 243 #include "skia/ext/skia_utils_mac.h" |
| 238 #endif | 244 #endif |
| 239 | 245 |
| (...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2683 routing_id_); | 2689 routing_id_); |
| 2684 } | 2690 } |
| 2685 } | 2691 } |
| 2686 | 2692 |
| 2687 WebMediaPlayer* RenderViewImpl::createMediaPlayer( | 2693 WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
| 2688 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { | 2694 WebFrame* frame, const WebKit::WebURL& url, WebMediaPlayerClient* client) { |
| 2689 FOR_EACH_OBSERVER( | 2695 FOR_EACH_OBSERVER( |
| 2690 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); | 2696 RenderViewObserver, observers_, WillCreateMediaPlayer(frame, client)); |
| 2691 | 2697 |
| 2692 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2698 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 2693 #if defined(ENABLE_WEBRTC) | 2699 #if defined(ENABLE_WEBRTC) && !defined(GOOGLE_TV) |
| 2694 if (MediaStreamImpl::CheckMediaStream(url)) { | 2700 if (MediaStreamImpl::CheckMediaStream(url)) { |
| 2695 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2701 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 2696 bool found_neon = | 2702 bool found_neon = |
| 2697 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 2703 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
| 2698 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); | 2704 UMA_HISTOGRAM_BOOLEAN("Platform.WebRtcNEONFound", found_neon); |
| 2699 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 2705 #endif // defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
| 2700 EnsureMediaStreamImpl(); | 2706 EnsureMediaStreamImpl(); |
| 2701 return new webkit_media::WebMediaPlayerMS( | 2707 return new webkit_media::WebMediaPlayerMS( |
| 2702 frame, client, AsWeakPtr(), media_stream_impl_, new RenderMediaLog()); | 2708 frame, client, AsWeakPtr(), media_stream_impl_, new RenderMediaLog()); |
| 2703 } | 2709 } |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 2716 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 2722 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 2717 if (!context_provider) { | 2723 if (!context_provider) { |
| 2718 LOG(ERROR) << "Failed to get context3d for media player"; | 2724 LOG(ERROR) << "Failed to get context3d for media player"; |
| 2719 return NULL; | 2725 return NULL; |
| 2720 } | 2726 } |
| 2721 | 2727 |
| 2722 if (!media_player_proxy_) { | 2728 if (!media_player_proxy_) { |
| 2723 media_player_proxy_ = new WebMediaPlayerProxyImplAndroid( | 2729 media_player_proxy_ = new WebMediaPlayerProxyImplAndroid( |
| 2724 this, media_player_manager_.get()); | 2730 this, media_player_manager_.get()); |
| 2725 } | 2731 } |
| 2732 #if defined(GOOGLE_TV) | |
| 2733 MediaStreamImpl* media_stream_impl = NULL; | |
| 2734 media::Demuxer* demuxer = NULL; | |
| 2735 #if defined(ENABLE_WEBRTC) | |
| 2736 if (MediaStreamImpl::CheckMediaStream(url)) { | |
| 2737 EnsureMediaStreamImpl(); | |
| 2738 demuxer = RTCVideoDecoderBridgeTv::Get()->CreateDemuxer( | |
| 2739 base::MessageLoopProxy::current()); | |
| 2740 if (demuxer) | |
| 2741 media_stream_impl = media_stream_impl_; | |
| 2742 else | |
| 2743 return NULL; | |
|
ycheo (away)
2013/05/02 02:45:21
Could you add some error message for this?
wonsik
2013/05/02 15:22:00
Done.
| |
| 2744 } | |
| 2745 #endif // defined(ENABLE_WEBRTC) | |
| 2746 return new webkit_media::WebMediaPlayerTv( | |
| 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 #else // defined(GOOGLE_TV) | |
| 2726 return new webkit_media::WebMediaPlayerAndroid( | 2757 return new webkit_media::WebMediaPlayerAndroid( |
| 2727 frame, | 2758 frame, |
| 2728 client, | 2759 client, |
| 2729 media_player_manager_.get(), | 2760 media_player_manager_.get(), |
| 2730 media_player_proxy_, | 2761 media_player_proxy_, |
| 2731 new StreamTextureFactoryImpl( | 2762 new StreamTextureFactoryImpl( |
| 2732 context_provider->Context3d(), gpu_channel_host, routing_id_), | 2763 context_provider->Context3d(), gpu_channel_host, routing_id_)); |
| 2733 new RenderMediaLog()); | 2764 #endif // defined(GOOGLE_TV) |
| 2734 #endif | 2765 #endif // defined(OS_ANDROID) |
| 2735 | 2766 |
| 2736 scoped_refptr<media::AudioRendererSink> sink; | 2767 scoped_refptr<media::AudioRendererSink> sink; |
| 2737 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 2768 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
| 2738 if (!cmd_line->HasSwitch(switches::kDisableRendererSideMixing)) { | 2769 if (!cmd_line->HasSwitch(switches::kDisableRendererSideMixing)) { |
| 2739 sink = RenderThreadImpl::current()->GetAudioRendererMixerManager()-> | 2770 sink = RenderThreadImpl::current()->GetAudioRendererMixerManager()-> |
| 2740 CreateInput(routing_id_); | 2771 CreateInput(routing_id_); |
| 2741 DVLOG(1) << "Using AudioRendererMixerManager-provided sink: " << sink; | 2772 DVLOG(1) << "Using AudioRendererMixerManager-provided sink: " << sink; |
| 2742 } else { | 2773 } else { |
| 2743 // The RenderView creating AudioRendererSink will be the source of | 2774 // The RenderView creating AudioRendererSink will be the source of |
| 2744 // the audio (WebMediaPlayer is always associated with a document in a | 2775 // the audio (WebMediaPlayer is always associated with a document in a |
| (...skipping 3789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6534 WebURL url = icon_urls[i].iconURL(); | 6565 WebURL url = icon_urls[i].iconURL(); |
| 6535 if (!url.isEmpty()) | 6566 if (!url.isEmpty()) |
| 6536 urls.push_back(FaviconURL(url, | 6567 urls.push_back(FaviconURL(url, |
| 6537 ToFaviconType(icon_urls[i].iconType()))); | 6568 ToFaviconType(icon_urls[i].iconType()))); |
| 6538 } | 6569 } |
| 6539 SendUpdateFaviconURL(urls); | 6570 SendUpdateFaviconURL(urls); |
| 6540 } | 6571 } |
| 6541 | 6572 |
| 6542 | 6573 |
| 6543 } // namespace content | 6574 } // namespace content |
| OLD | NEW |