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

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

Issue 5878007: Fix black video frames when seeking (which also fixes flashing poster issue). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/glue/webmediaplayer_impl.h" 10 #include "webkit/glue/webmediaplayer_impl.h"
(...skipping 10 matching lines...) Expand all
21 virtual void SetWebMediaPlayerImplProxy(WebMediaPlayerImpl::Proxy* proxy) = 0; 21 virtual void SetWebMediaPlayerImplProxy(WebMediaPlayerImpl::Proxy* proxy) = 0;
22 22
23 // This method is called with the same rect as the Paint() method and could 23 // This method is called with the same rect as the Paint() method and could
24 // be used by future implementations to implement an improved color space + 24 // be used by future implementations to implement an improved color space +
25 // scale code on a separate thread. Since we always do the stretch on the 25 // scale code on a separate thread. Since we always do the stretch on the
26 // same thread as the Paint method, we just ignore the call for now. 26 // same thread as the Paint method, we just ignore the call for now.
27 // 27 //
28 // Method called on the render thread. 28 // Method called on the render thread.
29 virtual void SetRect(const gfx::Rect& rect) = 0; 29 virtual void SetRect(const gfx::Rect& rect) = 0;
30 30
31 // Paint the current front frame on the |bitmap|.
32 // Returns true if there was anything to render.
33 //
34 // Method called on the render thread.
35 virtual bool GetCurrentBitmap(SkBitmap* bitmap) = 0;
36
37 // Scales the given bitmap to the given canvas.
38 virtual void CopyBitmapToCanvas(const SkBitmap& bitmap,
39 skia::PlatformCanvas* canvas,
40 const gfx::Rect& dest_rect) = 0;
41
31 // Paint the current front frame on the |canvas| stretching it to fit the 42 // Paint the current front frame on the |canvas| stretching it to fit the
32 // |dest_rect|. 43 // |dest_rect|.
33 // 44 //
34 // Method called on the render thread. 45 // Method called on the render thread.
35 virtual void Paint(skia::PlatformCanvas* canvas, 46 virtual void Paint(skia::PlatformCanvas* canvas,
36 const gfx::Rect& dest_rect) = 0; 47 const gfx::Rect& dest_rect) = 0;
37 48
38 // Clients of this class (painter/compositor) should use GetCurrentFrame() 49 // Clients of this class (painter/compositor) should use GetCurrentFrame()
39 // obtain ownership of VideoFrame, it should always relinquish the ownership 50 // obtain ownership of VideoFrame, it should always relinquish the ownership
40 // by use PutCurrentFrame(). Current frame is not guaranteed to be non-NULL. 51 // by use PutCurrentFrame(). Current frame is not guaranteed to be non-NULL.
41 // It expects clients to use color-fill the background if current frame 52 // It expects clients to use color-fill the background if current frame
42 // is NULL. This could happen when before pipeline is pre-rolled or during 53 // is NULL. This could happen when before pipeline is pre-rolled or during
43 // pause/flush/seek. 54 // pause/flush/seek.
44 virtual void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out) {} 55 virtual void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out) {}
45 virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame) {} 56 virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame) {}
46 57
47 private: 58 private:
48 DISALLOW_COPY_AND_ASSIGN(WebVideoRenderer); 59 DISALLOW_COPY_AND_ASSIGN(WebVideoRenderer);
49 }; 60 };
50 61
51 } // namespace webkit_glue 62 } // namespace webkit_glue
52 63
53 #endif // WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_ 64 #endif // WEBKIT_GLUE_MEDIA_WEB_VIDEO_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698