OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ | 5 #ifndef WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ |
6 #define WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ | 6 #define WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ |
7 | 7 |
8 #include "media/base/video_frame.h" | 8 #include "media/base/video_frame.h" |
9 #include "media/filters/video_renderer_base.h" | 9 #include "media/filters/video_renderer_base.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // scale code on a separate thread. Since we always do the stretch on the | 29 // scale code on a separate thread. Since we always do the stretch on the |
30 // same thread as the Paint method, we just ignore the call for now. | 30 // same thread as the Paint method, we just ignore the call for now. |
31 // | 31 // |
32 // Method called on the render thread. | 32 // Method called on the render thread. |
33 virtual void SetRect(const gfx::Rect& rect) = 0; | 33 virtual void SetRect(const gfx::Rect& rect) = 0; |
34 | 34 |
35 // Paint the current front frame on the |canvas| stretching it to fit the | 35 // Paint the current front frame on the |canvas| stretching it to fit the |
36 // |dest_rect|. | 36 // |dest_rect|. |
37 // | 37 // |
38 // Method called on the render thread. | 38 // Method called on the render thread. |
39 virtual void Paint(SkCanvas* canvas, | 39 virtual void Paint(SkCanvas* canvas, const gfx::Rect& dest_rect) = 0; |
40 const gfx::Rect& dest_rect) = 0; | |
41 | |
42 // Clients of this class (painter/compositor) should use GetCurrentFrame() | |
43 // obtain ownership of VideoFrame, it should always relinquish the ownership | |
44 // by use PutCurrentFrame(). Current frame is not guaranteed to be non-NULL. | |
45 // It expects clients to use color-fill the background if current frame | |
46 // is NULL. This could happen when before pipeline is pre-rolled or during | |
47 // pause/flush/seek. | |
48 virtual void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out) {} | |
49 virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame) {} | |
50 | 40 |
51 private: | 41 private: |
52 DISALLOW_COPY_AND_ASSIGN(WebVideoRenderer); | 42 DISALLOW_COPY_AND_ASSIGN(WebVideoRenderer); |
53 }; | 43 }; |
54 | 44 |
55 } // namespace webkit_glue | 45 } // namespace webkit_glue |
56 | 46 |
57 #endif // WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ | 47 #endif // WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ |
OLD | NEW |