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/media/webmediaplayer_impl.h" | 5 #include "content/renderer/media/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/callback_helpers.h" | 14 #include "base/callback_helpers.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/debug/alias.h" | 16 #include "base/debug/alias.h" |
17 #include "base/debug/crash_logging.h" | 17 #include "base/debug/crash_logging.h" |
18 #include "base/debug/trace_event.h" | 18 #include "base/debug/trace_event.h" |
19 #include "base/message_loop/message_loop_proxy.h" | 19 #include "base/message_loop/message_loop_proxy.h" |
20 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
23 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
24 #include "cc/layers/video_layer.h" | 24 #include "cc/layers/video_layer.h" |
25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
26 #include "content/public/renderer/render_frame.h" | 26 #include "content/public/renderer/render_frame.h" |
| 27 #include "content/renderer/compositor_bindings/web_layer_impl.h" |
27 #include "content/renderer/media/buffered_data_source.h" | 28 #include "content/renderer/media/buffered_data_source.h" |
28 #include "content/renderer/media/crypto/key_systems.h" | 29 #include "content/renderer/media/crypto/key_systems.h" |
29 #include "content/renderer/media/render_media_log.h" | 30 #include "content/renderer/media/render_media_log.h" |
30 #include "content/renderer/media/texttrack_impl.h" | 31 #include "content/renderer/media/texttrack_impl.h" |
31 #include "content/renderer/media/webaudiosourceprovider_impl.h" | 32 #include "content/renderer/media/webaudiosourceprovider_impl.h" |
32 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" | 33 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" |
33 #include "content/renderer/media/webinbandtexttrack_impl.h" | 34 #include "content/renderer/media/webinbandtexttrack_impl.h" |
34 #include "content/renderer/media/webmediaplayer_delegate.h" | 35 #include "content/renderer/media/webmediaplayer_delegate.h" |
35 #include "content/renderer/media/webmediaplayer_params.h" | 36 #include "content/renderer/media/webmediaplayer_params.h" |
36 #include "content/renderer/media/webmediaplayer_util.h" | 37 #include "content/renderer/media/webmediaplayer_util.h" |
(...skipping 27 matching lines...) Expand all Loading... |
64 #include "third_party/WebKit/public/platform/WebRect.h" | 65 #include "third_party/WebKit/public/platform/WebRect.h" |
65 #include "third_party/WebKit/public/platform/WebSize.h" | 66 #include "third_party/WebKit/public/platform/WebSize.h" |
66 #include "third_party/WebKit/public/platform/WebString.h" | 67 #include "third_party/WebKit/public/platform/WebString.h" |
67 #include "third_party/WebKit/public/platform/WebURL.h" | 68 #include "third_party/WebKit/public/platform/WebURL.h" |
68 #include "third_party/WebKit/public/web/WebDocument.h" | 69 #include "third_party/WebKit/public/web/WebDocument.h" |
69 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 70 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
70 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 71 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
71 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 72 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
72 #include "third_party/WebKit/public/web/WebView.h" | 73 #include "third_party/WebKit/public/web/WebView.h" |
73 #include "v8/include/v8.h" | 74 #include "v8/include/v8.h" |
74 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | |
75 | 75 |
76 #if defined(ENABLE_PEPPER_CDMS) | 76 #if defined(ENABLE_PEPPER_CDMS) |
77 #include "content/renderer/media/crypto/pepper_cdm_wrapper_impl.h" | 77 #include "content/renderer/media/crypto/pepper_cdm_wrapper_impl.h" |
78 #endif | 78 #endif |
79 | 79 |
80 using blink::WebCanvas; | 80 using blink::WebCanvas; |
81 using blink::WebMediaPlayer; | 81 using blink::WebMediaPlayer; |
82 using blink::WebRect; | 82 using blink::WebRect; |
83 using blink::WebSize; | 83 using blink::WebSize; |
84 using blink::WebString; | 84 using blink::WebString; |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 media::PipelineMetadata metadata) { | 979 media::PipelineMetadata metadata) { |
980 DVLOG(1) << "OnPipelineMetadata"; | 980 DVLOG(1) << "OnPipelineMetadata"; |
981 | 981 |
982 pipeline_metadata_ = metadata; | 982 pipeline_metadata_ = metadata; |
983 | 983 |
984 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); | 984 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); |
985 | 985 |
986 if (hasVideo()) { | 986 if (hasVideo()) { |
987 DCHECK(!video_weblayer_); | 987 DCHECK(!video_weblayer_); |
988 video_weblayer_.reset( | 988 video_weblayer_.reset( |
989 new webkit::WebLayerImpl(cc::VideoLayer::Create(compositor_))); | 989 new WebLayerImpl(cc::VideoLayer::Create(compositor_))); |
990 video_weblayer_->setOpaque(opaque_); | 990 video_weblayer_->setOpaque(opaque_); |
991 client_->setWebLayer(video_weblayer_.get()); | 991 client_->setWebLayer(video_weblayer_.get()); |
992 } | 992 } |
993 | 993 |
994 // TODO(scherkus): This should be handled by HTMLMediaElement and controls | 994 // TODO(scherkus): This should be handled by HTMLMediaElement and controls |
995 // should know when to invalidate themselves http://crbug.com/337015 | 995 // should know when to invalidate themselves http://crbug.com/337015 |
996 InvalidateOnMainThread(); | 996 InvalidateOnMainThread(); |
997 } | 997 } |
998 | 998 |
999 void WebMediaPlayerImpl::OnPipelinePrerollCompleted() { | 999 void WebMediaPlayerImpl::OnPipelinePrerollCompleted() { |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 compositor_task_runner_->PostTask(FROM_HERE, | 1369 compositor_task_runner_->PostTask(FROM_HERE, |
1370 base::Bind(&GetCurrentFrameAndSignal, | 1370 base::Bind(&GetCurrentFrameAndSignal, |
1371 base::Unretained(compositor_), | 1371 base::Unretained(compositor_), |
1372 &video_frame, | 1372 &video_frame, |
1373 &event)); | 1373 &event)); |
1374 event.Wait(); | 1374 event.Wait(); |
1375 return video_frame; | 1375 return video_frame; |
1376 } | 1376 } |
1377 | 1377 |
1378 } // namespace content | 1378 } // namespace content |
OLD | NEW |