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> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "third_party/WebKit/public/platform/WebRect.h" | 53 #include "third_party/WebKit/public/platform/WebRect.h" |
54 #include "third_party/WebKit/public/platform/WebSize.h" | 54 #include "third_party/WebKit/public/platform/WebSize.h" |
55 #include "third_party/WebKit/public/platform/WebString.h" | 55 #include "third_party/WebKit/public/platform/WebString.h" |
56 #include "third_party/WebKit/public/platform/WebURL.h" | 56 #include "third_party/WebKit/public/platform/WebURL.h" |
57 #include "third_party/WebKit/public/web/WebDocument.h" | 57 #include "third_party/WebKit/public/web/WebDocument.h" |
58 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 58 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
59 #include "third_party/WebKit/public/web/WebView.h" | 59 #include "third_party/WebKit/public/web/WebView.h" |
60 #include "v8/include/v8.h" | 60 #include "v8/include/v8.h" |
61 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 61 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
62 | 62 |
63 using WebKit::WebCanvas; | 63 using blink::WebCanvas; |
64 using WebKit::WebMediaPlayer; | 64 using blink::WebMediaPlayer; |
65 using WebKit::WebRect; | 65 using blink::WebRect; |
66 using WebKit::WebSize; | 66 using blink::WebSize; |
67 using WebKit::WebString; | 67 using blink::WebString; |
68 using media::PipelineStatus; | 68 using media::PipelineStatus; |
69 | 69 |
70 namespace { | 70 namespace { |
71 | 71 |
72 // Amount of extra memory used by each player instance reported to V8. | 72 // Amount of extra memory used by each player instance reported to V8. |
73 // It is not exact number -- first, it differs on different platforms, | 73 // It is not exact number -- first, it differs on different platforms, |
74 // and second, it is very hard to calculate. Instead, use some arbitrary | 74 // and second, it is very hard to calculate. Instead, use some arbitrary |
75 // value that will cause garbage collection from time to time. We don't want | 75 // value that will cause garbage collection from time to time. We don't want |
76 // it to happen on every allocation, but don't want 5k players to sit in memory | 76 // it to happen on every allocation, but don't want 5k players to sit in memory |
77 // either. Looks that chosen constant achieves both goals, at least for audio | 77 // either. Looks that chosen constant achieves both goals, at least for audio |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 #define BIND_TO_RENDER_LOOP_2(function, arg1, arg2) \ | 123 #define BIND_TO_RENDER_LOOP_2(function, arg1, arg2) \ |
124 media::BindToLoop(main_loop_, base::Bind(function, AsWeakPtr(), arg1, arg2)) | 124 media::BindToLoop(main_loop_, base::Bind(function, AsWeakPtr(), arg1, arg2)) |
125 | 125 |
126 static void LogMediaSourceError(const scoped_refptr<media::MediaLog>& media_log, | 126 static void LogMediaSourceError(const scoped_refptr<media::MediaLog>& media_log, |
127 const std::string& error) { | 127 const std::string& error) { |
128 media_log->AddEvent(media_log->CreateMediaSourceErrorEvent(error)); | 128 media_log->AddEvent(media_log->CreateMediaSourceErrorEvent(error)); |
129 } | 129 } |
130 | 130 |
131 WebMediaPlayerImpl::WebMediaPlayerImpl( | 131 WebMediaPlayerImpl::WebMediaPlayerImpl( |
132 WebKit::WebFrame* frame, | 132 blink::WebFrame* frame, |
133 WebKit::WebMediaPlayerClient* client, | 133 blink::WebMediaPlayerClient* client, |
134 base::WeakPtr<WebMediaPlayerDelegate> delegate, | 134 base::WeakPtr<WebMediaPlayerDelegate> delegate, |
135 const WebMediaPlayerParams& params) | 135 const WebMediaPlayerParams& params) |
136 : frame_(frame), | 136 : frame_(frame), |
137 network_state_(WebMediaPlayer::NetworkStateEmpty), | 137 network_state_(WebMediaPlayer::NetworkStateEmpty), |
138 ready_state_(WebMediaPlayer::ReadyStateHaveNothing), | 138 ready_state_(WebMediaPlayer::ReadyStateHaveNothing), |
139 main_loop_(base::MessageLoopProxy::current()), | 139 main_loop_(base::MessageLoopProxy::current()), |
140 media_loop_(params.message_loop_proxy()), | 140 media_loop_(params.message_loop_proxy()), |
141 paused_(true), | 141 paused_(true), |
142 seeking_(false), | 142 seeking_(false), |
143 playback_rate_(0.0f), | 143 playback_rate_(0.0f), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // | 177 // |
178 // TODO(enal): remove when we get rid of per-audio-stream thread. | 178 // TODO(enal): remove when we get rid of per-audio-stream thread. |
179 main_loop_->PostTask( | 179 main_loop_->PostTask( |
180 FROM_HERE, | 180 FROM_HERE, |
181 base::Bind(&WebMediaPlayerImpl::IncrementExternallyAllocatedMemory, | 181 base::Bind(&WebMediaPlayerImpl::IncrementExternallyAllocatedMemory, |
182 AsWeakPtr())); | 182 AsWeakPtr())); |
183 | 183 |
184 // Also we want to be notified of |main_loop_| destruction. | 184 // Also we want to be notified of |main_loop_| destruction. |
185 base::MessageLoop::current()->AddDestructionObserver(this); | 185 base::MessageLoop::current()->AddDestructionObserver(this); |
186 | 186 |
187 if (WebKit::WebRuntimeFeatures::isPrefixedEncryptedMediaEnabled()) { | 187 if (blink::WebRuntimeFeatures::isPrefixedEncryptedMediaEnabled()) { |
188 decryptor_.reset(new ProxyDecryptor( | 188 decryptor_.reset(new ProxyDecryptor( |
189 #if defined(ENABLE_PEPPER_CDMS) | 189 #if defined(ENABLE_PEPPER_CDMS) |
190 client, | 190 client, |
191 frame, | 191 frame, |
192 #endif | 192 #endif |
193 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnKeyAdded), | 193 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnKeyAdded), |
194 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnKeyError), | 194 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnKeyError), |
195 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnKeyMessage))); | 195 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnKeyMessage))); |
196 } | 196 } |
197 | 197 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 if (url.SchemeIs("javascript")) return kJavascriptURLScheme; | 248 if (url.SchemeIs("javascript")) return kJavascriptURLScheme; |
249 if (url.SchemeIs("file")) return kFileURLScheme; | 249 if (url.SchemeIs("file")) return kFileURLScheme; |
250 if (url.SchemeIs("blob")) return kBlobURLScheme; | 250 if (url.SchemeIs("blob")) return kBlobURLScheme; |
251 if (url.SchemeIs("data")) return kDataURLScheme; | 251 if (url.SchemeIs("data")) return kDataURLScheme; |
252 if (url.SchemeIs("filesystem")) return kFileSystemScheme; | 252 if (url.SchemeIs("filesystem")) return kFileSystemScheme; |
253 return kUnknownURLScheme; | 253 return kUnknownURLScheme; |
254 } | 254 } |
255 | 255 |
256 } // anonymous namespace | 256 } // anonymous namespace |
257 | 257 |
258 void WebMediaPlayerImpl::load(LoadType load_type, const WebKit::WebURL& url, | 258 void WebMediaPlayerImpl::load(LoadType load_type, const blink::WebURL& url, |
259 CORSMode cors_mode) { | 259 CORSMode cors_mode) { |
260 if (!defer_load_cb_.is_null()) { | 260 if (!defer_load_cb_.is_null()) { |
261 defer_load_cb_.Run(base::Bind( | 261 defer_load_cb_.Run(base::Bind( |
262 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); | 262 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); |
263 return; | 263 return; |
264 } | 264 } |
265 DoLoad(load_type, url, cors_mode); | 265 DoLoad(load_type, url, cors_mode); |
266 } | 266 } |
267 | 267 |
268 void WebMediaPlayerImpl::DoLoad(LoadType load_type, | 268 void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
269 const WebKit::WebURL& url, | 269 const blink::WebURL& url, |
270 CORSMode cors_mode) { | 270 CORSMode cors_mode) { |
271 DCHECK(main_loop_->BelongsToCurrentThread()); | 271 DCHECK(main_loop_->BelongsToCurrentThread()); |
272 | 272 |
273 GURL gurl(url); | 273 GURL gurl(url); |
274 UMA_HISTOGRAM_ENUMERATION("Media.URLScheme", URLScheme(gurl), kMaxURLScheme); | 274 UMA_HISTOGRAM_ENUMERATION("Media.URLScheme", URLScheme(gurl), kMaxURLScheme); |
275 | 275 |
276 // Set subresource URL for crash reporting. | 276 // Set subresource URL for crash reporting. |
277 base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); | 277 base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); |
278 | 278 |
279 load_type_ = load_type; | 279 load_type_ = load_type; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 428 |
429 return pipeline_->HasVideo(); | 429 return pipeline_->HasVideo(); |
430 } | 430 } |
431 | 431 |
432 bool WebMediaPlayerImpl::hasAudio() const { | 432 bool WebMediaPlayerImpl::hasAudio() const { |
433 DCHECK(main_loop_->BelongsToCurrentThread()); | 433 DCHECK(main_loop_->BelongsToCurrentThread()); |
434 | 434 |
435 return pipeline_->HasAudio(); | 435 return pipeline_->HasAudio(); |
436 } | 436 } |
437 | 437 |
438 WebKit::WebSize WebMediaPlayerImpl::naturalSize() const { | 438 blink::WebSize WebMediaPlayerImpl::naturalSize() const { |
439 DCHECK(main_loop_->BelongsToCurrentThread()); | 439 DCHECK(main_loop_->BelongsToCurrentThread()); |
440 | 440 |
441 gfx::Size size; | 441 gfx::Size size; |
442 pipeline_->GetNaturalVideoSize(&size); | 442 pipeline_->GetNaturalVideoSize(&size); |
443 return WebKit::WebSize(size); | 443 return blink::WebSize(size); |
444 } | 444 } |
445 | 445 |
446 bool WebMediaPlayerImpl::paused() const { | 446 bool WebMediaPlayerImpl::paused() const { |
447 DCHECK(main_loop_->BelongsToCurrentThread()); | 447 DCHECK(main_loop_->BelongsToCurrentThread()); |
448 | 448 |
449 return pipeline_->GetPlaybackRate() == 0.0f; | 449 return pipeline_->GetPlaybackRate() == 0.0f; |
450 } | 450 } |
451 | 451 |
452 bool WebMediaPlayerImpl::seeking() const { | 452 bool WebMediaPlayerImpl::seeking() const { |
453 DCHECK(main_loop_->BelongsToCurrentThread()); | 453 DCHECK(main_loop_->BelongsToCurrentThread()); |
(...skipping 21 matching lines...) Expand all Loading... |
475 WebMediaPlayer::NetworkState WebMediaPlayerImpl::networkState() const { | 475 WebMediaPlayer::NetworkState WebMediaPlayerImpl::networkState() const { |
476 DCHECK(main_loop_->BelongsToCurrentThread()); | 476 DCHECK(main_loop_->BelongsToCurrentThread()); |
477 return network_state_; | 477 return network_state_; |
478 } | 478 } |
479 | 479 |
480 WebMediaPlayer::ReadyState WebMediaPlayerImpl::readyState() const { | 480 WebMediaPlayer::ReadyState WebMediaPlayerImpl::readyState() const { |
481 DCHECK(main_loop_->BelongsToCurrentThread()); | 481 DCHECK(main_loop_->BelongsToCurrentThread()); |
482 return ready_state_; | 482 return ready_state_; |
483 } | 483 } |
484 | 484 |
485 const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() { | 485 const blink::WebTimeRanges& WebMediaPlayerImpl::buffered() { |
486 DCHECK(main_loop_->BelongsToCurrentThread()); | 486 DCHECK(main_loop_->BelongsToCurrentThread()); |
487 WebKit::WebTimeRanges web_ranges( | 487 blink::WebTimeRanges web_ranges( |
488 ConvertToWebTimeRanges(pipeline_->GetBufferedTimeRanges())); | 488 ConvertToWebTimeRanges(pipeline_->GetBufferedTimeRanges())); |
489 buffered_.swap(web_ranges); | 489 buffered_.swap(web_ranges); |
490 return buffered_; | 490 return buffered_; |
491 } | 491 } |
492 | 492 |
493 double WebMediaPlayerImpl::maxTimeSeekable() const { | 493 double WebMediaPlayerImpl::maxTimeSeekable() const { |
494 DCHECK(main_loop_->BelongsToCurrentThread()); | 494 DCHECK(main_loop_->BelongsToCurrentThread()); |
495 | 495 |
496 // If we haven't even gotten to ReadyStateHaveMetadata yet then just | 496 // If we haven't even gotten to ReadyStateHaveMetadata yet then just |
497 // return 0 so that the seekable range is empty. | 497 // return 0 so that the seekable range is empty. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 const scoped_refptr<media::VideoFrame>& frame) { | 607 const scoped_refptr<media::VideoFrame>& frame) { |
608 if (!accelerated_compositing_reported_) { | 608 if (!accelerated_compositing_reported_) { |
609 accelerated_compositing_reported_ = true; | 609 accelerated_compositing_reported_ = true; |
610 DCHECK(frame_->view()->isAcceleratedCompositingActive()); | 610 DCHECK(frame_->view()->isAcceleratedCompositingActive()); |
611 UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", true); | 611 UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", true); |
612 } | 612 } |
613 TRACE_EVENT_ASYNC_END0("media", "WebMediaPlayerImpl:compositing", this); | 613 TRACE_EVENT_ASYNC_END0("media", "WebMediaPlayerImpl:compositing", this); |
614 } | 614 } |
615 | 615 |
616 bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture( | 616 bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture( |
617 WebKit::WebGraphicsContext3D* web_graphics_context, | 617 blink::WebGraphicsContext3D* web_graphics_context, |
618 unsigned int texture, | 618 unsigned int texture, |
619 unsigned int level, | 619 unsigned int level, |
620 unsigned int internal_format, | 620 unsigned int internal_format, |
621 unsigned int type, | 621 unsigned int type, |
622 bool premultiply_alpha, | 622 bool premultiply_alpha, |
623 bool flip_y) { | 623 bool flip_y) { |
624 scoped_refptr<media::VideoFrame> video_frame; | 624 scoped_refptr<media::VideoFrame> video_frame; |
625 { | 625 { |
626 base::AutoLock auto_lock(lock_); | 626 base::AutoLock auto_lock(lock_); |
627 video_frame = current_frame_; | 627 video_frame = current_frame_; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 // performance will be better when it is added than not. | 686 // performance will be better when it is added than not. |
687 web_graphics_context->flush(); | 687 web_graphics_context->flush(); |
688 return true; | 688 return true; |
689 } | 689 } |
690 | 690 |
691 // Helper functions to report media EME related stats to UMA. They follow the | 691 // Helper functions to report media EME related stats to UMA. They follow the |
692 // convention of more commonly used macros UMA_HISTOGRAM_ENUMERATION and | 692 // convention of more commonly used macros UMA_HISTOGRAM_ENUMERATION and |
693 // UMA_HISTOGRAM_COUNTS. The reason that we cannot use those macros directly is | 693 // UMA_HISTOGRAM_COUNTS. The reason that we cannot use those macros directly is |
694 // that UMA_* macros require the names to be constant throughout the process' | 694 // that UMA_* macros require the names to be constant throughout the process' |
695 // lifetime. | 695 // lifetime. |
696 static void EmeUMAHistogramEnumeration(const WebKit::WebString& key_system, | 696 static void EmeUMAHistogramEnumeration(const blink::WebString& key_system, |
697 const std::string& method, | 697 const std::string& method, |
698 int sample, | 698 int sample, |
699 int boundary_value) { | 699 int boundary_value) { |
700 base::LinearHistogram::FactoryGet( | 700 base::LinearHistogram::FactoryGet( |
701 kMediaEme + KeySystemNameForUMA(key_system) + "." + method, | 701 kMediaEme + KeySystemNameForUMA(key_system) + "." + method, |
702 1, boundary_value, boundary_value + 1, | 702 1, boundary_value, boundary_value + 1, |
703 base::Histogram::kUmaTargetedHistogramFlag)->Add(sample); | 703 base::Histogram::kUmaTargetedHistogramFlag)->Add(sample); |
704 } | 704 } |
705 | 705 |
706 static void EmeUMAHistogramCounts(const WebKit::WebString& key_system, | 706 static void EmeUMAHistogramCounts(const blink::WebString& key_system, |
707 const std::string& method, | 707 const std::string& method, |
708 int sample) { | 708 int sample) { |
709 // Use the same parameters as UMA_HISTOGRAM_COUNTS. | 709 // Use the same parameters as UMA_HISTOGRAM_COUNTS. |
710 base::Histogram::FactoryGet( | 710 base::Histogram::FactoryGet( |
711 kMediaEme + KeySystemNameForUMA(key_system) + "." + method, | 711 kMediaEme + KeySystemNameForUMA(key_system) + "." + method, |
712 1, 1000000, 50, base::Histogram::kUmaTargetedHistogramFlag)->Add(sample); | 712 1, 1000000, 50, base::Histogram::kUmaTargetedHistogramFlag)->Add(sample); |
713 } | 713 } |
714 | 714 |
715 // Helper enum for reporting generateKeyRequest/addKey histograms. | 715 // Helper enum for reporting generateKeyRequest/addKey histograms. |
716 enum MediaKeyException { | 716 enum MediaKeyException { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 init_data_ptr, | 992 init_data_ptr, |
993 init_data.size()); | 993 init_data.size()); |
994 } | 994 } |
995 | 995 |
996 scoped_ptr<media::TextTrack> | 996 scoped_ptr<media::TextTrack> |
997 WebMediaPlayerImpl::OnTextTrack(media::TextKind kind, | 997 WebMediaPlayerImpl::OnTextTrack(media::TextKind kind, |
998 const std::string& label, | 998 const std::string& label, |
999 const std::string& language) { | 999 const std::string& language) { |
1000 typedef WebInbandTextTrackImpl::Kind webkind_t; | 1000 typedef WebInbandTextTrackImpl::Kind webkind_t; |
1001 const webkind_t webkind = static_cast<webkind_t>(kind); | 1001 const webkind_t webkind = static_cast<webkind_t>(kind); |
1002 const WebKit::WebString weblabel = WebKit::WebString::fromUTF8(label); | 1002 const blink::WebString weblabel = blink::WebString::fromUTF8(label); |
1003 const WebKit::WebString weblanguage = WebKit::WebString::fromUTF8(language); | 1003 const blink::WebString weblanguage = blink::WebString::fromUTF8(language); |
1004 | 1004 |
1005 WebInbandTextTrackImpl* const text_track = | 1005 WebInbandTextTrackImpl* const text_track = |
1006 new WebInbandTextTrackImpl(webkind, weblabel, weblanguage, | 1006 new WebInbandTextTrackImpl(webkind, weblabel, weblanguage, |
1007 text_track_index_++); | 1007 text_track_index_++); |
1008 | 1008 |
1009 return scoped_ptr<media::TextTrack>(new TextTrackImpl(GetClient(), | 1009 return scoped_ptr<media::TextTrack>(new TextTrackImpl(GetClient(), |
1010 text_track)); | 1010 text_track)); |
1011 } | 1011 } |
1012 | 1012 |
1013 void WebMediaPlayerImpl::OnKeyError(const std::string& session_id, | 1013 void WebMediaPlayerImpl::OnKeyError(const std::string& session_id, |
1014 media::MediaKeys::KeyError error_code, | 1014 media::MediaKeys::KeyError error_code, |
1015 int system_code) { | 1015 int system_code) { |
1016 DCHECK(main_loop_->BelongsToCurrentThread()); | 1016 DCHECK(main_loop_->BelongsToCurrentThread()); |
1017 | 1017 |
1018 EmeUMAHistogramEnumeration(current_key_system_, "KeyError", | 1018 EmeUMAHistogramEnumeration(current_key_system_, "KeyError", |
1019 error_code, media::MediaKeys::kMaxKeyError); | 1019 error_code, media::MediaKeys::kMaxKeyError); |
1020 | 1020 |
1021 GetClient()->keyError( | 1021 GetClient()->keyError( |
1022 current_key_system_, | 1022 current_key_system_, |
1023 WebString::fromUTF8(session_id), | 1023 WebString::fromUTF8(session_id), |
1024 static_cast<WebKit::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), | 1024 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), |
1025 system_code); | 1025 system_code); |
1026 } | 1026 } |
1027 | 1027 |
1028 void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id, | 1028 void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id, |
1029 const std::vector<uint8>& message, | 1029 const std::vector<uint8>& message, |
1030 const std::string& default_url) { | 1030 const std::string& default_url) { |
1031 DCHECK(main_loop_->BelongsToCurrentThread()); | 1031 DCHECK(main_loop_->BelongsToCurrentThread()); |
1032 | 1032 |
1033 const GURL default_url_gurl(default_url); | 1033 const GURL default_url_gurl(default_url); |
1034 DLOG_IF(WARNING, !default_url.empty() && !default_url_gurl.is_valid()) | 1034 DLOG_IF(WARNING, !default_url.empty() && !default_url_gurl.is_valid()) |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 v8::V8::AdjustAmountOfExternalAllocatedMemory(-kPlayerExtraMemory); | 1232 v8::V8::AdjustAmountOfExternalAllocatedMemory(-kPlayerExtraMemory); |
1233 incremented_externally_allocated_memory_ = false; | 1233 incremented_externally_allocated_memory_ = false; |
1234 } | 1234 } |
1235 | 1235 |
1236 // Release any final references now that everything has stopped. | 1236 // Release any final references now that everything has stopped. |
1237 pipeline_.reset(); | 1237 pipeline_.reset(); |
1238 demuxer_.reset(); | 1238 demuxer_.reset(); |
1239 data_source_.reset(); | 1239 data_source_.reset(); |
1240 } | 1240 } |
1241 | 1241 |
1242 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { | 1242 blink::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { |
1243 DCHECK(main_loop_->BelongsToCurrentThread()); | 1243 DCHECK(main_loop_->BelongsToCurrentThread()); |
1244 DCHECK(client_); | 1244 DCHECK(client_); |
1245 return client_; | 1245 return client_; |
1246 } | 1246 } |
1247 | 1247 |
1248 WebKit::WebAudioSourceProvider* WebMediaPlayerImpl::audioSourceProvider() { | 1248 blink::WebAudioSourceProvider* WebMediaPlayerImpl::audioSourceProvider() { |
1249 return audio_source_provider_.get(); | 1249 return audio_source_provider_.get(); |
1250 } | 1250 } |
1251 | 1251 |
1252 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1252 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
1253 DCHECK(main_loop_->BelongsToCurrentThread()); | 1253 DCHECK(main_loop_->BelongsToCurrentThread()); |
1254 incremented_externally_allocated_memory_ = true; | 1254 incremented_externally_allocated_memory_ = true; |
1255 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1255 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
1256 } | 1256 } |
1257 | 1257 |
1258 double WebMediaPlayerImpl::GetPipelineDuration() const { | 1258 double WebMediaPlayerImpl::GetPipelineDuration() const { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 // The |current_frame_| wasn't painted, it is being replaced, and we haven't | 1318 // The |current_frame_| wasn't painted, it is being replaced, and we haven't |
1319 // even gotten the chance to request a repaint for it yet. Mark it as dropped. | 1319 // even gotten the chance to request a repaint for it yet. Mark it as dropped. |
1320 TRACE_EVENT0("media", "WebMediaPlayerImpl:frameDropped"); | 1320 TRACE_EVENT0("media", "WebMediaPlayerImpl:frameDropped"); |
1321 DVLOG(1) << "Frame dropped before being painted: " | 1321 DVLOG(1) << "Frame dropped before being painted: " |
1322 << current_frame_->GetTimestamp().InSecondsF(); | 1322 << current_frame_->GetTimestamp().InSecondsF(); |
1323 if (frames_dropped_before_paint_ < kuint32max) | 1323 if (frames_dropped_before_paint_ < kuint32max) |
1324 frames_dropped_before_paint_++; | 1324 frames_dropped_before_paint_++; |
1325 } | 1325 } |
1326 | 1326 |
1327 } // namespace content | 1327 } // namespace content |
OLD | NEW |