From c8423065a0054dc81e72801dfd60b99483f70b79 Mon Sep 17 00:00:00 2001 From: "fischman@chromium.org" Date: Fri, 29 Jul 2011 19:25:38 +0000 Subject: PPB_VideoDecoder_Dev::Initialize is now synchronous! Apparently flash can't deal with async init, so we make it synchronous. We keep processing in the GPU process asynchronous and just take the blocking hit on the renderer. BUG=none TEST=gles2, ovdatest, trybots Review URL: http://codereview.chromium.org/7474006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94730 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/plugins/ppapi/ppb_video_decoder_impl.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'webkit/plugins/ppapi/ppb_video_decoder_impl.h') diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.h b/webkit/plugins/ppapi/ppb_video_decoder_impl.h index b6193e7..2347c4b 100644 --- a/webkit/plugins/ppapi/ppb_video_decoder_impl.h +++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.h @@ -38,16 +38,17 @@ class PPB_VideoDecoder_Impl : public Resource, public ::ppapi::thunk::PPB_VideoDecoder_API, public media::VideoDecodeAccelerator::Client { public: - explicit PPB_VideoDecoder_Impl(PluginInstance* instance); virtual ~PPB_VideoDecoder_Impl(); + // See PPB_VideoDecoder_Dev::Create. Returns 0 on failure to create & + // initialize. + static PP_Resource Create(PluginInstance* instance, + PP_Resource context3d_id, + const PP_VideoConfigElement* config); // ResourceObjectBase overrides. virtual PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() OVERRIDE; // PPB_VideoDecoder_API implementation. - virtual int32_t Initialize(PP_Resource context_id, - const PP_VideoConfigElement* dec_config, - PP_CompletionCallback callback) OVERRIDE; virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, PP_CompletionCallback callback) OVERRIDE; virtual void AssignPictureBuffers( @@ -75,6 +76,11 @@ class PPB_VideoDecoder_Impl : public Resource, // done. typedef std::map CallbackById; + explicit PPB_VideoDecoder_Impl(PluginInstance* instance); + + // Initialize the underlying decoder and return success status. + bool Init(PP_Resource context_id, const PP_VideoConfigElement* dec_config); + // Tell command buffer to process all commands it has received so far. void FlushCommandBuffer(); @@ -89,7 +95,6 @@ class PPB_VideoDecoder_Impl : public Resource, // for reference counting to keep it alive for the lifetime of |*this|. PP_Resource context3d_id_; - PP_CompletionCallback initialization_callback_; PP_CompletionCallback flush_callback_; PP_CompletionCallback reset_callback_; CallbackById bitstream_buffer_callbacks_; -- cgit v1.1