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

Side by Side Diff: webkit/glue/media/video_renderer_impl.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 // The video renderer implementation to be use by the media pipeline. It lives 5 // The video renderer implementation to be use by the media pipeline. It lives
6 // inside video renderer thread and also WebKit's main thread. We need to be 6 // inside video renderer thread and also WebKit's main thread. We need to be
7 // extra careful about members shared by two different threads, especially 7 // extra careful about members shared by two different threads, especially
8 // video frame buffers. 8 // video frame buffers.
9 9
10 #ifndef WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_ 10 #ifndef WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_
(...skipping 13 matching lines...) Expand all
24 24
25 class VideoRendererImpl : public WebVideoRenderer { 25 class VideoRendererImpl : public WebVideoRenderer {
26 public: 26 public:
27 explicit VideoRendererImpl(bool pts_logging); 27 explicit VideoRendererImpl(bool pts_logging);
28 virtual ~VideoRendererImpl(); 28 virtual ~VideoRendererImpl();
29 29
30 // WebVideoRenderer implementation. 30 // WebVideoRenderer implementation.
31 virtual void SetWebMediaPlayerImplProxy(WebMediaPlayerImpl::Proxy* proxy); 31 virtual void SetWebMediaPlayerImplProxy(WebMediaPlayerImpl::Proxy* proxy);
32 virtual void SetRect(const gfx::Rect& rect); 32 virtual void SetRect(const gfx::Rect& rect);
33 virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); 33 virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect);
34 virtual bool GetCurrentBitmap(SkBitmap* bitmap);
35 virtual void CopyBitmapToCanvas(const SkBitmap& bitmap,
36 skia::PlatformCanvas* canvas,
37 const gfx::Rect& dest_rect);
34 virtual void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); 38 virtual void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out);
35 virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame); 39 virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame);
36 40
37 protected: 41 protected:
38 // Method called by VideoRendererBase during initialization. 42 // Method called by VideoRendererBase during initialization.
39 virtual bool OnInitialize(media::VideoDecoder* decoder); 43 virtual bool OnInitialize(media::VideoDecoder* decoder);
40 44
41 // Method called by the VideoRendererBase when stopping. 45 // Method called by the VideoRendererBase when stopping.
42 virtual void OnStop(media::FilterCallback* callback); 46 virtual void OnStop(media::FilterCallback* callback);
43 47
44 // Method called by the VideoRendererBase when a frame is available. 48 // Method called by the VideoRendererBase when a frame is available.
45 virtual void OnFrameAvailable(); 49 virtual void OnFrameAvailable();
46 50
47 private: 51 private:
48 // Determine the conditions to perform fast paint. Returns true if we can do 52 // Determine the conditions to perform fast paint. Returns true if we can do
49 // fast paint otherwise false. 53 // fast paint otherwise false.
50 bool CanFastPaint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); 54 bool CanFastPaint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect);
51 55
52 // Slow paint does a YUV => RGB, and scaled blit in two separate operations. 56 // Slow paint does a YUV => RGB conversion.
53 void SlowPaint(media::VideoFrame* video_frame, 57 void SlowPaintToBitmap(media::VideoFrame* video_frame, SkBitmap* bitmap);
54 skia::PlatformCanvas* canvas,
55 const gfx::Rect& dest_rect);
56 58
57 // Fast paint does YUV => RGB, scaling, blitting all in one step into the 59 // Fast paint does YUV => RGB, scaling, blitting all in one step into the
58 // canvas. It's not always safe and appropriate to perform fast paint. 60 // canvas. It's not always safe and appropriate to perform fast paint.
59 // CanFastPaint() is used to determine the conditions. 61 // CanFastPaint() is used to determine the conditions.
60 void FastPaint(media::VideoFrame* video_frame, 62 void FastPaint(media::VideoFrame* video_frame,
61 skia::PlatformCanvas* canvas, 63 skia::PlatformCanvas* canvas,
62 const gfx::Rect& dest_rect); 64 const gfx::Rect& dest_rect);
63 65
64 void TransformToSkIRect(const SkMatrix& matrix, const gfx::Rect& src_rect, 66 void TransformToSkIRect(const SkMatrix& matrix, const gfx::Rect& src_rect,
65 SkIRect* dest_rect); 67 SkIRect* dest_rect);
(...skipping 19 matching lines...) Expand all
85 87
86 // Whether we're logging video presentation timestamps (PTS). 88 // Whether we're logging video presentation timestamps (PTS).
87 bool pts_logging_; 89 bool pts_logging_;
88 90
89 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); 91 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl);
90 }; 92 };
91 93
92 } // namespace webkit_glue 94 } // namespace webkit_glue
93 95
94 #endif // WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_ 96 #endif // WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/media/video_renderer_impl.cc » ('j') | webkit/glue/media/video_renderer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698