OLD | NEW |
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" |
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 // Draw remoting interstitial on |background_image| and show it. |
19 public: | 16 // |background_image| is already scaled to fit in |canvas_size|. No further |
20 RemotingInterstitialUI(VideoRendererSink* video_renderer_sink, | 17 // scaling will be done. When has different size with |canvas_size|, |
21 const PipelineMetadata& pipeline_metadata); | 18 // |background_image| will be centered in the canvas. When |background_image| is |
22 ~RemotingInterstitialUI(); | 19 // empty, interstitial will be drawn on a blank and black background. |
23 | 20 void ShowInterstitialOnSink(VideoRendererSink* video_renderer_sink, |
24 void ShowInterstitial(bool is_remoting_successful); | 21 const SkBitmap& background_image, |
25 | 22 const gfx::Size& canvas_size, |
26 private: | 23 bool is_remoting_successful); |
27 // Gets an 'interstitial' VideoFrame to paint on the media player when the | |
28 // video is being played remotely. | |
29 scoped_refptr<VideoFrame> GetInterstitial(const SkBitmap& background_image, | |
30 bool is_remoting_successful); | |
31 | |
32 VideoRendererSink* const video_renderer_sink_; // Outlives this class. | |
33 PipelineMetadata pipeline_metadata_; | |
34 | |
35 DISALLOW_COPY_AND_ASSIGN(RemotingInterstitialUI); | |
36 }; | |
37 | 24 |
38 } // namespace media | 25 } // namespace media |
39 | 26 |
40 #endif // MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_ | 27 #endif // MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_ |
OLD | NEW |