diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-29 17:47:01 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-29 17:47:01 +0000 |
commit | 890e8966414165e59418b7886778cbd16cc194ac (patch) | |
tree | 3e0de593dd21b86879bd09d228a090f8af105564 /ppapi/examples | |
parent | 32fcb896c5d34a483c3adbdec90badbddd54d7d8 (diff) | |
download | chromium_src-890e8966414165e59418b7886778cbd16cc194ac.zip chromium_src-890e8966414165e59418b7886778cbd16cc194ac.tar.gz chromium_src-890e8966414165e59418b7886778cbd16cc194ac.tar.bz2 |
Implement proper synchronization between HW video decode IPC and CommandBuffer.
This is done by inserting tokens into the command-buffer stream
when synchronization is needed, and adding a
last-read/last-written token pair to each IPC message. This
allowed me to remove the bogus FinishGL() calls from the gles2
sample pepper plugin.
As part of this CL, the return value for VideoDecodeAccelerator::{Decode,Flush,Abort} changed from bool to void. These are all async methods so errors ought to be signaled using callbacks.
BUG=none
TEST=gles2 works, no crashes; trybots
Review URL: http://codereview.chromium.org/7260008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/examples')
-rw-r--r-- | ppapi/examples/gles2/gles2.cc | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/ppapi/examples/gles2/gles2.cc b/ppapi/examples/gles2/gles2.cc index 0499958..657159b 100644 --- a/ppapi/examples/gles2/gles2.cc +++ b/ppapi/examples/gles2/gles2.cc @@ -73,14 +73,6 @@ class GLES2DemoInstance : public pp::Instance, public pp::Graphics3DClient_Dev, GLuint vertex_buffers[2]; }; - // Serialize PPB_Video_Decoder_Dev operations w.r.t. GPU command buffer. - // TODO(fischman): figure out how much of this is actually necessary. - // Probably any necessary serialization ought to be happening in the - // PPAPI implementation, not in the plugin! - void FinishGL() { - gles2_if_->Finish(context_->pp_resource()); - } - // Initialize Video Decoder. void InitializeDecoder(); @@ -272,7 +264,6 @@ void GLES2DemoInstance::ProvidePictureBuffers( buffers.push_back(buffer); assert(buffers_by_id_.insert(std::make_pair(id, buffer)).second); } - FinishGL(); video_decoder_->AssignGLESBuffers(buffers); } @@ -282,8 +273,6 @@ void GLES2DemoInstance::DismissPictureBuffer( assert(it != buffers_by_id_.end()); DeleteTexture(it->second.texture_id); buffers_by_id_.erase(it); - - FinishGL(); } void GLES2DemoInstance::PictureReady( @@ -340,18 +329,14 @@ void GLES2DemoInstance::InitGL() { assertNoGLError(); CreateGLObjects(); - - FinishGL(); } void GLES2DemoInstance::Render(const PP_GLESBuffer_Dev& buffer) { if (is_painting_) { // We are dropping frames if we don't render fast enough - // that is why sometimes the last frame rendered is < 249. - if (video_decoder_) { - FinishGL(); + if (video_decoder_) video_decoder_->ReusePictureBuffer(buffer.info.id); - } return; } is_painting_ = true; @@ -369,7 +354,6 @@ void GLES2DemoInstance::Render(const PP_GLESBuffer_Dev& buffer) { void GLES2DemoInstance::PaintFinished(int32_t result, int picture_buffer_id) { is_painting_ = false; - FinishGL(); if (video_decoder_) video_decoder_->ReusePictureBuffer(picture_buffer_id); } |