summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppb_video_decoder_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/plugins/ppapi/ppb_video_decoder_impl.h')
-rw-r--r--webkit/plugins/ppapi/ppb_video_decoder_impl.h50
1 files changed, 42 insertions, 8 deletions
diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.h b/webkit/plugins/ppapi/ppb_video_decoder_impl.h
index 492cb33..cb9750d 100644
--- a/webkit/plugins/ppapi/ppb_video_decoder_impl.h
+++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.h
@@ -5,14 +5,18 @@
#ifndef WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_
#define WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_
+#include <vector>
+
#include "base/basictypes.h"
+#include "base/memory/scoped_callback_factory.h"
#include "base/memory/scoped_ptr.h"
+#include "ppapi/c/pp_var.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
#include "webkit/plugins/ppapi/resource.h"
+union PP_PictureData_Dev;
struct PP_VideoDecoderConfig_Dev;
-struct PP_VideoCompressedDataBuffer_Dev;
-struct PP_VideoUncompressedDataBuffer_Dev;
+struct PP_VideoBitstreamBuffer_Dev;
struct PPB_VideoDecoder_Dev;
namespace webkit {
@@ -20,9 +24,10 @@ namespace ppapi {
class PluginInstance;
-class PPB_VideoDecoder_Impl : public Resource {
+class PPB_VideoDecoder_Impl : public Resource,
+ public media::VideoDecodeAccelerator::Client {
public:
- PPB_VideoDecoder_Impl(PluginInstance* instance);
+ explicit PPB_VideoDecoder_Impl(PluginInstance* instance);
virtual ~PPB_VideoDecoder_Impl();
// Returns a pointer to the interface implementing PPB_VideoDecoder that is
@@ -33,16 +38,45 @@ class PPB_VideoDecoder_Impl : public Resource {
virtual PPB_VideoDecoder_Impl* AsPPB_VideoDecoder_Impl();
// PPB_VideoDecoder implementation.
- bool Init(const PP_VideoDecoderConfig_Dev& decoder_config);
- bool Decode(PP_VideoCompressedDataBuffer_Dev& input_buffer);
- int32_t Flush(PP_CompletionCallback& callback);
- bool ReturnUncompressedDataBuffer(PP_VideoUncompressedDataBuffer_Dev& buffer);
+ bool GetConfigs(PP_VideoDecoderConfig_Dev* proto_config,
+ PP_VideoDecoderConfig_Dev* matching_configs,
+ int32_t matching_configs_size,
+ int32_t* num_of_matching_configs);
+ bool Init(PP_VideoDecoderConfig_Dev* dec_config);
+ bool Decode(PP_VideoBitstreamBuffer_Dev* bitstream_buffer,
+ PP_CompletionCallback callback);
+ void AssignPictureBuffer(uint32_t no_of_picture_buffers,
+ PP_PictureData_Dev* picture_buffers);
+ void ReusePictureBuffer(PP_PictureData_Dev* picture_buffer);
+ bool Flush(PP_CompletionCallback callback);
+ bool Abort(PP_CompletionCallback callback);
+
+ // media::VideoDecodeAccelerator::Client implementation.
+ void ProvidePictureBuffers(uint32_t requested_num_of_buffers,
+ const std::vector<uint32_t>& buffer_properties);
+ void DismissPictureBuffer(
+ media::VideoDecodeAccelerator::PictureBuffer* picture_buffer);
+ void PictureReady(media::VideoDecodeAccelerator::Picture* picture);
+ void NotifyPictureReady();
+ void NotifyEndOfStream();
+ void NotifyError(media::VideoDecodeAccelerator::Error error);
private:
+ void OnAbortComplete();
+ void OnBitstreamBufferProcessed();
+ void OnFlushComplete();
+
// This is NULL before initialization, and if this PPB_VideoDecoder_Impl is
// swapped with another.
scoped_ptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_;
+ // Factory to produce our callbacks.
+ base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_;
+
+ PP_CompletionCallback abort_callback_;
+ PP_CompletionCallback flush_callback_;
+ PP_CompletionCallback bitstream_buffer_callback_;
+
DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl);
};