Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1557)

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 2696893002: [Blink>Media] Add heuristic for dominant video detection for Android (Closed)
Patch Set: fixing logic in WMPI Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "media/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <string> 10 #include <string>
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 void WebMediaPlayerImpl::enteredFullscreen() { 349 void WebMediaPlayerImpl::enteredFullscreen() {
350 // |force_video_overlays_| implies that we're already in overlay mode, so take 350 // |force_video_overlays_| implies that we're already in overlay mode, so take
351 // no action here. Otherwise, switch to an overlay if it's allowed and if 351 // no action here. Otherwise, switch to an overlay if it's allowed and if
352 // it will display properly. 352 // it will display properly.
353 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ && 353 if (!force_video_overlays_ && enable_fullscreen_video_overlays_ &&
354 DoesOverlaySupportMetadata()) { 354 DoesOverlaySupportMetadata()) {
355 EnableOverlay(); 355 EnableOverlay();
356 } 356 }
357 if (observer_) 357 if (observer_)
358 observer_->OnEnteredFullscreen(); 358 observer_->OnEnteredFullscreen();
359 delegate_->SetIsEffectivelyFullscreen(delegate_id_, true);
360 } 359 }
361 360
362 void WebMediaPlayerImpl::exitedFullscreen() { 361 void WebMediaPlayerImpl::exitedFullscreen() {
363 // If we're in overlay mode, then exit it unless we're supposed to be in 362 // If we're in overlay mode, then exit it unless we're supposed to be in
364 // overlay mode all the time. 363 // overlay mode all the time.
365 if (!force_video_overlays_ && overlay_enabled_) 364 if (!force_video_overlays_ && overlay_enabled_)
366 DisableOverlay(); 365 DisableOverlay();
367 if (observer_) 366 if (observer_)
368 observer_->OnExitedFullscreen(); 367 observer_->OnExitedFullscreen();
369 delegate_->SetIsEffectivelyFullscreen(delegate_id_, false);
370 } 368 }
371 369
372 void WebMediaPlayerImpl::becameDominantVisibleContent(bool isDominant) { 370 void WebMediaPlayerImpl::becameDominantVisibleContent(bool isDominant) {
373 if (observer_) 371 if (observer_)
374 observer_->OnBecameDominantVisibleContent(isDominant); 372 observer_->OnBecameDominantVisibleContent(isDominant);
375 } 373 }
376 374
375 void WebMediaPlayerImpl::setIsEffectivelyFullscreen(
376 bool isEffectivelyFullscreen) {
377 delegate_->SetIsEffectivelyFullscreen(delegate_id_, isEffectivelyFullscreen);
378 }
379
377 void WebMediaPlayerImpl::DoLoad(LoadType load_type, 380 void WebMediaPlayerImpl::DoLoad(LoadType load_type,
378 const blink::WebURL& url, 381 const blink::WebURL& url,
379 CORSMode cors_mode) { 382 CORSMode cors_mode) {
380 DVLOG(1) << __func__; 383 DVLOG(1) << __func__;
381 DCHECK(main_task_runner_->BelongsToCurrentThread()); 384 DCHECK(main_task_runner_->BelongsToCurrentThread());
382 385
383 GURL gurl(url); 386 GURL gurl(url);
384 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin()); 387 ReportMetrics(load_type, gurl, frame_->getSecurityOrigin());
385 388
386 // Set subresource URL for crash reporting. 389 // Set subresource URL for crash reporting.
(...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 2300
2298 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) { 2301 void WebMediaPlayerImpl::RecordUnderflowDuration(base::TimeDelta duration) {
2299 DCHECK(data_source_ || chunk_demuxer_); 2302 DCHECK(data_source_ || chunk_demuxer_);
2300 if (data_source_) 2303 if (data_source_)
2301 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration); 2304 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration", duration);
2302 else 2305 else
2303 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration); 2306 UMA_HISTOGRAM_TIMES("Media.UnderflowDuration.MSE", duration);
2304 } 2307 }
2305 2308
2306 } // namespace media 2309 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698