diff options
Diffstat (limited to 'ppapi/shared_impl')
-rw-r--r-- | ppapi/shared_impl/video_decoder_impl.cc | 18 | ||||
-rw-r--r-- | ppapi/shared_impl/video_decoder_impl.h | 6 |
2 files changed, 14 insertions, 10 deletions
diff --git a/ppapi/shared_impl/video_decoder_impl.cc b/ppapi/shared_impl/video_decoder_impl.cc index e665941..ef20f8b 100644 --- a/ppapi/shared_impl/video_decoder_impl.cc +++ b/ppapi/shared_impl/video_decoder_impl.cc @@ -44,22 +44,26 @@ void VideoDecoderImpl::Destroy() { UnrefResource(context3d_id_); } -void VideoDecoderImpl::SetFlushCallback(PP_CompletionCallback callback) { +bool VideoDecoderImpl::SetFlushCallback(PP_CompletionCallback callback) { CHECK(callback.func); - DCHECK(!flush_callback_.func); + if (flush_callback_.func) + return false; flush_callback_ = callback; + return true; } -void VideoDecoderImpl::SetResetCallback(PP_CompletionCallback callback) { +bool VideoDecoderImpl::SetResetCallback(PP_CompletionCallback callback) { CHECK(callback.func); - DCHECK(!reset_callback_.func); + if (reset_callback_.func) + return false; reset_callback_ = callback; + return true; } -void VideoDecoderImpl::SetBitstreamBufferCallback( +bool VideoDecoderImpl::SetBitstreamBufferCallback( int32 bitstream_buffer_id, PP_CompletionCallback callback) { - CHECK(bitstream_buffer_callbacks_.insert( - std::make_pair(bitstream_buffer_id, callback)).second); + return bitstream_buffer_callbacks_.insert( + std::make_pair(bitstream_buffer_id, callback)).second; } void VideoDecoderImpl::RunFlushCallback(int32 result) { diff --git a/ppapi/shared_impl/video_decoder_impl.h b/ppapi/shared_impl/video_decoder_impl.h index b874bba..6cd8044 100644 --- a/ppapi/shared_impl/video_decoder_impl.h +++ b/ppapi/shared_impl/video_decoder_impl.h @@ -44,9 +44,9 @@ class VideoDecoderImpl : public thunk::PPB_VideoDecoder_API { std::vector<PP_VideoConfigElement>* out_configs); protected: - void SetFlushCallback(PP_CompletionCallback callback); - void SetResetCallback(PP_CompletionCallback callback); - void SetBitstreamBufferCallback( + bool SetFlushCallback(PP_CompletionCallback callback); + bool SetResetCallback(PP_CompletionCallback callback); + bool SetBitstreamBufferCallback( int32 bitstream_buffer_id, PP_CompletionCallback callback); void RunFlushCallback(int32 result); |