OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2481 media::WebMediaPlayerParams params( | 2481 media::WebMediaPlayerParams params( |
2482 base::Bind(&ContentRendererClient::DeferMediaLoad, | 2482 base::Bind(&ContentRendererClient::DeferMediaLoad, |
2483 base::Unretained(GetContentClient()->renderer()), | 2483 base::Unretained(GetContentClient()->renderer()), |
2484 static_cast<RenderFrame*>(this), | 2484 static_cast<RenderFrame*>(this), |
2485 GetWebMediaPlayerDelegate()->has_played_media()), | 2485 GetWebMediaPlayerDelegate()->has_played_media()), |
2486 audio_renderer_sink, media_log, render_thread->GetMediaThreadTaskRunner(), | 2486 audio_renderer_sink, media_log, render_thread->GetMediaThreadTaskRunner(), |
2487 render_thread->GetWorkerTaskRunner(), | 2487 render_thread->GetWorkerTaskRunner(), |
2488 render_thread->compositor_task_runner(), context_3d_cb, | 2488 render_thread->compositor_task_runner(), context_3d_cb, |
2489 base::Bind(&v8::Isolate::AdjustAmountOfExternalAllocatedMemory, | 2489 base::Bind(&v8::Isolate::AdjustAmountOfExternalAllocatedMemory, |
2490 base::Unretained(blink::mainThreadIsolate())), | 2490 base::Unretained(blink::mainThreadIsolate())), |
2491 GetMediaPermission(), initial_cdm, media_surface_manager_, media_session); | 2491 initial_cdm, media_surface_manager_, media_session); |
2492 | 2492 |
2493 #if defined(OS_ANDROID) | 2493 #if defined(OS_ANDROID) |
2494 if (!UseWebMediaPlayerImpl(load_type, url)) | 2494 if (!UseWebMediaPlayerImpl(load_type, url)) |
2495 return CreateAndroidWebMediaPlayer(client, encrypted_client, params); | 2495 return CreateAndroidWebMediaPlayer(client, encrypted_client, params); |
2496 #endif // defined(OS_ANDROID) | 2496 #endif // defined(OS_ANDROID) |
2497 | 2497 |
2498 #if defined(ENABLE_MOJO_RENDERER) | 2498 #if defined(ENABLE_MOJO_RENDERER) |
2499 scoped_ptr<media::RendererFactory> media_renderer_factory( | 2499 scoped_ptr<media::RendererFactory> media_renderer_factory( |
2500 new media::MojoRendererFactory(GetMediaServiceFactory())); | 2500 new media::MojoRendererFactory(GetMediaServiceFactory())); |
2501 #else | 2501 #else |
2502 scoped_ptr<media::RendererFactory> media_renderer_factory = | 2502 scoped_ptr<media::RendererFactory> media_renderer_factory = |
2503 GetContentClient()->renderer()->CreateMediaRendererFactory( | 2503 GetContentClient()->renderer()->CreateMediaRendererFactory( |
2504 this, render_thread->GetGpuFactories(), media_log); | 2504 this, render_thread->GetGpuFactories(), media_log); |
2505 | 2505 |
2506 if (!media_renderer_factory.get()) { | 2506 if (!media_renderer_factory.get()) { |
2507 media_renderer_factory.reset(new media::DefaultRendererFactory( | 2507 media_renderer_factory.reset(new media::DefaultRendererFactory( |
2508 media_log, render_thread->GetGpuFactories(), | 2508 media_log, render_thread->GetGpuFactories(), |
2509 *render_thread->GetAudioHardwareConfig())); | 2509 *render_thread->GetAudioHardwareConfig())); |
2510 } | 2510 } |
2511 #endif // defined(ENABLE_MOJO_RENDERER) | 2511 #endif // defined(ENABLE_MOJO_RENDERER) |
2512 | 2512 |
2513 if (!url_index_.get() || url_index_->frame() != frame_) | 2513 if (!url_index_.get() || url_index_->frame() != frame_) |
2514 url_index_.reset(new media::UrlIndex(frame_)); | 2514 url_index_.reset(new media::UrlIndex(frame_)); |
2515 | 2515 |
2516 media::WebMediaPlayerImpl* media_player = new media::WebMediaPlayerImpl( | 2516 media::WebMediaPlayerImpl* media_player = new media::WebMediaPlayerImpl( |
2517 frame_, client, encrypted_client, | 2517 frame_, client, encrypted_client, |
2518 GetWebMediaPlayerDelegate()->AsWeakPtr(), | 2518 GetWebMediaPlayerDelegate()->AsWeakPtr(), |
2519 std::move(media_renderer_factory), GetCdmFactory(), url_index_, params); | 2519 std::move(media_renderer_factory), url_index_, params); |
2520 | 2520 |
2521 #if defined(OS_ANDROID) // WMPI_CAST | 2521 #if defined(OS_ANDROID) // WMPI_CAST |
2522 media_player->SetMediaPlayerManager(GetMediaPlayerManager()); | 2522 media_player->SetMediaPlayerManager(GetMediaPlayerManager()); |
2523 media_player->SetDeviceScaleFactor(render_view_->GetDeviceScaleFactor()); | 2523 media_player->SetDeviceScaleFactor(render_view_->GetDeviceScaleFactor()); |
2524 #endif | 2524 #endif |
2525 | 2525 |
2526 return media_player; | 2526 return media_player; |
2527 } | 2527 } |
2528 | 2528 |
2529 blink::WebMediaSession* RenderFrameImpl::createMediaSession() { | 2529 blink::WebMediaSession* RenderFrameImpl::createMediaSession() { |
(...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5925 const media::WebMediaPlayerParams& params) { | 5925 const media::WebMediaPlayerParams& params) { |
5926 scoped_refptr<StreamTextureFactory> stream_texture_factory = | 5926 scoped_refptr<StreamTextureFactory> stream_texture_factory = |
5927 RenderThreadImpl::current()->GetStreamTexureFactory(); | 5927 RenderThreadImpl::current()->GetStreamTexureFactory(); |
5928 if (!stream_texture_factory.get()) { | 5928 if (!stream_texture_factory.get()) { |
5929 LOG(ERROR) << "Failed to get stream texture factory!"; | 5929 LOG(ERROR) << "Failed to get stream texture factory!"; |
5930 return NULL; | 5930 return NULL; |
5931 } | 5931 } |
5932 | 5932 |
5933 bool enable_texture_copy = | 5933 bool enable_texture_copy = |
5934 RenderThreadImpl::current()->EnableStreamTextureCopy(); | 5934 RenderThreadImpl::current()->EnableStreamTextureCopy(); |
5935 return new WebMediaPlayerAndroid(frame_, client, encrypted_client, | 5935 return new WebMediaPlayerAndroid( |
5936 GetWebMediaPlayerDelegate()->AsWeakPtr(), | 5936 frame_, client, encrypted_client, |
5937 GetMediaPlayerManager(), GetCdmFactory(), | 5937 GetWebMediaPlayerDelegate()->AsWeakPtr(), GetMediaPlayerManager(), |
5938 stream_texture_factory, routing_id_, | 5938 stream_texture_factory, routing_id_, enable_texture_copy, params); |
5939 enable_texture_copy, params); | |
5940 } | 5939 } |
5941 | 5940 |
5942 RendererMediaPlayerManager* RenderFrameImpl::GetMediaPlayerManager() { | 5941 RendererMediaPlayerManager* RenderFrameImpl::GetMediaPlayerManager() { |
5943 if (!media_player_manager_) | 5942 if (!media_player_manager_) |
5944 media_player_manager_ = new RendererMediaPlayerManager(this); | 5943 media_player_manager_ = new RendererMediaPlayerManager(this); |
5945 return media_player_manager_; | 5944 return media_player_manager_; |
5946 } | 5945 } |
5947 | 5946 |
5948 RendererMediaSessionManager* RenderFrameImpl::GetMediaSessionManager() { | 5947 RendererMediaSessionManager* RenderFrameImpl::GetMediaSessionManager() { |
5949 if (!media_session_manager_) | 5948 if (!media_session_manager_) |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6086 int match_count, | 6085 int match_count, |
6087 int ordinal, | 6086 int ordinal, |
6088 const WebRect& selection_rect, | 6087 const WebRect& selection_rect, |
6089 bool final_status_update) { | 6088 bool final_status_update) { |
6090 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6089 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
6091 selection_rect, ordinal, | 6090 selection_rect, ordinal, |
6092 final_status_update)); | 6091 final_status_update)); |
6093 } | 6092 } |
6094 | 6093 |
6095 } // namespace content | 6094 } // namespace content |
OLD | NEW |