Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: webkit/glue/media/web_video_renderer.h

Issue 3058055: Implemented way to share video frames between WebKit and Chromium (Closed)
Patch Set: Adding WebKit side for easy reading (will delete in final patch) Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/glue/media/video_renderer_impl.cc ('k') | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // 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/filters/video_renderer_base.h" 9 #include "media/filters/video_renderer_base.h"
9 10
10 namespace webkit_glue { 11 namespace webkit_glue {
11 12
12 // A specialized version of a VideoRenderer designed to be used inside WebKit. 13 // A specialized version of a VideoRenderer designed to be used inside WebKit.
13 class WebVideoRenderer : public media::VideoRendererBase { 14 class WebVideoRenderer : public media::VideoRendererBase {
14 public: 15 public:
15 WebVideoRenderer() : media::VideoRendererBase() {} 16 WebVideoRenderer() : media::VideoRendererBase() {}
16 virtual ~WebVideoRenderer() {} 17 virtual ~WebVideoRenderer() {}
17 18
18 // This method is called with the same rect as the Paint() method and could 19 // This method is called with the same rect as the Paint() method and could
19 // be used by future implementations to implement an improved color space + 20 // be used by future implementations to implement an improved color space +
20 // scale code on a separate thread. Since we always do the stretch on the 21 // scale code on a separate thread. Since we always do the stretch on the
21 // same thread as the Paint method, we just ignore the call for now. 22 // same thread as the Paint method, we just ignore the call for now.
22 // 23 //
23 // Method called on the render thread. 24 // Method called on the render thread.
24 virtual void SetRect(const gfx::Rect& rect) = 0; 25 virtual void SetRect(const gfx::Rect& rect) = 0;
25 26
26 // Paint the current front frame on the |canvas| stretching it to fit the 27 // Paint the current front frame on the |canvas| stretching it to fit the
27 // |dest_rect|. 28 // |dest_rect|.
28 // 29 //
29 // Method called on the render thread. 30 // Method called on the render thread.
30 virtual void Paint(skia::PlatformCanvas* canvas, 31 virtual void Paint(skia::PlatformCanvas* canvas,
31 const gfx::Rect& dest_rect) = 0; 32 const gfx::Rect& dest_rect) = 0;
32 33
34 // Clients of this class (painter/compositor) should use GetCurrentFrame()
35 // obtain ownership of VideoFrame, it should always relinquish the ownership
36 // by use PutCurrentFrame(). Current frame is not guaranteed to be non-NULL.
37 // It expects clients to use color-fill the background if current frame
38 // is NULL. This could happen when before pipeline is pre-rolled or during
39 // pause/flush/seek.
40 virtual void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out) {}
41 virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame) {}
42
33 private: 43 private:
34 DISALLOW_COPY_AND_ASSIGN(WebVideoRenderer); 44 DISALLOW_COPY_AND_ASSIGN(WebVideoRenderer);
35 }; 45 };
36 46
37 } // namespace webkit_glue 47 } // namespace webkit_glue
38 48
39 #endif // WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ 49 #endif // WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_
OLDNEW
« no previous file with comments | « webkit/glue/media/video_renderer_impl.cc ('k') | webkit/glue/webkit_glue.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698