OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2623 | 2623 |
2624 WebMediaPlayer* RenderView::createMediaPlayer( | 2624 WebMediaPlayer* RenderView::createMediaPlayer( |
2625 WebFrame* frame, WebMediaPlayerClient* client) { | 2625 WebFrame* frame, WebMediaPlayerClient* client) { |
2626 scoped_ptr<media::MediaFilterCollection> collection( | 2626 scoped_ptr<media::MediaFilterCollection> collection( |
2627 new media::MediaFilterCollection()); | 2627 new media::MediaFilterCollection()); |
2628 | 2628 |
2629 // Add in any custom filter factories first. | 2629 // Add in any custom filter factories first. |
2630 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 2630 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
2631 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 2631 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
2632 // Add the chrome specific audio renderer. | 2632 // Add the chrome specific audio renderer. |
2633 collection->AddFilter(new AudioRendererImpl(audio_message_filter())); | 2633 collection->AddAudioRenderer(new AudioRendererImpl(audio_message_filter())); |
2634 } | 2634 } |
2635 | 2635 |
2636 if (cmd_line->HasSwitch(switches::kEnableAcceleratedDecoding) && | 2636 if (cmd_line->HasSwitch(switches::kEnableAcceleratedDecoding) && |
2637 !cmd_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { | 2637 !cmd_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { |
2638 WebGraphicsContext3DCommandBufferImpl* context = | 2638 WebGraphicsContext3DCommandBufferImpl* context = |
2639 static_cast<WebGraphicsContext3DCommandBufferImpl*>( | 2639 static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
2640 frame->view()->graphicsContext3D()); | 2640 frame->view()->graphicsContext3D()); |
2641 if (!context) | 2641 if (!context) |
2642 return NULL; | 2642 return NULL; |
2643 | 2643 |
2644 // Add the hardware video decoder factory. | 2644 // Add the hardware video decoder factory. |
2645 // TODO(hclam): This will cause the renderer process to crash on context | 2645 // TODO(hclam): This will cause the renderer process to crash on context |
2646 // lost. | 2646 // lost. |
2647 bool ret = context->makeContextCurrent(); | 2647 bool ret = context->makeContextCurrent(); |
2648 CHECK(ret) << "Failed to switch context"; | 2648 CHECK(ret) << "Failed to switch context"; |
2649 collection->AddFilter(new IpcVideoDecoder( | 2649 collection->AddVideoDecoder(new IpcVideoDecoder( |
2650 MessageLoop::current(), context->context())); | 2650 MessageLoop::current(), context->context())); |
2651 } | 2651 } |
2652 | 2652 |
2653 WebApplicationCacheHostImpl* appcache_host = | 2653 WebApplicationCacheHostImpl* appcache_host = |
2654 WebApplicationCacheHostImpl::FromFrame(frame); | 2654 WebApplicationCacheHostImpl::FromFrame(frame); |
2655 | 2655 |
2656 // TODO(hclam): obtain the following parameters from |client|. | 2656 // TODO(hclam): obtain the following parameters from |client|. |
2657 // Create two bridge factory for two data sources. | 2657 // Create two bridge factory for two data sources. |
2658 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = | 2658 webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory_simple = |
2659 new webkit_glue::MediaResourceLoaderBridgeFactory( | 2659 new webkit_glue::MediaResourceLoaderBridgeFactory( |
(...skipping 10 matching lines...) Expand all Loading... |
2670 "null", // frame origin | 2670 "null", // frame origin |
2671 "null", // main_frame_origin | 2671 "null", // main_frame_origin |
2672 base::GetCurrentProcId(), | 2672 base::GetCurrentProcId(), |
2673 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, | 2673 appcache_host ? appcache_host->host_id() : appcache::kNoHostId, |
2674 routing_id()); | 2674 routing_id()); |
2675 | 2675 |
2676 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; | 2676 scoped_refptr<webkit_glue::WebVideoRenderer> video_renderer; |
2677 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); | 2677 bool pts_logging = cmd_line->HasSwitch(switches::kEnableVideoLogging); |
2678 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( | 2678 scoped_refptr<webkit_glue::VideoRendererImpl> renderer( |
2679 new webkit_glue::VideoRendererImpl(pts_logging)); | 2679 new webkit_glue::VideoRendererImpl(pts_logging)); |
2680 collection->AddFilter(renderer); | 2680 collection->AddVideoRenderer(renderer); |
2681 video_renderer = renderer; | 2681 video_renderer = renderer; |
2682 | 2682 |
2683 return new webkit_glue::WebMediaPlayerImpl( | 2683 return new webkit_glue::WebMediaPlayerImpl( |
2684 client, collection.release(), bridge_factory_simple, | 2684 client, collection.release(), bridge_factory_simple, |
2685 bridge_factory_buffered, | 2685 bridge_factory_buffered, |
2686 cmd_line->HasSwitch(switches::kSimpleDataSource),video_renderer); | 2686 cmd_line->HasSwitch(switches::kSimpleDataSource),video_renderer); |
2687 } | 2687 } |
2688 | 2688 |
2689 WebApplicationCacheHost* RenderView::createApplicationCacheHost( | 2689 WebApplicationCacheHost* RenderView::createApplicationCacheHost( |
2690 WebFrame* frame, WebApplicationCacheHostClient* client) { | 2690 WebFrame* frame, WebApplicationCacheHostClient* client) { |
(...skipping 2796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5487 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), | 5487 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), |
5488 message_id); | 5488 message_id); |
5489 } | 5489 } |
5490 | 5490 |
5491 #if defined(OS_MACOSX) | 5491 #if defined(OS_MACOSX) |
5492 void RenderView::OnSelectPopupMenuItem(int selected_index) { | 5492 void RenderView::OnSelectPopupMenuItem(int selected_index) { |
5493 external_popup_menu_->DidSelectItem(selected_index); | 5493 external_popup_menu_->DidSelectItem(selected_index); |
5494 external_popup_menu_.reset(); | 5494 external_popup_menu_.reset(); |
5495 } | 5495 } |
5496 #endif | 5496 #endif |
OLD | NEW |