diff options
author | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-14 21:00:25 +0000 |
---|---|---|
committer | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-14 21:00:25 +0000 |
commit | d3d048776df1ba9ad87a884a2cd5a0a944b52cda (patch) | |
tree | a95dbf055838997db5b5b88d0a04a51f1fcc4beb /chrome | |
parent | e7d9e170144853b9ef889ab5e5fcf44b4c9ef39d (diff) | |
download | chromium_src-d3d048776df1ba9ad87a884a2cd5a0a944b52cda.zip chromium_src-d3d048776df1ba9ad87a884a2cd5a0a944b52cda.tar.gz chromium_src-d3d048776df1ba9ad87a884a2cd5a0a944b52cda.tar.bz2 |
media: refactoring video_render_base to recycle buffers
To make recycle work, we had to define the usage scope of current frame. otherwise we are introducing tearing because we will begin to decode into the buffer before it is done by the renderer/painter/compositor.
current mechanism depends on hold reference of a copied picture. we had no that luxury if we do not copy output buffers. we had to compromise by
1. in pause() ( which is not the sense of pipeline->pause(), which is implemented by set playrate = 0 ) in filter->pause() ( or in the future flush() ), which is part of seeking ( and in the future, part of stop() too) , we had to return all the buffers to owner. we had no current buffer to display. we use NULL as current frame in this case.
2. remove black frame from render base, this is only valid for system memory based video frame, even that should we use color fill instead of color conversion and scale.
3. pause and stop has to wait for pending read (actually flush) and pending paint.
4. we only advance frame when there are two or more frames in ready queue.
Review URL: http://codereview.chromium.org/2836038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52398 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/media/ipc_video_renderer.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/renderer/media/ipc_video_renderer.cc b/chrome/renderer/media/ipc_video_renderer.cc index aa234ff..d9a194d 100644 --- a/chrome/renderer/media/ipc_video_renderer.cc +++ b/chrome/renderer/media/ipc_video_renderer.cc @@ -113,6 +113,7 @@ void IPCVideoRenderer::DoUpdateVideo() { scoped_refptr<media::VideoFrame> frame; GetCurrentFrame(&frame); if (!frame) { + PutCurrentFrame(frame); return; } @@ -150,6 +151,8 @@ void IPCVideoRenderer::DoUpdateVideo() { src += stride; } + PutCurrentFrame(frame); + // Sanity check! uint8* expected = reinterpret_cast<uint8*>(transport_dib_->memory()) + transport_dib_->size(); |