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

Unified Diff: media/remoting/remoting_renderer_controller.h

Issue 2566223005: Media Remoting: Update remoting interstitial when status changes. (Closed)
Patch Set: Addressed comments. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: media/remoting/remoting_renderer_controller.h
diff --git a/media/remoting/remoting_renderer_controller.h b/media/remoting/remoting_renderer_controller.h
index 9c98af12b555441c1ade86ff34291b321c7a8076..854c00573417ef3c81c181c27b61baf9d573be4e 100644
--- a/media/remoting/remoting_renderer_controller.h
+++ b/media/remoting/remoting_renderer_controller.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "media/base/media_observer.h"
+#include "media/remoting/remoting_interstitial_ui.h"
#include "media/remoting/remoting_source_impl.h"
namespace media {
@@ -40,6 +41,12 @@ class RemotingRendererController final : public RemotingSourceImpl::Client,
void SetSwitchRendererCallback(const base::Closure& cb);
+ using ShowInterstitialCallback = base::Callback<
+ void(const SkBitmap&, const gfx::Size&, RemotingInterstitialType type)>;
+ // Called by RemoteRendererImpl constructor to set the callback to draw and
+ // show remoting interstial.
+ void SetShowInterstitialCallback(const ShowInterstitialCallback& cb);
+
base::WeakPtr<RemotingRendererController> GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
@@ -64,11 +71,6 @@ class RemotingRendererController final : public RemotingSourceImpl::Client,
base::WeakPtr<remoting::RpcBroker> GetRpcBroker() const;
- PipelineMetadata pipeline_metadata() const {
- DCHECK(thread_checker_.CalledOnValidThread());
- return pipeline_metadata_;
- }
-
private:
bool has_audio() const {
return pipeline_metadata_.has_audio &&
@@ -90,6 +92,17 @@ class RemotingRendererController final : public RemotingSourceImpl::Client,
// necessary.
void UpdateAndMaybeSwitch();
+ // Called when any of the following happens:
+ // 1. SetShowInterstitialCallback() is called (RemoteRendererImpl is
+ // constructed);
+ // 2. The remoting session is shut down (to update the status message in the
+ // interstitial).
+ // 3. The size of the canvas is changed (to update the background image and
+ // the position of the status message).
+ // TODO(xjz): Call this when poster url is set/changed. Download poster image
+ // when available, and draw interstitial on it.
+ void UpdateInterstitial();
+
// Indicates whether this media element or its ancestor is in full screen.
bool is_fullscreen_ = false;
@@ -99,10 +112,6 @@ class RemotingRendererController final : public RemotingSourceImpl::Client,
// Indicates whether audio or video is encrypted.
bool is_encrypted_ = false;
- // Current audio/video config.
- VideoDecoderConfig video_decoder_config_;
- AudioDecoderConfig audio_decoder_config_;
-
// The callback to switch the media renderer.
base::Closure switch_renderer_cb_;
@@ -116,6 +125,11 @@ class RemotingRendererController final : public RemotingSourceImpl::Client,
PipelineMetadata pipeline_metadata_;
+ // The callback to show remoting interstitial. It is set when entering the
+ // remoting mode (RemotingRendererImpl is constructed) by calling
+ // SetShowInterstitialCallback(), and is reset when leaving the remoting mode.
+ ShowInterstitialCallback show_interstitial_cb_;
+
base::WeakPtrFactory<RemotingRendererController> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RemotingRendererController);

Powered by Google App Engine
This is Rietveld 408576698