Chromium Code Reviews| 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..4d3cea8eb27e1bb773a408f775c7726a7d5d4def 100644 |
| --- a/media/remoting/remoting_renderer_controller.h |
| +++ b/media/remoting/remoting_renderer_controller.h |
| @@ -9,6 +9,7 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "media/base/media_observer.h" |
| #include "media/remoting/remoting_source_impl.h" |
| +#include "third_party/skia/include/core/SkBitmap.h" |
| namespace media { |
| @@ -16,6 +17,8 @@ namespace remoting { |
| class RpcBroker; |
| } |
| +class VideoRendererSink; |
| + |
| // This class: |
| // 1) Implements the RemotingSourceImpl::Client; |
| // 2) Monitors player events as a MediaObserver; |
| @@ -37,9 +40,20 @@ class RemotingRendererController final : public RemotingSourceImpl::Client, |
| void OnExitedFullscreen() override; |
| void OnSetCdm(CdmContext* cdm_context) override; |
| void OnMetadataChanged(const PipelineMetadata& metadata) override; |
| + void OnSetPoster(const GURL& poster) override; |
| void SetSwitchRendererCallback(const base::Closure& cb); |
| + using DownloadPosterCallback = |
| + base::Callback<void(const GURL&, |
| + const base::Callback<void(const SkBitmap& image)>&)>; |
| + // Set the callback to download poster image. Can only be called once. |
| + void SetDownloadPosterCallback(const DownloadPosterCallback& cb); |
| + |
| + // Called by RemoteRendererImpl to show remoting interstitial. |
| + // Do nothing if |video_renderer_sink| is null. |
| + void ShowInterstitial(VideoRendererSink* video_renderer_sink); |
| + |
| base::WeakPtr<RemotingRendererController> GetWeakPtr() { |
| return weak_factory_.GetWeakPtr(); |
| } |
| @@ -64,11 +78,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 +99,10 @@ class RemotingRendererController final : public RemotingSourceImpl::Client, |
| // necessary. |
| void UpdateAndMaybeSwitch(); |
| + // Called when poster image is downloaded. |
| + void PosterImageDownloaded(VideoRendererSink* video_renderer_sink, |
| + const SkBitmap& image); |
| + |
| // Indicates whether this media element or its ancestor is in full screen. |
| bool is_fullscreen_ = false; |
| @@ -116,6 +129,13 @@ class RemotingRendererController final : public RemotingSourceImpl::Client, |
| PipelineMetadata pipeline_metadata_; |
| + GURL poster_; |
|
miu
2016/12/03 01:05:31
naming nit: poster_url_
xjz
2016/12/06 19:50:55
Done.
|
| + |
| + // The current poster image. Already scaled to fit in the canvas. |
| + SkBitmap poster_image_; |
|
miu
2016/12/03 01:05:31
Per our face-to-face discussion, you shouldn't nee
xjz
2016/12/06 19:50:55
Done.
|
| + |
| + DownloadPosterCallback download_poster_cb_; |
| + |
| base::WeakPtrFactory<RemotingRendererController> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(RemotingRendererController); |