| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ | |
| 6 #define WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ | |
| 7 | |
| 8 #include "media/base/video_frame.h" | |
| 9 #include "media/filters/video_renderer_base.h" | |
| 10 #include "ui/gfx/rect.h" | |
| 11 | |
| 12 class SkCanvas; | |
| 13 | |
| 14 namespace webkit_glue { | |
| 15 | |
| 16 class WebMediaPlayerProxy; | |
| 17 | |
| 18 // A specialized version of a VideoRenderer designed to be used inside WebKit. | |
| 19 class WebVideoRenderer : public media::VideoRendererBase { | |
| 20 public: | |
| 21 WebVideoRenderer() : media::VideoRendererBase() {} | |
| 22 virtual ~WebVideoRenderer() {} | |
| 23 | |
| 24 // Saves the reference to WebMediaPlayerProxy. | |
| 25 virtual void SetWebMediaPlayerProxy(WebMediaPlayerProxy* proxy) = 0; | |
| 26 | |
| 27 // This method is called with the same rect as the Paint() method and could | |
| 28 // be used by future implementations to implement an improved color space + | |
| 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. | |
| 31 // | |
| 32 // Method called on the render thread. | |
| 33 virtual void SetRect(const gfx::Rect& rect) = 0; | |
| 34 | |
| 35 // Paint the current front frame on the |canvas| stretching it to fit the | |
| 36 // |dest_rect|. | |
| 37 // | |
| 38 // Method called on the render thread. | |
| 39 virtual void Paint(SkCanvas* canvas, const gfx::Rect& dest_rect) = 0; | |
| 40 | |
| 41 private: | |
| 42 DISALLOW_COPY_AND_ASSIGN(WebVideoRenderer); | |
| 43 }; | |
| 44 | |
| 45 } // namespace webkit_glue | |
| 46 | |
| 47 #endif // WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ | |
| OLD | NEW |