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" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "media/base/pipeline_metadata.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
15 class VideoFrame; | 15 class VideoFrame; |
16 class VideoRendererSink; | 16 class VideoRendererSink; |
17 class RemotingRendererController; | |
17 | 18 |
18 class RemotingInterstitialUI { | 19 class RemotingInterstitialUI { |
19 public: | 20 public: |
20 RemotingInterstitialUI(VideoRendererSink* video_renderer_sink, | 21 RemotingInterstitialUI(VideoRendererSink* video_renderer_sink, |
21 const PipelineMetadata& pipeline_metadata); | 22 const base::WeakPtr<RemotingRendererController>& |
23 remoting_renderer_controller); | |
22 ~RemotingInterstitialUI(); | 24 ~RemotingInterstitialUI(); |
23 | 25 |
24 void ShowInterstitial(bool is_remoting_successful); | 26 void ShowInterstitial(bool is_remoting_successful); |
25 | 27 |
26 private: | 28 private: |
27 // Gets an 'interstitial' VideoFrame to paint on the media player when the | 29 // Gets an 'interstitial' VideoFrame to paint on the media player when the |
28 // video is being played remotely. | 30 // video is being played remotely. |
29 scoped_refptr<VideoFrame> GetInterstitial(const SkBitmap& background_image, | 31 scoped_refptr<VideoFrame> GetInterstitial(const SkBitmap& background_image, |
30 bool is_remoting_successful); | 32 bool is_remoting_successful); |
31 | 33 |
34 // Called when poster image is downloaded. | |
35 void PosterDownloaded(bool is_remoting_successful, | |
miu
2016/11/29 22:56:08
See comments in remoting_renderer_controller.h/.cc
xjz
2016/12/02 19:23:10
Done.
| |
36 const SkBitmap& poster_image); | |
37 | |
38 // Draw and display the interstitial. | |
39 void DisplayInterstitial(const SkBitmap& poster_image, | |
40 bool is_remoting_successful); | |
41 | |
32 VideoRendererSink* const video_renderer_sink_; // Outlives this class. | 42 VideoRendererSink* const video_renderer_sink_; // Outlives this class. |
33 PipelineMetadata pipeline_metadata_; | 43 const base::WeakPtr<RemotingRendererController> remoting_renderer_controller_; |
44 | |
45 base::WeakPtrFactory<RemotingInterstitialUI> weak_factory_; | |
34 | 46 |
35 DISALLOW_COPY_AND_ASSIGN(RemotingInterstitialUI); | 47 DISALLOW_COPY_AND_ASSIGN(RemotingInterstitialUI); |
36 }; | 48 }; |
37 | 49 |
38 } // namespace media | 50 } // namespace media |
39 | 51 |
40 #endif // MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_ | 52 #endif // MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_ |
OLD | NEW |