Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: ppapi/cpp/dev/video_decoder_dev.cc

Issue 6975053: PPAPI: Fix interface functions that take PP_CompletionCallbacks, but don't (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/dev/video_decoder_dev.h ('k') | ppapi/tests/arch_dependent_sizes_32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/video_decoder_dev.cc
===================================================================
--- ppapi/cpp/dev/video_decoder_dev.cc (revision 87892)
+++ ppapi/cpp/dev/video_decoder_dev.cc (working copy)
@@ -22,19 +22,24 @@
} // namespace
-VideoDecoder::VideoDecoder(const Instance* instance,
- const PP_VideoConfigElement* config,
- CompletionCallback callback,
- Client* client)
+VideoDecoder::VideoDecoder(const Instance* instance, Client* client)
: client_(client) {
if (!has_interface<PPB_VideoDecoder_Dev>())
return;
PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create(
- instance->pp_instance(), config, callback.pp_completion_callback()));
+ instance->pp_instance()));
}
VideoDecoder::~VideoDecoder() {}
+int32_t VideoDecoder::Initialize(const PP_VideoConfigElement* config,
+ CompletionCallback callback) {
+ if (!has_interface<PPB_VideoDecoder_Dev>())
+ return PP_ERROR_NOINTERFACE;
+ return get_interface<PPB_VideoDecoder_Dev>()->Initialize(
+ pp_resource(), config, callback.pp_completion_callback());
+}
+
bool VideoDecoder::GetConfigs(Instance* instance,
const PP_VideoConfigElement* prototype_config,
PP_VideoConfigElement* matching_configs,
@@ -63,12 +68,15 @@
pp_resource(), buffers.size(), &buffers[0]);
}
-bool VideoDecoder::Decode(const PP_VideoBitstreamBuffer_Dev& bitstream_buffer,
- CompletionCallback callback) {
- if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
- return false;
- return PPBoolToBool(get_interface<PPB_VideoDecoder_Dev>()->Decode(
- pp_resource(), &bitstream_buffer, callback.pp_completion_callback()));
+int32_t VideoDecoder::Decode(
+ const PP_VideoBitstreamBuffer_Dev& bitstream_buffer,
+ CompletionCallback callback) {
+ if (!has_interface<PPB_VideoDecoder_Dev>())
+ return PP_ERROR_NOINTERFACE;
+ if (!pp_resource())
+ return PP_ERROR_BADRESOURCE;
+ return get_interface<PPB_VideoDecoder_Dev>()->Decode(
+ pp_resource(), &bitstream_buffer, callback.pp_completion_callback());
}
void VideoDecoder::ReusePictureBuffer(int32_t picture_buffer_id) {
@@ -78,18 +86,22 @@
pp_resource(), picture_buffer_id);
}
-bool VideoDecoder::Flush(CompletionCallback callback) {
- if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
- return false;
- return PPBoolToBool(get_interface<PPB_VideoDecoder_Dev>()->Flush(
- pp_resource(), callback.pp_completion_callback()));
+int32_t VideoDecoder::Flush(CompletionCallback callback) {
+ if (!has_interface<PPB_VideoDecoder_Dev>())
+ return PP_ERROR_NOINTERFACE;
+ if (!pp_resource())
+ return PP_ERROR_BADRESOURCE;
+ return get_interface<PPB_VideoDecoder_Dev>()->Flush(
+ pp_resource(), callback.pp_completion_callback());
}
-bool VideoDecoder::Abort(CompletionCallback callback) {
- if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
- return false;
- return PPBoolToBool(get_interface<PPB_VideoDecoder_Dev>()->Abort(
- pp_resource(), callback.pp_completion_callback()));
+int32_t VideoDecoder::Abort(CompletionCallback callback) {
+ if (!has_interface<PPB_VideoDecoder_Dev>())
+ return PP_ERROR_NOINTERFACE;
+ if (!pp_resource())
+ return PP_ERROR_BADRESOURCE;
+ return get_interface<PPB_VideoDecoder_Dev>()->Abort(
+ pp_resource(), callback.pp_completion_callback());
}
} // namespace pp
« no previous file with comments | « ppapi/cpp/dev/video_decoder_dev.h ('k') | ppapi/tests/arch_dependent_sizes_32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698