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

Side by Side Diff: media/remoting/remoting_interstitial_ui.h

Issue 2566223005: Media Remoting: Update remoting interstitial when status changes. (Closed)
Patch Set: Show unprocessed background image when exiting remoting. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_ 5 #ifndef MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_
6 #define MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_ 6 #define MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_
7 7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "media/base/pipeline_metadata.h"
11 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
9 #include "ui/gfx/geometry/size.h"
miu 2016/12/20 00:16:17 nit: Since gfx::Size only appears as a const-ref i
xjz 2016/12/20 19:32:29 Done.
12 10
13 namespace media { 11 namespace media {
14 12
15 class VideoFrame;
16 class VideoRendererSink; 13 class VideoRendererSink;
17 14
18 class RemotingInterstitialUI { 15 enum RemotingInterstitialType {
miu 2016/12/20 00:16:17 naming: Let's name these so that they describe whi
xjz 2016/12/20 19:32:28 Done. As chatted face to face, the 3rd one is set
19 public: 16 NONE, // No interstitial is drawn. Show background image only.
20 RemotingInterstitialUI(VideoRendererSink* video_renderer_sink, 17 SUCCESS,
21 const PipelineMetadata& pipeline_metadata); 18 FAIL,
22 ~RemotingInterstitialUI(); 19 };
23 20
24 void ShowInterstitial(bool is_remoting_successful); 21 // Draw remoting interstitial on |background_image| and show it.
25 22 // |background_image| will be scaled to fit in |canvas_size|, but keep its
26 private: 23 // aspect ratio. When has different aspect ratio with |canvas_size|, scaled
27 // Gets an 'interstitial' VideoFrame to paint on the media player when the 24 // |background_image| will be centered in the canvas. When |background_image|
28 // video is being played remotely. 25 // is empty, interstitial will be drawn on a blank and black background. When
29 scoped_refptr<VideoFrame> GetInterstitial(const SkBitmap& background_image, 26 // |interstial_type| is NONE, show background image only.
30 bool is_remoting_successful); 27 void ShowRemotingInterstitial(VideoRendererSink* video_renderer_sink,
miu 2016/12/20 00:16:17 style nit: Please place the video_renderer_sink "o
xjz 2016/12/20 19:32:28 Done.
31 28 const SkBitmap& background_image,
32 VideoRendererSink* const video_renderer_sink_; // Outlives this class. 29 const gfx::Size& canvas_size,
33 PipelineMetadata pipeline_metadata_; 30 RemotingInterstitialType interstitial_type);
34
35 DISALLOW_COPY_AND_ASSIGN(RemotingInterstitialUI);
36 };
37 31
38 } // namespace media 32 } // namespace media
39 33
40 #endif // MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_ 34 #endif // MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698