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

Unified Diff: media/remoting/remoting_renderer_controller.cc

Issue 2538853002: Media Remoting: Draw remoting interstitial on poster image. (Closed)
Patch Set: Removed the change to update/show interstial from this CL. 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.cc
diff --git a/media/remoting/remoting_renderer_controller.cc b/media/remoting/remoting_renderer_controller.cc
index 5f0d37eacdbc7a5939d49d5b0941e7077d07da8f..90c39cc429081fcdd5786a002b030582c34b5d56 100644
--- a/media/remoting/remoting_renderer_controller.cc
+++ b/media/remoting/remoting_renderer_controller.cc
@@ -73,6 +73,15 @@ void RemotingRendererController::OnSetCdm(CdmContext* cdm_context) {
UpdateAndMaybeSwitch();
}
+void RemotingRendererController::OnSetPoster(const GURL& poster_url) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ if (poster_url != poster_url_) {
+ poster_url_ = poster_url;
+ UpdateAndMaybeShowInterstitial();
+ }
+}
+
void RemotingRendererController::SetSwitchRendererCallback(
const base::Closure& cb) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -243,4 +252,35 @@ void RemotingRendererController::UpdateAndMaybeSwitch() {
}
}
+void RemotingRendererController::SetDownloadPosterCallback(
+ const DownloadPosterCallback& cb) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(download_poster_cb_.is_null());
+ download_poster_cb_ = cb;
+}
+
+void RemotingRendererController::UpdateAndMaybeShowInterstitial() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ if (pipeline_metadata_.natural_size.IsEmpty())
+ return;
+
+ DCHECK(remote_rendering_started_);
+ if (poster_url_.is_empty() || download_poster_cb_.is_null()) {
+ // TODO(xjz): Draw interstitial on a black image and show it.
+ // https://codereview.chromium.org/2566223005/
+ } else {
+ download_poster_cb_.Run(
+ poster_url_,
+ base::Bind(&RemotingRendererController::PosterImageDownloaded,
+ weak_factory_.GetWeakPtr()));
+ }
+}
+
+void RemotingRendererController::PosterImageDownloaded(const SkBitmap& image) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(remote_rendering_started_);
+ // TODO(xjz): Draw interstitial on |image| and show it.
+ // https://codereview.chromium.org/2566223005/
+}
+
} // namespace media
« media/blink/webmediaplayer_impl.h ('K') | « media/remoting/remoting_renderer_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698