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

Side by Side Diff: webkit/glue/webmediaplayer_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 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player.
6 // It contains PipelineImpl which is the actual media player pipeline, it glues 6 // It contains PipelineImpl which is the actual media player pipeline, it glues
7 // the media player pipeline, data source, audio renderer and renderer. 7 // the media player pipeline, data source, audio renderer and renderer.
8 // PipelineImpl would creates multiple threads and access some public methods 8 // PipelineImpl would creates multiple threads and access some public methods
9 // of this class, so we need to be extra careful about concurrent access of 9 // of this class, so we need to be extra careful about concurrent access of
10 // methods and members. 10 // methods and members.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 // Methods for Filter -> WebMediaPlayerImpl communication. 98 // Methods for Filter -> WebMediaPlayerImpl communication.
99 void Repaint(); 99 void Repaint();
100 void SetVideoRenderer(scoped_refptr<WebVideoRenderer> video_renderer); 100 void SetVideoRenderer(scoped_refptr<WebVideoRenderer> video_renderer);
101 void SetDataSource(scoped_refptr<WebDataSource> data_source); 101 void SetDataSource(scoped_refptr<WebDataSource> data_source);
102 102
103 // Methods for WebMediaPlayerImpl -> Filter communication. 103 // Methods for WebMediaPlayerImpl -> Filter communication.
104 void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); 104 void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect);
105 void SetSize(const gfx::Rect& rect); 105 void SetSize(const gfx::Rect& rect);
106 void Detach(); 106 void Detach();
107 void CopyBitmapToCanvas(const SkBitmap& bitmap,
108 skia::PlatformCanvas* canvas,
109 const gfx::Rect& dest_rect);
110 void GetCurrentBitmap(SkBitmap* bitmap);
107 void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); 111 void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out);
108 void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame); 112 void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame);
109 bool HasSingleOrigin(); 113 bool HasSingleOrigin();
110 void AbortDataSource(); 114 void AbortDataSource();
111 115
112 // Methods for PipelineImpl -> WebMediaPlayerImpl communication. 116 // Methods for PipelineImpl -> WebMediaPlayerImpl communication.
113 void PipelineInitializationCallback(); 117 void PipelineInitializationCallback();
114 void PipelineSeekCallback(); 118 void PipelineSeekCallback();
115 void PipelineEndedCallback(); 119 void PipelineEndedCallback();
116 void PipelineErrorCallback(); 120 void PipelineErrorCallback();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // single "playback rate" over worrying about paused/stopped etc... It forces 300 // single "playback rate" over worrying about paused/stopped etc... It forces
297 // all clients to manage the pause+playback rate externally, but is that 301 // all clients to manage the pause+playback rate externally, but is that
298 // really a bad thing? 302 // really a bad thing?
299 // 303 //
300 // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want 304 // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want
301 // to hang the render thread during pause(), we record the time at the same 305 // to hang the render thread during pause(), we record the time at the same
302 // time we pause and then return that value in currentTime(). Otherwise our 306 // time we pause and then return that value in currentTime(). Otherwise our
303 // clock can creep forward a little bit while the asynchronous 307 // clock can creep forward a little bit while the asynchronous
304 // SetPlaybackRate(0) is being executed. 308 // SetPlaybackRate(0) is being executed.
305 bool paused_; 309 bool paused_;
310 bool seeking_;
306 float playback_rate_; 311 float playback_rate_;
307 base::TimeDelta paused_time_; 312 base::TimeDelta paused_time_;
308 313
309 WebKit::WebMediaPlayerClient* client_; 314 WebKit::WebMediaPlayerClient* client_;
310 315
311 scoped_refptr<Proxy> proxy_; 316 scoped_refptr<Proxy> proxy_;
312 317
313 // Used to block Destroy() until Pipeline::Stop() is completed. 318 // Used to block Destroy() until Pipeline::Stop() is completed.
314 base::WaitableEvent pipeline_stopped_; 319 base::WaitableEvent pipeline_stopped_;
315 320
316 #if WEBKIT_USING_CG 321 #if WEBKIT_USING_CG
317 scoped_ptr<skia::PlatformCanvas> skia_canvas_; 322 scoped_ptr<skia::PlatformCanvas> skia_canvas_;
318 #endif 323 #endif
319 324
325 // Used to display the last available frame when seeking.
326 SkBitmap cached_bitmap_;
327
320 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 328 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
321 }; 329 };
322 330
323 } // namespace webkit_glue 331 } // namespace webkit_glue
324 332
325 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ 333 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698