| 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 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2320 return NULL; | 2320 return NULL; |
| 2321 #endif // defined(ENABLE_PLUGINS) | 2321 #endif // defined(ENABLE_PLUGINS) |
| 2322 } | 2322 } |
| 2323 | 2323 |
| 2324 blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( | 2324 blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( |
| 2325 blink::WebLocalFrame* frame, | 2325 blink::WebLocalFrame* frame, |
| 2326 const blink::WebURL& url, | 2326 const blink::WebURL& url, |
| 2327 WebMediaPlayerClient* client, | 2327 WebMediaPlayerClient* client, |
| 2328 WebMediaPlayerEncryptedMediaClient* encrypted_client, | 2328 WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| 2329 WebContentDecryptionModule* initial_cdm, | 2329 WebContentDecryptionModule* initial_cdm, |
| 2330 const blink::WebString& sink_id) { | 2330 const blink::WebString& sink_id, |
| 2331 WebMediaSession* session) { |
| 2331 #if defined(VIDEO_HOLE) | 2332 #if defined(VIDEO_HOLE) |
| 2332 if (!contains_media_player_) { | 2333 if (!contains_media_player_) { |
| 2333 render_view_->RegisterVideoHoleFrame(this); | 2334 render_view_->RegisterVideoHoleFrame(this); |
| 2334 contains_media_player_ = true; | 2335 contains_media_player_ = true; |
| 2335 } | 2336 } |
| 2336 #endif // defined(VIDEO_HOLE) | 2337 #endif // defined(VIDEO_HOLE) |
| 2337 | 2338 |
| 2338 blink::WebMediaStream web_stream( | 2339 blink::WebMediaStream web_stream( |
| 2339 blink::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url)); | 2340 blink::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url)); |
| 2340 if (!web_stream.isNull()) | 2341 if (!web_stream.isNull()) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2353 media::WebMediaPlayerParams params( | 2354 media::WebMediaPlayerParams params( |
| 2354 base::Bind(&ContentRendererClient::DeferMediaLoad, | 2355 base::Bind(&ContentRendererClient::DeferMediaLoad, |
| 2355 base::Unretained(GetContentClient()->renderer()), | 2356 base::Unretained(GetContentClient()->renderer()), |
| 2356 static_cast<RenderFrame*>(this), | 2357 static_cast<RenderFrame*>(this), |
| 2357 GetWebMediaPlayerDelegate()->has_played_media()), | 2358 GetWebMediaPlayerDelegate()->has_played_media()), |
| 2358 audio_renderer_sink, media_log, render_thread->GetMediaThreadTaskRunner(), | 2359 audio_renderer_sink, media_log, render_thread->GetMediaThreadTaskRunner(), |
| 2359 render_thread->GetWorkerTaskRunner(), | 2360 render_thread->GetWorkerTaskRunner(), |
| 2360 render_thread->compositor_task_runner(), context_3d_cb, | 2361 render_thread->compositor_task_runner(), context_3d_cb, |
| 2361 base::Bind(&v8::Isolate::AdjustAmountOfExternalAllocatedMemory, | 2362 base::Bind(&v8::Isolate::AdjustAmountOfExternalAllocatedMemory, |
| 2362 base::Unretained(blink::mainThreadIsolate())), | 2363 base::Unretained(blink::mainThreadIsolate())), |
| 2363 GetMediaPermission(), initial_cdm); | 2364 GetMediaPermission(), initial_cdm, session); |
| 2364 | 2365 |
| 2365 #if defined(OS_ANDROID) | 2366 #if defined(OS_ANDROID) |
| 2366 // We must use WMPA in when accelerated video decode is disabled becuase WMPI | 2367 // We must use WMPA in when accelerated video decode is disabled becuase WMPI |
| 2367 // is unlikely to have a fallback decoder. | 2368 // is unlikely to have a fallback decoder. |
| 2368 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2369 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2369 switches::kDisableAcceleratedVideoDecode) || | 2370 switches::kDisableAcceleratedVideoDecode) || |
| 2370 !media::MediaCodecUtil::IsMediaCodecAvailable() || | 2371 !media::MediaCodecUtil::IsMediaCodecAvailable() || |
| 2371 media::MediaCodecUtil::IsHLSPath(url)) { | 2372 media::MediaCodecUtil::IsHLSPath(url)) { |
| 2372 return CreateAndroidWebMediaPlayer(client, encrypted_client, params); | 2373 return CreateAndroidWebMediaPlayer(client, encrypted_client, params); |
| 2373 } else { | 2374 } else { |
| (...skipping 3344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5718 media::ConvertToSwitchOutputDeviceCB(web_callbacks); | 5719 media::ConvertToSwitchOutputDeviceCB(web_callbacks); |
| 5719 scoped_refptr<media::AudioOutputDevice> device = | 5720 scoped_refptr<media::AudioOutputDevice> device = |
| 5720 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), | 5721 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), |
| 5721 security_origin); | 5722 security_origin); |
| 5722 media::OutputDeviceStatus status = device->GetDeviceStatus(); | 5723 media::OutputDeviceStatus status = device->GetDeviceStatus(); |
| 5723 device->Stop(); | 5724 device->Stop(); |
| 5724 callback.Run(status); | 5725 callback.Run(status); |
| 5725 } | 5726 } |
| 5726 | 5727 |
| 5727 } // namespace content | 5728 } // namespace content |
| OLD | NEW |