diff options
author | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-19 16:29:07 +0000 |
---|---|---|
committer | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-19 16:29:07 +0000 |
commit | 6ceb1207c32f4ecdd9d693e77c4e9ec5eda5efa2 (patch) | |
tree | 32cf752999123875fac24b27da13d2d78cd4eddc /ppapi/examples | |
parent | 5818639c6c590be2290e72706064a6ab4b3b6aad (diff) | |
download | chromium_src-6ceb1207c32f4ecdd9d693e77c4e9ec5eda5efa2.zip chromium_src-6ceb1207c32f4ecdd9d693e77c4e9ec5eda5efa2.tar.gz chromium_src-6ceb1207c32f4ecdd9d693e77c4e9ec5eda5efa2.tar.bz2 |
Remove redundant size and type information from VideoDecode PPAPI
The visible size of the video frame is determined at Create stage.
The type of buffer (from system memory or texture-backed via GLES)
is decided by the plugin when it calls AssignGLESBuffers or
AssignSysmemBuffers in response to ProvidePictureBuffers.
The decoded size will be the same as the size requested in
ProvidePictureBuffers.
Thus these values specified anywhere else is redundant, and introduces
a place to have inconsistency.
BUG=NONE
TEST=ovda unittest passes; gles2 runs w/o crashing
Review URL: http://codereview.chromium.org/7021020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/examples')
-rw-r--r-- | ppapi/examples/gles2/gles2.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/ppapi/examples/gles2/gles2.cc b/ppapi/examples/gles2/gles2.cc index a7e076e..6a0f925 100644 --- a/ppapi/examples/gles2/gles2.cc +++ b/ppapi/examples/gles2/gles2.cc @@ -58,8 +58,7 @@ class GLES2DemoInstance : public pp::Instance, public pp::Graphics3DClient_Dev, // pp::VideoDecoderClient_Dev implementation. virtual void ProvidePictureBuffers( - uint32_t req_num_of_bufs, PP_Size dimensions, - PP_PictureBufferType_Dev type); + uint32_t req_num_of_bufs, PP_Size dimensions); virtual void DismissPictureBuffer(int32_t picture_buffer_id); virtual void PictureReady(const PP_Picture_Dev& picture); virtual void EndOfStream(); @@ -80,7 +79,7 @@ class GLES2DemoInstance : public pp::Instance, public pp::Graphics3DClient_Dev, void DecodeNextNALUs(); void DecodeNextNALU(); void GetNextNALUBoundary(size_t start_pos, size_t* end_pos); - void Render(const PP_GLESBuffer_Dev& buffer); + void Render(const PP_PictureBuffer_Dev& buffer); // GL-related functions. void InitGL(); @@ -103,7 +102,7 @@ class GLES2DemoInstance : public pp::Instance, public pp::Graphics3DClient_Dev, int num_frames_rendered_; // Map of texture buffers indexed by buffer id. - typedef std::map<int, PP_GLESBuffer_Dev> PictureBufferMap; + typedef std::map<int, PP_PictureBuffer_Dev> PictureBufferMap; PictureBufferMap buffers_by_id_; // Map of bitstream buffers indexed by id. typedef std::map<int, pp::Buffer_Dev*> BitstreamBufferMap; @@ -251,18 +250,17 @@ void GLES2DemoInstance::DecodeNextNALU() { } void GLES2DemoInstance::ProvidePictureBuffers( - uint32_t req_num_of_bufs, PP_Size dimensions, - PP_PictureBufferType_Dev type) { - std::vector<PP_GLESBuffer_Dev> buffers; + uint32_t req_num_of_bufs, PP_Size dimensions) { + std::vector<PP_PictureBuffer_Dev> buffers; for (uint32_t i = 0; i < req_num_of_bufs; i++) { - PP_GLESBuffer_Dev buffer; + PP_PictureBuffer_Dev buffer; buffer.texture_id = CreateTexture(dimensions.width, dimensions.height); int id = ++next_picture_buffer_id_; - buffer.info.id= id; + buffer.id = id; buffers.push_back(buffer); assert(buffers_by_id_.insert(std::make_pair(id, buffer)).second); } - video_decoder_->AssignGLESBuffers(buffers); + video_decoder_->AssignPictureBuffers(buffers); } void GLES2DemoInstance::DismissPictureBuffer(int32_t picture_buffer_id) { @@ -332,7 +330,7 @@ void GLES2DemoInstance::InitGL() { CreateGLObjects(); } -void GLES2DemoInstance::Render(const PP_GLESBuffer_Dev& buffer) { +void GLES2DemoInstance::Render(const PP_PictureBuffer_Dev& buffer) { assert(!is_painting_); is_painting_ = true; gles2_if_->ActiveTexture(context_->pp_resource(), GL_TEXTURE0); @@ -341,7 +339,7 @@ void GLES2DemoInstance::Render(const PP_GLESBuffer_Dev& buffer) { gles2_if_->DrawArrays(context_->pp_resource(), GL_TRIANGLE_STRIP, 0, 4); pp::CompletionCallback cb = callback_factory_.NewCallback( - &GLES2DemoInstance::PaintFinished, buffer.info.id); + &GLES2DemoInstance::PaintFinished, buffer.id); last_swap_request_ticks_ = core_if_->GetTimeTicks(); assert(surface_->SwapBuffers(cb) == PP_OK_COMPLETIONPENDING); } |