| Index: media/remoting/remoting_controller.h
|
| diff --git a/media/remoting/remoting_controller.h b/media/remoting/remoting_controller.h
|
| index f565d66d89a5d6b6e8340f9a8a42af296d8e7936..31756886fad284ef9d300ff639b0bb645e46fda0 100644
|
| --- a/media/remoting/remoting_controller.h
|
| +++ b/media/remoting/remoting_controller.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "base/callback.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "base/timer/timer.h"
|
| #include "media/base/media_observer.h"
|
| #include "media/mojo/interfaces/remoting.mojom.h"
|
| #include "mojo/public/cpp/bindings/binding.h"
|
| @@ -52,12 +53,10 @@ class RemotingController final : public MediaObserver,
|
| void OnStopped(mojom::RemotingStopReason reason) override;
|
|
|
| // MediaObserver implementations.
|
| - // This is called when the video element or its ancestor enters full screen.
|
| - // We currently use this as an indicator for immersive playback. May add other
|
| - // criteria (e.g. the actual display width/height of the video element) in
|
| - // future.
|
| void OnEnteredFullscreen() override;
|
| void OnExitedFullscreen() override;
|
| + void OnVideoViewportIntersectionChanged(
|
| + const ViewportIntersectionInfo& info) override;
|
| void OnSetCdm(CdmContext* cdm_context) override;
|
| void OnMetadataChanged(const PipelineMetadata& metadata) override;
|
|
|
| @@ -90,6 +89,10 @@ class RemotingController final : public MediaObserver,
|
| // Callback from RpcBroker when sending message to remote sink.
|
| void OnSendMessageToSink(std::unique_ptr<std::vector<uint8_t>> message);
|
|
|
| + // Callback from |viewport_fill_debouncer_timer_| when video keeps covering
|
| + // most of the viewport for a certain time.
|
| + void OnViewportMostlyFilledAndUnchanging();
|
| +
|
| // Handle incomging and outgoing RPC message.
|
| std::unique_ptr<remoting::RpcBroker> rpc_broker_;
|
|
|
| @@ -111,6 +114,12 @@ class RemotingController final : public MediaObserver,
|
| bool has_audio_ = false;
|
| bool has_video_ = false;
|
|
|
| + // Indicates whether video covers most of the viewport.
|
| + bool is_mostly_filling_viewport_ = false;
|
| + // Video/Viewport ratio meeting/exceeding the threshold should hold steady for
|
| + // a certain time before attempting to start remoting.
|
| + base::OneShotTimer viewport_fill_debouncer_timer_;
|
| +
|
| // The callback to switch the media renderer.
|
| SwitchRendererCallback switch_renderer_cb_;
|
|
|
|
|