Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10918052: create a separate WebMediaPlayer for URL derived from media stream (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/rtc_video_renderer.cc ('k') | media/video/capture/video_capture.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 #include "webkit/glue/alt_error_page_resource_fetcher.h" 185 #include "webkit/glue/alt_error_page_resource_fetcher.h"
186 #include "webkit/glue/dom_operations.h" 186 #include "webkit/glue/dom_operations.h"
187 #include "webkit/glue/glue_serialize.h" 187 #include "webkit/glue/glue_serialize.h"
188 #include "webkit/glue/web_intent_service_data.h" 188 #include "webkit/glue/web_intent_service_data.h"
189 #include "webkit/glue/webdropdata.h" 189 #include "webkit/glue/webdropdata.h"
190 #include "webkit/glue/webkit_constants.h" 190 #include "webkit/glue/webkit_constants.h"
191 #include "webkit/glue/webkit_glue.h" 191 #include "webkit/glue/webkit_glue.h"
192 #include "webkit/glue/weburlresponse_extradata_impl.h" 192 #include "webkit/glue/weburlresponse_extradata_impl.h"
193 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" 193 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
194 #include "webkit/media/webmediaplayer_impl.h" 194 #include "webkit/media/webmediaplayer_impl.h"
195 #include "webkit/media/webmediaplayer_ms.h"
195 #include "webkit/plugins/npapi/plugin_list.h" 196 #include "webkit/plugins/npapi/plugin_list.h"
196 #include "webkit/plugins/npapi/webplugin_delegate.h" 197 #include "webkit/plugins/npapi/webplugin_delegate.h"
197 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" 198 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
198 #include "webkit/plugins/npapi/webplugin_impl.h" 199 #include "webkit/plugins/npapi/webplugin_impl.h"
199 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" 200 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
200 201
201 #if defined(OS_ANDROID) 202 #if defined(OS_ANDROID)
202 #include "content/common/android/device_info.h" 203 #include "content/common/android/device_info.h"
203 #include "content/renderer/android/address_detector.h" 204 #include "content/renderer/android/address_detector.h"
204 #include "content/renderer/android/content_detector.h" 205 #include "content/renderer/android/content_detector.h"
(...skipping 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2489 audio_source_provider = new RenderAudioSourceProvider(); 2490 audio_source_provider = new RenderAudioSourceProvider();
2490 2491
2491 // Add the chrome specific audio renderer, using audio_source_provider 2492 // Add the chrome specific audio renderer, using audio_source_provider
2492 // as the sink. 2493 // as the sink.
2493 media::AudioRendererImpl* audio_renderer = 2494 media::AudioRendererImpl* audio_renderer =
2494 new media::AudioRendererImpl(audio_source_provider); 2495 new media::AudioRendererImpl(audio_source_provider);
2495 collection->AddAudioRenderer(audio_renderer); 2496 collection->AddAudioRenderer(audio_renderer);
2496 } 2497 }
2497 2498
2498 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; 2499 WebGraphicsContext3DCommandBufferImpl* context3d = NULL;
2499 if (!CommandLine::ForCurrentProcess()->HasSwitch( 2500 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
2500 switches::kDisableAcceleratedVideoDecode))
2501 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); 2501 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D();
2502 if (context3d) { 2502 if (context3d) {
2503 scoped_refptr<base::MessageLoopProxy> factories_loop = 2503 scoped_refptr<base::MessageLoopProxy> factories_loop =
2504 RenderThreadImpl::current()->compositor_thread() ? 2504 RenderThreadImpl::current()->compositor_thread() ?
2505 RenderThreadImpl::current()->compositor_thread()->GetWebThread() 2505 RenderThreadImpl::current()->compositor_thread()->GetWebThread()
2506 ->message_loop()->message_loop_proxy() : 2506 ->message_loop()->message_loop_proxy() :
2507 base::MessageLoopProxy::current(); 2507 base::MessageLoopProxy::current();
2508 GpuChannelHost* gpu_channel_host = 2508 GpuChannelHost* gpu_channel_host =
2509 RenderThreadImpl::current()->EstablishGpuChannelSync( 2509 RenderThreadImpl::current()->EstablishGpuChannelSync(
2510 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 2510 content::CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
2511 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder( 2511 collection->GetVideoDecoders()->push_back(new media::GpuVideoDecoder(
2512 base::Bind(&media::MessageLoopFactory::GetMessageLoop, 2512 base::Bind(&media::MessageLoopFactory::GetMessageLoop,
2513 base::Unretained(message_loop_factory), 2513 base::Unretained(message_loop_factory),
2514 media::MessageLoopFactory::kDecoder), 2514 media::MessageLoopFactory::kDecoder),
2515 factories_loop, 2515 factories_loop,
2516 new RendererGpuVideoDecoderFactories( 2516 new RendererGpuVideoDecoderFactories(
2517 gpu_channel_host, factories_loop, context3d))); 2517 gpu_channel_host, factories_loop, context3d)));
2518 } 2518 }
2519 2519
2520 WebMediaPlayer* media_player = 2520 WebMediaPlayer* media_player =
2521 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( 2521 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer(
2522 this, frame, client, AsWeakPtr(), collection, audio_source_provider, 2522 this, frame, client, AsWeakPtr(), collection, audio_source_provider,
2523 audio_source_provider, message_loop_factory, media_stream_impl_, 2523 audio_source_provider, message_loop_factory, media_stream_impl_,
2524 render_media_log); 2524 render_media_log);
2525 if (!media_player) { 2525 if (!media_player) {
2526 EnsureMediaStreamImpl();
piman 2012/09/22 01:03:37 This looks heavy the first time (e.g. it creates a
wjia(left Chromium) 2012/09/22 17:04:42 That's a good point. In MediaStreamImpl, IsMediaSt
2527 if (cmd_line->HasSwitch(switches::kEnableWebMediaPlayerMS) &&
2528 media_stream_impl_ && media_stream_impl_->IsMediaStream(url)) {
2529 // TODO(wjia): when all patches related to WebMediaPlayerMS have been
2530 // landed, remove the switch. Refer to crbug.com/142988.
2531 return new webkit_media::WebMediaPlayerMS(
2532 frame, client, AsWeakPtr(), media_stream_impl_, render_media_log);
2533 }
2534
2526 media_player = new webkit_media::WebMediaPlayerImpl( 2535 media_player = new webkit_media::WebMediaPlayerImpl(
2527 frame, client, AsWeakPtr(), collection, audio_source_provider, 2536 frame, client, AsWeakPtr(), collection, audio_source_provider,
2528 audio_source_provider, message_loop_factory, media_stream_impl_, 2537 audio_source_provider, message_loop_factory, media_stream_impl_,
2529 render_media_log); 2538 render_media_log);
2530 } 2539 }
2531 return media_player; 2540 return media_player;
2532 } 2541 }
2533 2542
2534 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( 2543 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost(
2535 WebFrame* frame, WebApplicationCacheHostClient* client) { 2544 WebFrame* frame, WebApplicationCacheHostClient* client) {
(...skipping 3583 matching lines...) Expand 10 before | Expand all | Expand 10 after
6119 6128
6120 updating_frame_tree_ = true; 6129 updating_frame_tree_ = true;
6121 active_frame_id_map_.clear(); 6130 active_frame_id_map_.clear();
6122 6131
6123 target_process_id_ = process_id; 6132 target_process_id_ = process_id;
6124 target_routing_id_ = route_id; 6133 target_routing_id_ = route_id;
6125 CreateFrameTree(webview()->mainFrame(), frames); 6134 CreateFrameTree(webview()->mainFrame(), frames);
6126 6135
6127 updating_frame_tree_ = false; 6136 updating_frame_tree_ = false;
6128 } 6137 }
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_renderer.cc ('k') | media/video/capture/video_capture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698