return this;
}
-int32_t VideoDecoderResource::Initialize(
+int32_t VideoDecoderResource::Initialize0_1(
PP_Resource graphics_context,
PP_VideoProfile profile,
PP_Bool allow_software_fallback,
scoped_refptr<TrackedCallback> callback) {
+ return Initialize(graphics_context,
+ profile,
+ allow_software_fallback
+ ? PP_HARDWAREACCELERATION_WITHFALLBACK
+ : PP_HARDWAREACCELERATION_ONLY,
+ callback);
+}
+
+int32_t VideoDecoderResource::Initialize(
+ PP_Resource graphics_context,
+ PP_VideoProfile profile,
+ PP_HardwareAcceleration acceleration,
+ scoped_refptr<TrackedCallback> callback) {
if (initialized_)
return PP_ERROR_FAILED;
if (profile < 0 || profile > PP_VIDEOPROFILE_MAX)
return PP_ERROR_BADARGUMENT;
- if (initialize_callback_)
+ if (initialize_callback_.get())
return PP_ERROR_INPROGRESS;
if (!graphics_context)
return PP_ERROR_BADRESOURCE;
Call<PpapiPluginMsg_VideoDecoder_InitializeReply>(
RENDERER,
PpapiHostMsg_VideoDecoder_Initialize(
- host_resource, profile, PP_ToBool(allow_software_fallback)),
+ host_resource, profile, acceleration),
base::Bind(&VideoDecoderResource::OnPluginMsgInitializeComplete, this));
return PP_OK_COMPLETIONPENDING;
scoped_refptr<TrackedCallback> callback) {
if (decoder_last_error_)
return decoder_last_error_;
- if (flush_callback_ || reset_callback_)
+ if (flush_callback_.get() || reset_callback_.get())
return PP_ERROR_FAILED;
- if (decode_callback_)
+ if (decode_callback_.get())
return PP_ERROR_INPROGRESS;
if (size > kMaximumBitstreamBufferSize)
return PP_ERROR_NOMEMORY;
scoped_refptr<TrackedCallback> callback) {
if (decoder_last_error_)
return decoder_last_error_;
- if (reset_callback_)
+ if (reset_callback_.get())
return PP_ERROR_FAILED;
- if (get_picture_callback_)
+ if (get_picture_callback_.get())
return PP_ERROR_INPROGRESS;
// If the next picture is ready, return it synchronously.
int32_t VideoDecoderResource::Flush(scoped_refptr<TrackedCallback> callback) {
if (decoder_last_error_)
return decoder_last_error_;
- if (reset_callback_)
+ if (reset_callback_.get())
return PP_ERROR_FAILED;
- if (flush_callback_)
+ if (flush_callback_.get())
return PP_ERROR_INPROGRESS;
flush_callback_ = callback;
int32_t VideoDecoderResource::Reset(scoped_refptr<TrackedCallback> callback) {
if (decoder_last_error_)
return decoder_last_error_;
- if (flush_callback_)
+ if (flush_callback_.get())
return PP_ERROR_FAILED;
- if (reset_callback_)
+ if (reset_callback_.get())
return PP_ERROR_INPROGRESS;
reset_callback_ = callback;
// Make the shm buffer available.
available_shm_buffers_.push_back(shm_buffers_[shm_id]);
// If the plugin is waiting, let it call Decode again.
- if (decode_callback_) {
+ if (decode_callback_.get()) {
scoped_refptr<TrackedCallback> callback;
callback.swap(decode_callback_);
callback->Run(PP_OK);
// All shm buffers should have been made available by now.
DCHECK_EQ(shm_buffers_.size(), available_shm_buffers_.size());
- if (get_picture_callback_) {
+ if (get_picture_callback_.get()) {
scoped_refptr<TrackedCallback> callback;
callback.swap(get_picture_callback_);
callback->Abort();