Index: media/remoting/remote_renderer_impl.h |
diff --git a/media/remoting/remote_renderer_impl.h b/media/remoting/remote_renderer_impl.h |
index a396562e92e53984d5a9c98094d9cf379183daef..c8eb9c82697310fa1ed4770b38b05ef10129df38 100644 |
--- a/media/remoting/remote_renderer_impl.h |
+++ b/media/remoting/remote_renderer_impl.h |
@@ -67,6 +67,15 @@ class RemoteRendererImpl : public Renderer { |
base::WeakPtr<RemoteRendererImpl> self, |
std::unique_ptr<remoting::pb::RpcMessage> message); |
+ // Callback when remoting interstitial needs to be updated. Will post task to |
+ // media thread to avoid threading race condition. |
+ static void RequestUpdateInterstitialOnMainThread( |
+ scoped_refptr<base::SingleThreadTaskRunner> media_task_runner, |
+ base::WeakPtr<RemoteRendererImpl> remote_renderer_impl, |
+ const SkBitmap& background_image, |
+ const gfx::Size& canvas_size, |
+ RemotingInterstitialType interstitial_type); |
+ |
public: |
// media::Renderer implementation. |
void Initialize(DemuxerStreamProvider* demuxer_stream_provider, |
@@ -121,12 +130,16 @@ class RemoteRendererImpl : public Renderer { |
void OnStatisticsUpdate(std::unique_ptr<remoting::pb::RpcMessage> message); |
void OnDurationChange(std::unique_ptr<remoting::pb::RpcMessage> message); |
+ // Called to update the remoting interstitial. Draw remoting interstitial on |
+ // |interstitial_background_| if |background_image| is empty. Update |
+ // |interstitial_background_| if |background_image| is not empty. |
+ void UpdateInterstitial(const SkBitmap& background_image, |
+ const gfx::Size& canvas_size, |
+ RemotingInterstitialType interstitial_type); |
+ |
// Shut down remoting session. |
void OnFatalError(PipelineStatus status); |
- // Show interstial accordingly. |
- void UpdateInterstitial(); |
- |
State state_; |
const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
const scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; |
@@ -160,7 +173,12 @@ class RemoteRendererImpl : public Renderer { |
CdmAttachedCB cdm_attached_cb_; |
base::Closure flush_cb_; |
- RemotingInterstitialUI interstitial_ui_; |
+ VideoRendererSink* const video_renderer_sink_; // Outlives this class. |
+ // The background image for remoting interstitial. When |this| is destructed, |
+ // |interstitial_background_| will be paint to clear the cast messages on |
+ // the interstitial. |
+ SkBitmap interstitial_background_; |
+ gfx::Size canvas_size_; |
base::WeakPtrFactory<RemoteRendererImpl> weak_factory_; |