OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_REMOTING_INTERSTITIAL_H_ | |
6 #define MEDIA_REMOTING_INTERSTITIAL_H_ | |
7 | |
8 #include "base/memory/ref_counted.h" | |
9 | |
10 class SkBitmap; | |
11 | |
12 namespace gfx { | |
13 class Size; | |
14 } | |
15 | |
16 namespace media { | |
17 | |
18 class VideoFrame; | |
19 | |
20 namespace remoting { | |
21 | |
22 enum InterstitialType { | |
23 BETWEEN_SESSIONS, // Show background image only. | |
24 IN_SESSION, // Show MEDIA_REMOTING_CASTING_VIDEO_TEXT. | |
25 ENCRYPTED_MEDIA_FATAL_ERROR, // Show MEDIA_REMOTING_CAST_ERROR_TEXT. | |
26 }; | |
27 | |
28 // Render an interstitial frame--a combination of |image| in the background | |
29 // along with a text message describing what is going on--and return it in a | |
30 // VideoFrame. |image| may be scaled accordingly without changing its aspect | |
31 // ratio. When it has a different aspect ratio than |natural_size|, a scaled | |
32 // |background_image| will be centered in the frame. When |image| is empty, a | |
33 // blank black background will be used. | |
34 // | |
35 // Threading note: This *must* be called on the main thread, because it uses | |
36 // Skia's font rendering facility, which loads/caches fonts on the main thread. | |
37 // http://crbug.com/687473. | |
38 scoped_refptr<VideoFrame> RenderInterstitialFrame(const SkBitmap& image, | |
39 const gfx::Size& natural_size, | |
40 InterstitialType type); | |
41 | |
42 } // namespace remoting | |
43 } // namespace media | |
44 | |
45 #endif // MEDIA_REMOTING_INTERSTITIAL_H_ | |
OLD | NEW |