OLD | NEW |
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 "webkit/media/webmediaplayer_impl.h" | 5 #include "webkit/media/webmediaplayer_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
33 #include "v8/include/v8.h" | 33 #include "v8/include/v8.h" |
34 #include "webkit/media/buffered_data_source.h" | 34 #include "webkit/media/buffered_data_source.h" |
35 #include "webkit/media/filter_helpers.h" | 35 #include "webkit/media/filter_helpers.h" |
36 #include "webkit/media/webmediaplayer_delegate.h" | 36 #include "webkit/media/webmediaplayer_delegate.h" |
37 #include "webkit/media/webmediaplayer_proxy.h" | 37 #include "webkit/media/webmediaplayer_proxy.h" |
38 #include "webkit/media/webmediaplayer_util.h" | 38 #include "webkit/media/webmediaplayer_util.h" |
39 #include "webkit/media/webvideoframe_impl.h" | 39 #include "webkit/media/webvideoframe_impl.h" |
| 40 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
40 | 41 |
41 using WebKit::WebCanvas; | 42 using WebKit::WebCanvas; |
42 using WebKit::WebMediaPlayer; | 43 using WebKit::WebMediaPlayer; |
43 using WebKit::WebRect; | 44 using WebKit::WebRect; |
44 using WebKit::WebSize; | 45 using WebKit::WebSize; |
45 using WebKit::WebString; | 46 using WebKit::WebString; |
46 using media::PipelineStatus; | 47 using media::PipelineStatus; |
47 | 48 |
48 namespace { | 49 namespace { |
49 | 50 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 client_(client), | 125 client_(client), |
125 proxy_(new WebMediaPlayerProxy(main_loop_->message_loop_proxy(), this)), | 126 proxy_(new WebMediaPlayerProxy(main_loop_->message_loop_proxy(), this)), |
126 delegate_(delegate), | 127 delegate_(delegate), |
127 media_stream_client_(media_stream_client), | 128 media_stream_client_(media_stream_client), |
128 media_log_(media_log), | 129 media_log_(media_log), |
129 accelerated_compositing_reported_(false), | 130 accelerated_compositing_reported_(false), |
130 incremented_externally_allocated_memory_(false), | 131 incremented_externally_allocated_memory_(false), |
131 audio_source_provider_(audio_source_provider), | 132 audio_source_provider_(audio_source_provider), |
132 audio_renderer_sink_(audio_renderer_sink), | 133 audio_renderer_sink_(audio_renderer_sink), |
133 is_local_source_(false), | 134 is_local_source_(false), |
134 decryptor_(proxy_.get()) { | 135 decryptor_(proxy_.get(), client, frame) { |
135 media_log_->AddEvent( | 136 media_log_->AddEvent( |
136 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 137 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
137 | 138 |
138 MessageLoop* pipeline_message_loop = | 139 MessageLoop* pipeline_message_loop = |
139 message_loop_factory_->GetMessageLoop("PipelineThread"); | 140 message_loop_factory_->GetMessageLoop("PipelineThread"); |
140 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); | 141 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); |
141 | 142 |
142 // Let V8 know we started new thread if we did not did it yet. | 143 // Let V8 know we started new thread if we did not did it yet. |
143 // Made separate task to avoid deletion of player currently being created. | 144 // Made separate task to avoid deletion of player currently being created. |
144 // Also, delaying GC until after player starts gets rid of starting lag -- | 145 // Also, delaying GC until after player starts gets rid of starting lag -- |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 return audio_source_provider_; | 1050 return audio_source_provider_; |
1050 } | 1051 } |
1051 | 1052 |
1052 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1053 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
1053 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1054 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1054 incremented_externally_allocated_memory_ = true; | 1055 incremented_externally_allocated_memory_ = true; |
1055 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1056 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
1056 } | 1057 } |
1057 | 1058 |
1058 } // namespace webkit_media | 1059 } // namespace webkit_media |
OLD | NEW |