diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 19:39:45 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 19:39:45 +0000 |
commit | 08bab53f31485b4644a6a318fa5eb606c667ec1b (patch) | |
tree | d2e863aaa1a3e133885ae0c5d303a6ec92708c9a /ppapi/examples | |
parent | 5b31fe43ab3afe06483b34286f856c9ca07639fb (diff) | |
download | chromium_src-08bab53f31485b4644a6a318fa5eb606c667ec1b.zip chromium_src-08bab53f31485b4644a6a318fa5eb606c667ec1b.tar.gz chromium_src-08bab53f31485b4644a6a318fa5eb606c667ec1b.tar.bz2 |
Plumb texture target to VideoDecodeAccelerator::Client
Currently all VideoDecodeAccelerator::Clients use GL_TEXTURE_2D as their texture target.
Unfortunately the Mac decoder only supports GL_TEXTURE_RECTANGLE_ARB texture targets.
This CL allows decoders to choose which texture target they want.
BUG=127414
TEST=
Review URL: https://chromiumcodereview.appspot.com/10392141
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/examples')
-rw-r--r-- | ppapi/examples/video_decode/video_decode.cc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/ppapi/examples/video_decode/video_decode.cc b/ppapi/examples/video_decode/video_decode.cc index dd0c08f..6e4f4e1 100644 --- a/ppapi/examples/video_decode/video_decode.cc +++ b/ppapi/examples/video_decode/video_decode.cc @@ -60,9 +60,11 @@ class VideoDecodeDemoInstance : public pp::Instance, } // pp::VideoDecoderClient_Dev implementation. - virtual void ProvidePictureBuffers(PP_Resource decoder, - uint32_t req_num_of_bufs, - const PP_Size& dimensions); + virtual void ProvidePictureBuffers( + PP_Resource decoder, + uint32_t req_num_of_bufs, + const PP_Size& dimensions, + uint32_t texture_target); virtual void DismissPictureBuffer(PP_Resource decoder, int32_t picture_buffer_id); virtual void PictureReady(PP_Resource decoder, const PP_Picture_Dev& picture); @@ -82,8 +84,10 @@ class VideoDecodeDemoInstance : public pp::Instance, void DecodeNextNALUs(); // Per-decoder implementation of part of pp::VideoDecoderClient_Dev. - void ProvidePictureBuffers(uint32_t req_num_of_bufs, - PP_Size dimensions); + void ProvidePictureBuffers( + uint32_t req_num_of_bufs, + PP_Size dimensions, + uint32_t texture_target); void DismissPictureBuffer(int32_t picture_buffer_id); const PP_PictureBuffer_Dev& GetPictureBufferById(int id); @@ -320,15 +324,21 @@ void VideoDecodeDemoInstance::DecoderClient::DecodeNextNALU() { decoder_->Decode(bitstream_buffer, cb); } -void VideoDecodeDemoInstance::ProvidePictureBuffers( - PP_Resource decoder, uint32_t req_num_of_bufs, const PP_Size& dimensions) { +void VideoDecodeDemoInstance::ProvidePictureBuffers(PP_Resource decoder, + uint32_t req_num_of_bufs, + const PP_Size& dimensions, + uint32_t texture_target) { DecoderClient* client = video_decoders_[decoder]; assert(client); - client->ProvidePictureBuffers(req_num_of_bufs, dimensions); + client->ProvidePictureBuffers(req_num_of_bufs, dimensions, texture_target); } void VideoDecodeDemoInstance::DecoderClient::ProvidePictureBuffers( - uint32_t req_num_of_bufs, PP_Size dimensions) { + uint32_t req_num_of_bufs, + PP_Size dimensions, + uint32_t texture_target) { + // TODO(sail): Add support for GL_TEXTURE_RECTANGLE_ARB. + assert(texture_target == GL_TEXTURE_2D); std::vector<PP_PictureBuffer_Dev> buffers; for (uint32_t i = 0; i < req_num_of_bufs; ++i) { PP_PictureBuffer_Dev buffer; |