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.
5 #ifndef WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_
6 #define WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_
8 #include "media/base/video_frame.h"
9 #include "media/filters/video_renderer_base.h"
10 #include "ui/gfx/rect.h"
14 namespace webkit_glue
{
16 class WebMediaPlayerProxy
;
18 // A specialized version of a VideoRenderer designed to be used inside WebKit.
19 class WebVideoRenderer
: public media::VideoRendererBase
{
21 WebVideoRenderer() : media::VideoRendererBase() {}
22 virtual ~WebVideoRenderer() {}
24 // Saves the reference to WebMediaPlayerProxy.
25 virtual void SetWebMediaPlayerProxy(WebMediaPlayerProxy
* proxy
) = 0;
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.
32 // Method called on the render thread.
33 virtual void SetRect(const gfx::Rect
& rect
) = 0;
35 // Paint the current front frame on the |canvas| stretching it to fit the
38 // Method called on the render thread.
39 virtual void Paint(SkCanvas
* canvas
, const gfx::Rect
& dest_rect
) = 0;
42 DISALLOW_COPY_AND_ASSIGN(WebVideoRenderer
);
45 } // namespace webkit_glue
47 #endif // WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_