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

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

Issue 7085030: Implementation for Pepper C++ Video Decoder API (wrapper on top of C API). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unused parameter error detected by tryserver. 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
Index: ppapi/cpp/dev/video_decoder_dev.cc
diff --git a/ppapi/cpp/dev/video_decoder_dev.cc b/ppapi/cpp/dev/video_decoder_dev.cc
index 504530a29616642ddb08da314695e13f02a0d2cb..0750e22b79f26fec935286981bf00ca37c271fb4 100644
--- a/ppapi/cpp/dev/video_decoder_dev.cc
+++ b/ppapi/cpp/dev/video_decoder_dev.cc
@@ -12,8 +12,6 @@
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
-using std::vector;
-
namespace pp {
namespace {
@@ -24,64 +22,74 @@ template <> const char* interface_name<PPB_VideoDecoder_Dev>() {
} // namespace
-VideoDecoder::VideoDecoder(const Instance* /* instance */,
- const std::vector<uint32_t>& /* config */,
- CompletionCallback /* callback */,
+VideoDecoder::VideoDecoder(const Instance* instance,
+ PP_VideoConfigElement* config,
Ami GONE FROM CHROMIUM 2011/06/01 18:26:28 const
Ville-Mikko Rautio 2011/06/03 09:26:05 Done.
+ CompletionCallback callback,
Client* client)
: client_(client) {
if (!has_interface<PPB_VideoDecoder_Dev>())
return;
- // TODO(vmr): Implement.
+ PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create(
+ instance->pp_instance(), config, callback.pp_completion_callback()));
}
VideoDecoder::~VideoDecoder() {}
-vector<uint32_t> VideoDecoder::GetConfigs(
- Instance* /* instance */,
- const vector<uint32_t>& /* prototype_config */) {
- // TODO(vmr): Implement.
- vector<uint32_t> matching_configs;
+bool VideoDecoder::GetConfigs(Instance* instance,
+ const PP_VideoConfigElement* prototype_config,
+ PP_VideoConfigElement* matching_configs,
+ uint32_t matching_configs_size,
+ uint32_t* num_of_matching_configs) {
if (!has_interface<PPB_VideoDecoder_Dev>())
- return matching_configs;
- return matching_configs;
+ return false;
+ return PPBoolToBool(get_interface<PPB_VideoDecoder_Dev>()->GetConfigs(
+ instance->pp_instance(), prototype_config, matching_configs,
+ matching_configs_size, num_of_matching_configs));
}
-void VideoDecoder::AssignGLESBuffers(uint32_t /* no_of_buffers */,
- const PP_GLESBuffer_Dev& /* buffers */) {
- // TODO(vmr): Implement.
+void VideoDecoder::AssignGLESBuffers(
+ const std::vector<PP_GLESBuffer_Dev>& buffers) {
+ if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
+ return;
+ get_interface<PPB_VideoDecoder_Dev>()->AssignGLESBuffers(
+ pp_resource(), buffers.size(), &buffers[0]);
}
void VideoDecoder::AssignSysmemBuffers(
- uint32_t /* no_of_buffers */,
- const PP_SysmemBuffer_Dev& /* buffers */) {
- // TODO(vmr): Implement.
+ const std::vector<PP_SysmemBuffer_Dev>& buffers) {
+ if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
+ return;
+ get_interface<PPB_VideoDecoder_Dev>()->AssignSysmemBuffers(
+ pp_resource(), buffers.size(), &buffers[0]);
}
-bool VideoDecoder::Decode(
- const PP_VideoBitstreamBuffer_Dev& /* bitstream_buffer */,
- CompletionCallback /* callback */) {
- // TODO(vmr): Implement.
+bool VideoDecoder::Decode(const PP_VideoBitstreamBuffer_Dev& bitstream_buffer,
+ CompletionCallback callback) {
if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
return false;
- return false;
+ return PPBoolToBool(get_interface<PPB_VideoDecoder_Dev>()->Decode(
+ pp_resource(), &bitstream_buffer, callback.pp_completion_callback()));
}
-void VideoDecoder::ReusePictureBuffer(int32_t /* picture_buffer_id */) {
- // TODO(vmr): Implement.
+void VideoDecoder::ReusePictureBuffer(int32_t picture_buffer_id) {
+ if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
+ return;
+ get_interface<PPB_VideoDecoder_Dev>()->ReusePictureBuffer(
+ pp_resource(), picture_buffer_id);
}
-bool VideoDecoder::Flush(CompletionCallback /* callback */) {
- // TODO(vmr): Implement.
- if (!has_interface<PPB_VideoDecoder_Dev>())
+bool VideoDecoder::Flush(CompletionCallback callback) {
+ if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
return false;
- return true;
+ return PPBoolToBool(get_interface<PPB_VideoDecoder_Dev>()->Flush(
+ pp_resource(), callback.pp_completion_callback()));
}
-bool VideoDecoder::Abort(CompletionCallback /* callback */) {
- // TODO(vmr): Implement.
- if (!has_interface<PPB_VideoDecoder_Dev>())
+bool VideoDecoder::Abort(CompletionCallback callback) {
+ if (!has_interface<PPB_VideoDecoder_Dev>() || !pp_resource())
return false;
- return true;
+ return PPBoolToBool(get_interface<PPB_VideoDecoder_Dev>()->Abort(
+ pp_resource(), callback.pp_completion_callback()));
}
} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698