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

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

Issue 2644723004: [Video] Don't pause video-only elements if they're already paused... (Closed)
Patch Set: Added PauseVideoIfNeeded Created 3 years, 11 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
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | media/blink/webmediaplayer_impl.cc » ('J')
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 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 // Whether the video track should be disabled when hidden. Uses metadata so 384 // Whether the video track should be disabled when hidden. Uses metadata so
385 // has meaning only after the pipeline has started, otherwise returns false. 385 // has meaning only after the pipeline has started, otherwise returns false.
386 bool ShouldDisableVideoWhenHidden() const; 386 bool ShouldDisableVideoWhenHidden() const;
387 387
388 // Whether the video is suitable for background playback optimizations (either 388 // Whether the video is suitable for background playback optimizations (either
389 // pausing it or disabling the video track). Uses metadata so has meaning only 389 // pausing it or disabling the video track). Uses metadata so has meaning only
390 // after the pipeline has started, otherwise returns false. 390 // after the pipeline has started, otherwise returns false.
391 bool IsBackgroundOptimizationCandidate() const; 391 bool IsBackgroundOptimizationCandidate() const;
392 392
393 // Pauses a hidden video only player to save power if possible.
394 // Must be called when either of the following happens:
395 // - right after the video was hidden,
396 // - right ater the pipeline has resumed if the video is hidden.
397 void PauseVideoIfNeeded();
398
393 // Disables the video track to save power if possible. 399 // Disables the video track to save power if possible.
394 // Must be called when either of the following happens: 400 // Must be called when either of the following happens:
395 // - right after the video was hidden, 401 // - right after the video was hidden,
396 // - right after the pipeline has started (|seeking_| is used to detect the 402 // - right after the pipeline has started (|seeking_| is used to detect the
397 // when pipeline started) if the video is hidden, 403 // when pipeline started) if the video is hidden,
398 // - right ater the pipeline has resumed if the video is hidden. 404 // - right ater the pipeline has resumed if the video is hidden.
399 void DisableVideoTrackIfNeeded(); 405 void DisableVideoTrackIfNeeded();
400 406
401 // Enables the video track if it was disabled before to save power. 407 // Enables the video track if it was disabled before to save power.
402 // Must be called when either of the following happens: 408 // Must be called when either of the following happens:
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 669
664 // Pipeline media duration overridden by tests. 670 // Pipeline media duration overridden by tests.
665 base::Optional<base::TimeDelta> pipeline_media_duration_for_test_; 671 base::Optional<base::TimeDelta> pipeline_media_duration_for_test_;
666 672
667 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 673 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
668 }; 674 };
669 675
670 } // namespace media 676 } // namespace media
671 677
672 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 678 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | media/blink/webmediaplayer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698