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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 2477323003: Stop suspending the pipeline before HaveFutureData while decoding (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.h ('k') | media/blink/webmediaplayer_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/media/webmediaplayer_ms.h" 5 #include "content/renderer/media/webmediaplayer_ms.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 DCHECK(thread_checker_.CalledOnValidThread()); 415 DCHECK(thread_checker_.CalledOnValidThread());
416 416
417 render_frame_suspended_ = false; 417 render_frame_suspended_ = false;
418 418
419 // Resume playback on visibility. play() clears |should_play_upon_shown_|. 419 // Resume playback on visibility. play() clears |should_play_upon_shown_|.
420 if (should_play_upon_shown_) 420 if (should_play_upon_shown_)
421 play(); 421 play();
422 #endif // defined(OS_ANDROID) 422 #endif // defined(OS_ANDROID)
423 } 423 }
424 424
425 void WebMediaPlayerMS::OnSuspendRequested(bool must_suspend) { 425 bool WebMediaPlayerMS::OnSuspendRequested(bool must_suspend) {
426 #if defined(OS_ANDROID) 426 #if defined(OS_ANDROID)
427 if (!must_suspend) 427 if (!must_suspend)
428 return; 428 return false;
429 429
430 if (!paused_) { 430 if (!paused_) {
431 pause(); 431 pause();
432 should_play_upon_shown_ = true; 432 should_play_upon_shown_ = true;
433 } 433 }
434 434
435 if (delegate_) 435 if (delegate_)
436 delegate_->PlayerGone(delegate_id_); 436 delegate_->PlayerGone(delegate_id_);
437 437
438 render_frame_suspended_ = true; 438 render_frame_suspended_ = true;
439 #endif 439 #endif
440 return true;
440 } 441 }
441 442
442 void WebMediaPlayerMS::OnPlay() { 443 void WebMediaPlayerMS::OnPlay() {
443 // TODO(perkj, magjed): It's not clear how WebRTC should work with an 444 // TODO(perkj, magjed): It's not clear how WebRTC should work with an
444 // MediaSession, until these issues are resolved, disable session controls. 445 // MediaSession, until these issues are resolved, disable session controls.
445 // http://crbug.com/595297. 446 // http://crbug.com/595297.
446 } 447 }
447 448
448 void WebMediaPlayerMS::OnPause() { 449 void WebMediaPlayerMS::OnPause() {
449 // TODO(perkj, magjed): See TODO in Onplay(). 450 // TODO(perkj, magjed): See TODO in Onplay().
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 void WebMediaPlayerMS::ResetCanvasCache() { 563 void WebMediaPlayerMS::ResetCanvasCache() {
563 DCHECK(thread_checker_.CalledOnValidThread()); 564 DCHECK(thread_checker_.CalledOnValidThread());
564 video_renderer_.ResetCache(); 565 video_renderer_.ResetCache();
565 } 566 }
566 567
567 void WebMediaPlayerMS::TriggerResize() { 568 void WebMediaPlayerMS::TriggerResize() {
568 get_client()->sizeChanged(); 569 get_client()->sizeChanged();
569 } 570 }
570 571
571 } // namespace content 572 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.h ('k') | media/blink/webmediaplayer_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698