| Index: media/blink/video_frame_compositor.h
|
| diff --git a/media/blink/video_frame_compositor.h b/media/blink/video_frame_compositor.h
|
| index 03fb4c5d489f5926b264645fb4ab342c3e247a28..ab70cc1637b35eb344a00d25c744b7f6b88225d2 100644
|
| --- a/media/blink/video_frame_compositor.h
|
| +++ b/media/blink/video_frame_compositor.h
|
| @@ -10,6 +10,7 @@
|
| #include "base/callback.h"
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/optional.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/synchronization/lock.h"
|
| #include "base/time/tick_clock.h"
|
| @@ -103,10 +104,15 @@ class MEDIA_BLINK_EXPORT VideoFrameCompositor
|
| // PaintSingleFrame() is not also called while stopped.)
|
| base::TimeDelta GetCurrentFrameTimestamp() const;
|
|
|
| - // Called when the media player is brought to the foreground.
|
| + // Enumerates the ways background video could be optimized.
|
| + enum class BackgroundVideoOptimization { Paused, DisabledTrack };
|
| +
|
| + // Called when the media player is brought to the foreground and was or could
|
| + // be optimized when in the background.
|
| // Used to record the time it takes to process the first frame after that.
|
| // Must be called on the compositor thread.
|
| - void SetForegroundTime(base::TimeTicks when);
|
| + void SetForegroundTime(base::TimeTicks when,
|
| + BackgroundVideoOptimization optimization);
|
|
|
| void set_tick_clock_for_testing(std::unique_ptr<base::TickClock> tick_clock) {
|
| tick_clock_ = std::move(tick_clock);
|
| @@ -163,6 +169,7 @@ class MEDIA_BLINK_EXPORT VideoFrameCompositor
|
| base::TimeDelta last_interval_;
|
| base::TimeTicks last_background_render_;
|
| base::TimeTicks foreground_time_;
|
| + base::Optional<BackgroundVideoOptimization> background_video_optimization_;
|
|
|
| // These values are set on the compositor thread, but also read on the media
|
| // thread when the VFC is stopped.
|
|
|