summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Budge <bbudge@google.com>2014-11-06 14:31:21 -0800
committerBill Budge <bbudge@google.com>2014-11-06 22:33:05 +0000
commit2d4bf3a9f724cfc78d43b6b247397ca76d39b3f4 (patch)
treecc1a0628d5b00476df5bb8a25cca91ce5df3710a
parent0270f3e42d769d55807d925daaacf7cb4f60e807 (diff)
downloadchromium_src-2d4bf3a9f724cfc78d43b6b247397ca76d39b3f4.zip
chromium_src-2d4bf3a9f724cfc78d43b6b247397ca76d39b3f4.tar.gz
chromium_src-2d4bf3a9f724cfc78d43b6b247397ca76d39b3f4.tar.bz2
Pepper: Expose visible_rect to PPB_VideoDecoder.GetPicture.
Adds an out parameter to GetPicture to return the subrectangle of the picture texture that contains the picture. Adds a new 0.3 version of PPB_VideoDecoder. BUG=429071 NOPRESUBMIT=true R=binji@chromium.org, dmichael@chromium.org, mpearson@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/703753002 Cr-Commit-Position: refs/heads/master@{#303102}
-rw-r--r--content/renderer/pepper/pepper_video_decoder_host.cc14
-rw-r--r--ppapi/api/pp_codecs.idl40
-rw-r--r--ppapi/api/ppb_video_decoder.idl30
-rw-r--r--ppapi/c/pp_codecs.h40
-rw-r--r--ppapi/c/pp_macros.h3
-rw-r--r--ppapi/c/ppb_video_decoder.h37
-rw-r--r--ppapi/cpp/video_decoder.cc79
-rw-r--r--ppapi/cpp/video_decoder.h2
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c71
-rw-r--r--ppapi/proxy/ppapi_messages.h5
-rw-r--r--ppapi/proxy/video_decoder_resource.cc60
-rw-r--r--ppapi/proxy/video_decoder_resource.h20
-rw-r--r--ppapi/proxy/video_decoder_resource_unittest.cc13
-rw-r--r--ppapi/thunk/interfaces_ppb_public_stable.h1
-rw-r--r--ppapi/thunk/ppb_video_decoder_api.h2
-rw-r--r--ppapi/thunk/ppb_video_decoder_thunk.cc64
-rw-r--r--tools/metrics/histograms/histograms.xml2
17 files changed, 401 insertions, 82 deletions
diff --git a/content/renderer/pepper/pepper_video_decoder_host.cc b/content/renderer/pepper/pepper_video_decoder_host.cc
index 086c150..02e14f3 100644
--- a/content/renderer/pepper/pepper_video_decoder_host.cc
+++ b/content/renderer/pepper/pepper_video_decoder_host.cc
@@ -9,6 +9,7 @@
#include "content/common/gpu/client/gpu_channel_host.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/renderer_ppapi_host.h"
+#include "content/renderer/pepper/gfx_conversion.h"
#include "content/renderer/pepper/ppb_graphics_3d_impl.h"
#include "content/renderer/pepper/video_decoder_shim.h"
#include "media/video/video_decode_accelerator.h"
@@ -314,12 +315,13 @@ void PepperVideoDecoderHost::ProvidePictureBuffers(
}
void PepperVideoDecoderHost::PictureReady(const media::Picture& picture) {
- // So far picture.visible_rect is not used. If used, visible_rect should
- // be validated since it comes from GPU process and may not be trustworthy.
- host()->SendUnsolicitedReply(
- pp_resource(),
- PpapiPluginMsg_VideoDecoder_PictureReady(picture.bitstream_buffer_id(),
- picture.picture_buffer_id()));
+ // Don't bother validating the visible rect, since the plugin process is less
+ // trusted than the gpu process.
+ PP_Rect visible_rect = PP_FromGfxRect(picture.visible_rect());
+ host()->SendUnsolicitedReply(pp_resource(),
+ PpapiPluginMsg_VideoDecoder_PictureReady(
+ picture.bitstream_buffer_id(),
+ picture.picture_buffer_id(), visible_rect));
}
void PepperVideoDecoderHost::DismissPictureBuffer(int32 picture_buffer_id) {
diff --git a/ppapi/api/pp_codecs.idl b/ppapi/api/pp_codecs.idl
index 11010fa..5a93ff1 100644
--- a/ppapi/api/pp_codecs.idl
+++ b/ppapi/api/pp_codecs.idl
@@ -74,4 +74,44 @@ struct PP_VideoPicture {
* Dimensions of the texture holding the decoded picture.
*/
PP_Size texture_size;
+
+ /**
+ * The visible subrectangle of the picture. The plugin should display only
+ * this part of the picture.
+ */
+ PP_Rect visible_rect;
+};
+
+/**
+ * Struct describing a decoded video picture. The decoded picture data is stored
+ * in the GL texture corresponding to |texture_id|. The plugin can determine
+ * which Decode call generated the picture using |decode_id|.
+ */
+struct PP_VideoPicture_0_1 {
+ /**
+ * |decode_id| parameter of the Decode call which generated this picture.
+ * See the PPB_VideoDecoder function Decode() for more details.
+ */
+ uint32_t decode_id;
+
+ /**
+ * Texture ID in the plugin's GL context. The plugin can use this to render
+ * the decoded picture.
+ */
+ uint32_t texture_id;
+
+ /**
+ * The GL texture target for the decoded picture. Possible values are:
+ * GL_TEXTURE_2D
+ * GL_TEXTURE_RECTANGLE_ARB
+ * GL_TEXTURE_EXTERNAL_OES
+ *
+ * The pixel format of the texture is GL_RGBA.
+ */
+ uint32_t texture_target;
+
+ /**
+ * Dimensions of the texture holding the decoded picture.
+ */
+ PP_Size texture_size;
};
diff --git a/ppapi/api/ppb_video_decoder.idl b/ppapi/api/ppb_video_decoder.idl
index 848543c..c8c6945 100644
--- a/ppapi/api/ppb_video_decoder.idl
+++ b/ppapi/api/ppb_video_decoder.idl
@@ -12,7 +12,8 @@
label Chrome {
/** Though not labeled 'channel=dev', 0.1 is a still a 'Dev' only API. */
M36 = 0.1,
- M39 = 0.2
+ M39 = 0.2,
+ M40 = 1.0
};
/**
@@ -182,6 +183,33 @@ interface PPB_VideoDecoder {
*/
int32_t GetPicture(
[in] PP_Resource video_decoder,
+ [out] PP_VideoPicture_0_1 picture,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Gets the next picture from the decoder. The picture is valid after the
+ * decoder signals completion by returning PP_OK or running |callback|. The
+ * plugin can call GetPicture() again after the decoder signals completion.
+ * When the plugin is finished using the picture, it should return it to the
+ * system by calling RecyclePicture().
+ *
+ * @param[in] video_decoder A <code>PP_Resource</code> identifying the video
+ * decoder.
+ * @param[out] picture A <code>PP_VideoPicture</code> to hold the decoded
+ * picture.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called on
+ * completion.
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Reset()
+ * call is pending.
+ * Returns PP_ERROR_INPROGRESS if there is another GetPicture() call pending.
+ * Returns PP_ERROR_ABORTED when Reset() is called, or if a call to Flush()
+ * completes while GetPicture() is pending.
+ */
+ [version = 1.0]
+ int32_t GetPicture(
+ [in] PP_Resource video_decoder,
[out] PP_VideoPicture picture,
[in] PP_CompletionCallback callback);
diff --git a/ppapi/c/pp_codecs.h b/ppapi/c/pp_codecs.h
index f10a480..86d8fb5 100644
--- a/ppapi/c/pp_codecs.h
+++ b/ppapi/c/pp_codecs.h
@@ -3,12 +3,14 @@
* found in the LICENSE file.
*/
-/* From pp_codecs.idl modified Fri Aug 22 13:39:56 2014. */
+/* From pp_codecs.idl modified Wed Nov 5 13:38:52 2014. */
#ifndef PPAPI_C_PP_CODECS_H_
#define PPAPI_C_PP_CODECS_H_
#include "ppapi/c/pp_macros.h"
+#include "ppapi/c/pp_point.h"
+#include "ppapi/c/pp_rect.h"
#include "ppapi/c/pp_size.h"
#include "ppapi/c/pp_stdint.h"
@@ -91,6 +93,42 @@ struct PP_VideoPicture {
* Dimensions of the texture holding the decoded picture.
*/
struct PP_Size texture_size;
+ /**
+ * The visible subrectangle of the picture. The plugin should display only
+ * this part of the picture.
+ */
+ struct PP_Rect visible_rect;
+};
+
+/**
+ * Struct describing a decoded video picture. The decoded picture data is stored
+ * in the GL texture corresponding to |texture_id|. The plugin can determine
+ * which Decode call generated the picture using |decode_id|.
+ */
+struct PP_VideoPicture_0_1 {
+ /**
+ * |decode_id| parameter of the Decode call which generated this picture.
+ * See the PPB_VideoDecoder function Decode() for more details.
+ */
+ uint32_t decode_id;
+ /**
+ * Texture ID in the plugin's GL context. The plugin can use this to render
+ * the decoded picture.
+ */
+ uint32_t texture_id;
+ /**
+ * The GL texture target for the decoded picture. Possible values are:
+ * GL_TEXTURE_2D
+ * GL_TEXTURE_RECTANGLE_ARB
+ * GL_TEXTURE_EXTERNAL_OES
+ *
+ * The pixel format of the texture is GL_RGBA.
+ */
+ uint32_t texture_target;
+ /**
+ * Dimensions of the texture holding the decoded picture.
+ */
+ struct PP_Size texture_size;
};
/**
* @}
diff --git a/ppapi/c/pp_macros.h b/ppapi/c/pp_macros.h
index e9e3ca5..c78dad0 100644
--- a/ppapi/c/pp_macros.h
+++ b/ppapi/c/pp_macros.h
@@ -8,8 +8,7 @@
#ifndef PPAPI_C_PP_MACROS_H_
#define PPAPI_C_PP_MACROS_H_
-
-#define PPAPI_RELEASE 39
+#define PPAPI_RELEASE 40
/**
* @file
diff --git a/ppapi/c/ppb_video_decoder.h b/ppapi/c/ppb_video_decoder.h
index 2fd633d..91b2008 100644
--- a/ppapi/c/ppb_video_decoder.h
+++ b/ppapi/c/ppb_video_decoder.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_video_decoder.idl modified Mon Sep 8 16:40:15 2014. */
+/* From ppb_video_decoder.idl modified Wed Nov 5 14:04:14 2014. */
#ifndef PPAPI_C_PPB_VIDEO_DECODER_H_
#define PPAPI_C_PPB_VIDEO_DECODER_H_
@@ -13,13 +13,16 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_macros.h"
+#include "ppapi/c/pp_point.h"
+#include "ppapi/c/pp_rect.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_size.h"
#include "ppapi/c/pp_stdint.h"
#define PPB_VIDEODECODER_INTERFACE_0_1 "PPB_VideoDecoder;0.1"
#define PPB_VIDEODECODER_INTERFACE_0_2 "PPB_VideoDecoder;0.2"
-#define PPB_VIDEODECODER_INTERFACE PPB_VIDEODECODER_INTERFACE_0_2
+#define PPB_VIDEODECODER_INTERFACE_1_0 "PPB_VideoDecoder;1.0"
+#define PPB_VIDEODECODER_INTERFACE PPB_VIDEODECODER_INTERFACE_1_0
/**
* @file
@@ -54,7 +57,7 @@
* Chrome and ChromeOS: aac, h264.
* ChromeOS: mpeg4.
*/
-struct PPB_VideoDecoder_0_2 {
+struct PPB_VideoDecoder_1_0 {
/**
* Creates a new video decoder resource.
*
@@ -217,7 +220,7 @@ struct PPB_VideoDecoder_0_2 {
struct PP_CompletionCallback callback);
};
-typedef struct PPB_VideoDecoder_0_2 PPB_VideoDecoder;
+typedef struct PPB_VideoDecoder_1_0 PPB_VideoDecoder;
struct PPB_VideoDecoder_0_1 {
PP_Resource (*Create)(PP_Instance instance);
@@ -233,7 +236,31 @@ struct PPB_VideoDecoder_0_1 {
const void* buffer,
struct PP_CompletionCallback callback);
int32_t (*GetPicture)(PP_Resource video_decoder,
- struct PP_VideoPicture* picture,
+ struct PP_VideoPicture_0_1* picture,
+ struct PP_CompletionCallback callback);
+ void (*RecyclePicture)(PP_Resource video_decoder,
+ const struct PP_VideoPicture* picture);
+ int32_t (*Flush)(PP_Resource video_decoder,
+ struct PP_CompletionCallback callback);
+ int32_t (*Reset)(PP_Resource video_decoder,
+ struct PP_CompletionCallback callback);
+};
+
+struct PPB_VideoDecoder_0_2 {
+ PP_Resource (*Create)(PP_Instance instance);
+ PP_Bool (*IsVideoDecoder)(PP_Resource resource);
+ int32_t (*Initialize)(PP_Resource video_decoder,
+ PP_Resource graphics3d_context,
+ PP_VideoProfile profile,
+ PP_HardwareAcceleration acceleration,
+ struct PP_CompletionCallback callback);
+ int32_t (*Decode)(PP_Resource video_decoder,
+ uint32_t decode_id,
+ uint32_t size,
+ const void* buffer,
+ struct PP_CompletionCallback callback);
+ int32_t (*GetPicture)(PP_Resource video_decoder,
+ struct PP_VideoPicture_0_1* picture,
struct PP_CompletionCallback callback);
void (*RecyclePicture)(PP_Resource video_decoder,
const struct PP_VideoPicture* picture);
diff --git a/ppapi/cpp/video_decoder.cc b/ppapi/cpp/video_decoder.cc
index 85654c1..42236e4 100644
--- a/ppapi/cpp/video_decoder.cc
+++ b/ppapi/cpp/video_decoder.cc
@@ -25,6 +25,44 @@ const char* interface_name<PPB_VideoDecoder_0_2>() {
return PPB_VIDEODECODER_INTERFACE_0_2;
}
+template <>
+const char* interface_name<PPB_VideoDecoder_1_0>() {
+ return PPB_VIDEODECODER_INTERFACE_1_0;
+}
+
+// This struct is used to adapt CompletionCallbackWithOutput<PP_VideoPicture> to
+// the pre-1.0 APIs, which return PP_VideoPicture_0_1. This struct is allocated
+// on the heap, and deleted in CallbackConverter.
+struct CallbackData_0_1 {
+ explicit CallbackData_0_1(
+ const CompletionCallbackWithOutput<PP_VideoPicture>& cc)
+ : original_picture(cc.output()),
+ original_callback(cc.pp_completion_callback()) {}
+ PP_VideoPicture_0_1 picture;
+ PP_VideoPicture* original_picture;
+ PP_CompletionCallback original_callback;
+};
+
+// Convert a 1.0 style callback to pre-1.0 callback.
+void CallbackConverter(void* user_data, int32_t result) {
+ CallbackData_0_1* data = static_cast<CallbackData_0_1*>(user_data);
+ if (result == PP_OK) {
+ PP_VideoPicture_0_1* picture = &data->picture;
+ PP_VideoPicture* original_picture = data->original_picture;
+ original_picture->decode_id = picture->decode_id;
+ original_picture->texture_id = picture->texture_id;
+ original_picture->texture_target = picture->texture_target;
+ original_picture->texture_size = picture->texture_size;
+ // Set visible_rect to the entire picture.
+ original_picture->visible_rect = PP_MakeRectFromXYWH(
+ 0, 0, picture->texture_size.width, picture->texture_size.height);
+ }
+
+ // Now execute the original callback.
+ PP_RunCompletionCallback(&data->original_callback, result);
+ delete data;
+}
+
} // namespace
VideoDecoder::VideoDecoder() {
@@ -44,12 +82,14 @@ int32_t VideoDecoder::Initialize(const Graphics3D& context,
PP_VideoProfile profile,
PP_HardwareAcceleration acceleration,
const CompletionCallback& cc) {
+ if (has_interface<PPB_VideoDecoder_1_0>()) {
+ return get_interface<PPB_VideoDecoder_1_0>()->Initialize(
+ pp_resource(), context.pp_resource(), profile, acceleration,
+ cc.pp_completion_callback());
+ }
if (has_interface<PPB_VideoDecoder_0_2>()) {
return get_interface<PPB_VideoDecoder_0_2>()->Initialize(
- pp_resource(),
- context.pp_resource(),
- profile,
- acceleration,
+ pp_resource(), context.pp_resource(), profile, acceleration,
cc.pp_completion_callback());
}
if (has_interface<PPB_VideoDecoder_0_1>()) {
@@ -71,6 +111,10 @@ int32_t VideoDecoder::Decode(uint32_t decode_id,
uint32_t size,
const void* buffer,
const CompletionCallback& cc) {
+ if (has_interface<PPB_VideoDecoder_1_0>()) {
+ return get_interface<PPB_VideoDecoder_1_0>()->Decode(
+ pp_resource(), decode_id, size, buffer, cc.pp_completion_callback());
+ }
if (has_interface<PPB_VideoDecoder_0_2>()) {
return get_interface<PPB_VideoDecoder_0_2>()->Decode(
pp_resource(), decode_id, size, buffer, cc.pp_completion_callback());
@@ -84,19 +128,32 @@ int32_t VideoDecoder::Decode(uint32_t decode_id,
int32_t VideoDecoder::GetPicture(
const CompletionCallbackWithOutput<PP_VideoPicture>& cc) {
+ if (has_interface<PPB_VideoDecoder_1_0>()) {
+ return get_interface<PPB_VideoDecoder_1_0>()->GetPicture(
+ pp_resource(), cc.output(), cc.pp_completion_callback());
+ }
if (has_interface<PPB_VideoDecoder_0_2>()) {
+ // Data for our callback wrapper. The callback handler will delete it.
+ CallbackData_0_1* data = new CallbackData_0_1(cc);
return get_interface<PPB_VideoDecoder_0_2>()->GetPicture(
- pp_resource(), cc.output(), cc.pp_completion_callback());
+ pp_resource(), &data->picture,
+ PP_MakeCompletionCallback(&CallbackConverter, data));
}
if (has_interface<PPB_VideoDecoder_0_1>()) {
+ // Data for our callback wrapper. The callback handler will delete it.
+ CallbackData_0_1* data = new CallbackData_0_1(cc);
return get_interface<PPB_VideoDecoder_0_1>()->GetPicture(
- pp_resource(), cc.output(), cc.pp_completion_callback());
+ pp_resource(), &data->picture,
+ PP_MakeCompletionCallback(&CallbackConverter, data));
}
return cc.MayForce(PP_ERROR_NOINTERFACE);
}
void VideoDecoder::RecyclePicture(const PP_VideoPicture& picture) {
- if (has_interface<PPB_VideoDecoder_0_2>()) {
+ if (has_interface<PPB_VideoDecoder_1_0>()) {
+ get_interface<PPB_VideoDecoder_1_0>()->RecyclePicture(pp_resource(),
+ &picture);
+ } else if (has_interface<PPB_VideoDecoder_0_2>()) {
get_interface<PPB_VideoDecoder_0_2>()->RecyclePicture(pp_resource(),
&picture);
} else if (has_interface<PPB_VideoDecoder_0_1>()) {
@@ -106,6 +163,10 @@ void VideoDecoder::RecyclePicture(const PP_VideoPicture& picture) {
}
int32_t VideoDecoder::Flush(const CompletionCallback& cc) {
+ if (has_interface<PPB_VideoDecoder_1_0>()) {
+ return get_interface<PPB_VideoDecoder_1_0>()->Flush(
+ pp_resource(), cc.pp_completion_callback());
+ }
if (has_interface<PPB_VideoDecoder_0_2>()) {
return get_interface<PPB_VideoDecoder_0_2>()->Flush(
pp_resource(), cc.pp_completion_callback());
@@ -118,6 +179,10 @@ int32_t VideoDecoder::Flush(const CompletionCallback& cc) {
}
int32_t VideoDecoder::Reset(const CompletionCallback& cc) {
+ if (has_interface<PPB_VideoDecoder_1_0>()) {
+ return get_interface<PPB_VideoDecoder_1_0>()->Reset(
+ pp_resource(), cc.pp_completion_callback());
+ }
if (has_interface<PPB_VideoDecoder_0_2>()) {
return get_interface<PPB_VideoDecoder_0_2>()->Reset(
pp_resource(), cc.pp_completion_callback());
diff --git a/ppapi/cpp/video_decoder.h b/ppapi/cpp/video_decoder.h
index cc7267b..60be572 100644
--- a/ppapi/cpp/video_decoder.h
+++ b/ppapi/cpp/video_decoder.h
@@ -15,8 +15,6 @@
/// @file
/// This file defines the API to create and use a VideoDecoder resource.
-struct PP_FileInfo;
-
namespace pp {
class InstanceHandle;
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index 7dc3874..82e09e8 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -145,6 +145,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VarArrayBuffer_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VarDictionary_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDecoder_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDecoder_0_2;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDecoder_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_WebSocket_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Messaging_1_0;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3;
@@ -1965,7 +1966,7 @@ static int32_t Pnacl_M36_PPB_VideoDecoder_Decode(PP_Resource video_decoder, uint
return iface->Decode(video_decoder, decode_id, size, buffer, *callback);
}
-static int32_t Pnacl_M36_PPB_VideoDecoder_GetPicture(PP_Resource video_decoder, struct PP_VideoPicture* picture, struct PP_CompletionCallback* callback) {
+static int32_t Pnacl_M36_PPB_VideoDecoder_GetPicture(PP_Resource video_decoder, struct PP_VideoPicture_0_1* picture, struct PP_CompletionCallback* callback) {
const struct PPB_VideoDecoder_0_1 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_0_1.real_iface;
return iface->GetPicture(video_decoder, picture, *callback);
}
@@ -2009,7 +2010,7 @@ static int32_t Pnacl_M39_PPB_VideoDecoder_Decode(PP_Resource video_decoder, uint
return iface->Decode(video_decoder, decode_id, size, buffer, *callback);
}
-static int32_t Pnacl_M39_PPB_VideoDecoder_GetPicture(PP_Resource video_decoder, struct PP_VideoPicture* picture, struct PP_CompletionCallback* callback) {
+static int32_t Pnacl_M39_PPB_VideoDecoder_GetPicture(PP_Resource video_decoder, struct PP_VideoPicture_0_1* picture, struct PP_CompletionCallback* callback) {
const struct PPB_VideoDecoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_0_2.real_iface;
return iface->GetPicture(video_decoder, picture, *callback);
}
@@ -2031,6 +2032,50 @@ static int32_t Pnacl_M39_PPB_VideoDecoder_Reset(PP_Resource video_decoder, struc
/* End wrapper methods for PPB_VideoDecoder_0_2 */
+/* Begin wrapper methods for PPB_VideoDecoder_1_0 */
+
+static PP_Resource Pnacl_M40_PPB_VideoDecoder_Create(PP_Instance instance) {
+ const struct PPB_VideoDecoder_1_0 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_1_0.real_iface;
+ return iface->Create(instance);
+}
+
+static PP_Bool Pnacl_M40_PPB_VideoDecoder_IsVideoDecoder(PP_Resource resource) {
+ const struct PPB_VideoDecoder_1_0 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_1_0.real_iface;
+ return iface->IsVideoDecoder(resource);
+}
+
+static int32_t Pnacl_M40_PPB_VideoDecoder_Initialize(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoDecoder_1_0 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_1_0.real_iface;
+ return iface->Initialize(video_decoder, graphics3d_context, profile, acceleration, *callback);
+}
+
+static int32_t Pnacl_M40_PPB_VideoDecoder_Decode(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void* buffer, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoDecoder_1_0 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_1_0.real_iface;
+ return iface->Decode(video_decoder, decode_id, size, buffer, *callback);
+}
+
+static int32_t Pnacl_M40_PPB_VideoDecoder_GetPicture(PP_Resource video_decoder, struct PP_VideoPicture* picture, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoDecoder_1_0 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_1_0.real_iface;
+ return iface->GetPicture(video_decoder, picture, *callback);
+}
+
+static void Pnacl_M40_PPB_VideoDecoder_RecyclePicture(PP_Resource video_decoder, const struct PP_VideoPicture* picture) {
+ const struct PPB_VideoDecoder_1_0 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_1_0.real_iface;
+ iface->RecyclePicture(video_decoder, picture);
+}
+
+static int32_t Pnacl_M40_PPB_VideoDecoder_Flush(PP_Resource video_decoder, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoDecoder_1_0 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_1_0.real_iface;
+ return iface->Flush(video_decoder, *callback);
+}
+
+static int32_t Pnacl_M40_PPB_VideoDecoder_Reset(PP_Resource video_decoder, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoDecoder_1_0 *iface = Pnacl_WrapperInfo_PPB_VideoDecoder_1_0.real_iface;
+ return iface->Reset(video_decoder, *callback);
+}
+
+/* End wrapper methods for PPB_VideoDecoder_1_0 */
+
/* Not generating wrapper methods for PPB_VideoFrame_0_1 */
/* Not generating wrapper methods for PPB_View_1_0 */
@@ -5003,7 +5048,7 @@ static const struct PPB_VideoDecoder_0_1 Pnacl_Wrappers_PPB_VideoDecoder_0_1 = {
.IsVideoDecoder = (PP_Bool (*)(PP_Resource resource))&Pnacl_M36_PPB_VideoDecoder_IsVideoDecoder,
.Initialize = (int32_t (*)(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_Bool allow_software_fallback, struct PP_CompletionCallback callback))&Pnacl_M36_PPB_VideoDecoder_Initialize,
.Decode = (int32_t (*)(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void* buffer, struct PP_CompletionCallback callback))&Pnacl_M36_PPB_VideoDecoder_Decode,
- .GetPicture = (int32_t (*)(PP_Resource video_decoder, struct PP_VideoPicture* picture, struct PP_CompletionCallback callback))&Pnacl_M36_PPB_VideoDecoder_GetPicture,
+ .GetPicture = (int32_t (*)(PP_Resource video_decoder, struct PP_VideoPicture_0_1* picture, struct PP_CompletionCallback callback))&Pnacl_M36_PPB_VideoDecoder_GetPicture,
.RecyclePicture = (void (*)(PP_Resource video_decoder, const struct PP_VideoPicture* picture))&Pnacl_M36_PPB_VideoDecoder_RecyclePicture,
.Flush = (int32_t (*)(PP_Resource video_decoder, struct PP_CompletionCallback callback))&Pnacl_M36_PPB_VideoDecoder_Flush,
.Reset = (int32_t (*)(PP_Resource video_decoder, struct PP_CompletionCallback callback))&Pnacl_M36_PPB_VideoDecoder_Reset
@@ -5014,12 +5059,23 @@ static const struct PPB_VideoDecoder_0_2 Pnacl_Wrappers_PPB_VideoDecoder_0_2 = {
.IsVideoDecoder = (PP_Bool (*)(PP_Resource resource))&Pnacl_M39_PPB_VideoDecoder_IsVideoDecoder,
.Initialize = (int32_t (*)(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback))&Pnacl_M39_PPB_VideoDecoder_Initialize,
.Decode = (int32_t (*)(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void* buffer, struct PP_CompletionCallback callback))&Pnacl_M39_PPB_VideoDecoder_Decode,
- .GetPicture = (int32_t (*)(PP_Resource video_decoder, struct PP_VideoPicture* picture, struct PP_CompletionCallback callback))&Pnacl_M39_PPB_VideoDecoder_GetPicture,
+ .GetPicture = (int32_t (*)(PP_Resource video_decoder, struct PP_VideoPicture_0_1* picture, struct PP_CompletionCallback callback))&Pnacl_M39_PPB_VideoDecoder_GetPicture,
.RecyclePicture = (void (*)(PP_Resource video_decoder, const struct PP_VideoPicture* picture))&Pnacl_M39_PPB_VideoDecoder_RecyclePicture,
.Flush = (int32_t (*)(PP_Resource video_decoder, struct PP_CompletionCallback callback))&Pnacl_M39_PPB_VideoDecoder_Flush,
.Reset = (int32_t (*)(PP_Resource video_decoder, struct PP_CompletionCallback callback))&Pnacl_M39_PPB_VideoDecoder_Reset
};
+static const struct PPB_VideoDecoder_1_0 Pnacl_Wrappers_PPB_VideoDecoder_1_0 = {
+ .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M40_PPB_VideoDecoder_Create,
+ .IsVideoDecoder = (PP_Bool (*)(PP_Resource resource))&Pnacl_M40_PPB_VideoDecoder_IsVideoDecoder,
+ .Initialize = (int32_t (*)(PP_Resource video_decoder, PP_Resource graphics3d_context, PP_VideoProfile profile, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback))&Pnacl_M40_PPB_VideoDecoder_Initialize,
+ .Decode = (int32_t (*)(PP_Resource video_decoder, uint32_t decode_id, uint32_t size, const void* buffer, struct PP_CompletionCallback callback))&Pnacl_M40_PPB_VideoDecoder_Decode,
+ .GetPicture = (int32_t (*)(PP_Resource video_decoder, struct PP_VideoPicture* picture, struct PP_CompletionCallback callback))&Pnacl_M40_PPB_VideoDecoder_GetPicture,
+ .RecyclePicture = (void (*)(PP_Resource video_decoder, const struct PP_VideoPicture* picture))&Pnacl_M40_PPB_VideoDecoder_RecyclePicture,
+ .Flush = (int32_t (*)(PP_Resource video_decoder, struct PP_CompletionCallback callback))&Pnacl_M40_PPB_VideoDecoder_Flush,
+ .Reset = (int32_t (*)(PP_Resource video_decoder, struct PP_CompletionCallback callback))&Pnacl_M40_PPB_VideoDecoder_Reset
+};
+
/* Not generating wrapper interface for PPB_VideoFrame_0_1 */
/* Not generating wrapper interface for PPB_View_1_0 */
@@ -6022,6 +6078,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDecoder_0_2 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDecoder_1_0 = {
+ .iface_macro = PPB_VIDEODECODER_INTERFACE_1_0,
+ .wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_VideoDecoder_1_0,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_WebSocket_1_0 = {
.iface_macro = PPB_WEBSOCKET_INTERFACE_1_0,
.wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_WebSocket_1_0,
@@ -6432,6 +6494,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_VarDictionary_1_0,
&Pnacl_WrapperInfo_PPB_VideoDecoder_0_1,
&Pnacl_WrapperInfo_PPB_VideoDecoder_0_2,
+ &Pnacl_WrapperInfo_PPB_VideoDecoder_1_0,
&Pnacl_WrapperInfo_PPB_WebSocket_1_0,
&Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3,
&Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_4,
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index de7caf3..caf8287 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -1950,9 +1950,10 @@ IPC_MESSAGE_CONTROL4(PpapiPluginMsg_VideoDecoder_RequestTextures,
IPC_MESSAGE_CONTROL2(PpapiHostMsg_VideoDecoder_AssignTextures,
PP_Size /* size */,
std::vector<uint32_t> /* texture_ids */)
-IPC_MESSAGE_CONTROL2(PpapiPluginMsg_VideoDecoder_PictureReady,
+IPC_MESSAGE_CONTROL3(PpapiPluginMsg_VideoDecoder_PictureReady,
int32_t /* decode_id */,
- uint32_t /* texture_id */)
+ uint32_t /* texture_id */,
+ PP_Rect /* visible_rect */)
IPC_MESSAGE_CONTROL1(PpapiHostMsg_VideoDecoder_RecyclePicture,
uint32_t /* texture_id */)
IPC_MESSAGE_CONTROL1(PpapiPluginMsg_VideoDecoder_DismissPicture,
diff --git a/ppapi/proxy/video_decoder_resource.cc b/ppapi/proxy/video_decoder_resource.cc
index 733e6f8..2dbe60e 100644
--- a/ppapi/proxy/video_decoder_resource.cc
+++ b/ppapi/proxy/video_decoder_resource.cc
@@ -49,8 +49,10 @@ VideoDecoderResource::Texture::Texture(uint32_t texture_target,
VideoDecoderResource::Texture::~Texture() {
}
-VideoDecoderResource::Picture::Picture(int32_t decode_id, uint32_t texture_id)
- : decode_id(decode_id), texture_id(texture_id) {
+VideoDecoderResource::Picture::Picture(int32_t decode_id,
+ uint32_t texture_id,
+ const PP_Rect& visible_rect)
+ : decode_id(decode_id), texture_id(texture_id), visible_rect(visible_rect) {
}
VideoDecoderResource::Picture::~Picture() {
@@ -61,6 +63,7 @@ VideoDecoderResource::VideoDecoderResource(Connection connection,
: PluginResource(connection, instance),
num_decodes_(0),
get_picture_(NULL),
+ get_picture_0_1_(NULL),
gles2_impl_(NULL),
initialized_(false),
testing_(false),
@@ -249,6 +252,13 @@ int32_t VideoDecoderResource::Decode(uint32_t decode_id,
return PP_OK_COMPLETIONPENDING;
}
+int32_t VideoDecoderResource::GetPicture0_1(
+ PP_VideoPicture_0_1* picture,
+ scoped_refptr<TrackedCallback> callback) {
+ get_picture_0_1_ = picture;
+ return GetPicture(NULL, callback);
+}
+
int32_t VideoDecoderResource::GetPicture(
PP_VideoPicture* picture,
scoped_refptr<TrackedCallback> callback) {
@@ -259,14 +269,16 @@ int32_t VideoDecoderResource::GetPicture(
if (get_picture_callback_.get())
return PP_ERROR_INPROGRESS;
+ get_picture_ = picture;
+
// If the next picture is ready, return it synchronously.
if (!received_pictures_.empty()) {
- WriteNextPicture(picture);
+ WriteNextPicture();
return PP_OK;
}
get_picture_callback_ = callback;
- get_picture_ = picture;
+
return PP_OK_COMPLETIONPENDING;
}
@@ -399,16 +411,15 @@ void VideoDecoderResource::OnPluginMsgRequestTextures(
void VideoDecoderResource::OnPluginMsgPictureReady(
const ResourceMessageReplyParams& params,
int32_t decode_id,
- uint32_t texture_id) {
- received_pictures_.push(Picture(decode_id, texture_id));
+ uint32_t texture_id,
+ const PP_Rect& visible_rect) {
+ received_pictures_.push(Picture(decode_id, texture_id, visible_rect));
if (TrackedCallback::IsPending(get_picture_callback_)) {
// The plugin may call GetPicture in its callback.
scoped_refptr<TrackedCallback> callback;
callback.swap(get_picture_callback_);
- PP_VideoPicture* picture = get_picture_;
- get_picture_ = NULL;
- WriteNextPicture(picture);
+ WriteNextPicture();
callback->Run(PP_OK);
}
}
@@ -510,20 +521,41 @@ void VideoDecoderResource::DeleteGLTexture(uint32_t id) {
}
}
-void VideoDecoderResource::WriteNextPicture(PP_VideoPicture* pp_picture) {
+void VideoDecoderResource::WriteNextPicture() {
DCHECK(!received_pictures_.empty());
Picture& picture = received_pictures_.front();
+
// Internally, we identify decodes by a unique id, which the host returns
// to us in the picture. Use this to get the plugin's decode_id.
- pp_picture->decode_id = decode_ids_[picture.decode_id % kMaximumPictureDelay];
- pp_picture->texture_id = picture.texture_id;
+ uint32_t decode_id = decode_ids_[picture.decode_id % kMaximumPictureDelay];
+ uint32_t texture_id = picture.texture_id;
+ uint32_t texture_target = 0;
+ PP_Size texture_size = PP_MakeSize(0, 0);
TextureMap::iterator it = textures_.find(picture.texture_id);
if (it != textures_.end()) {
- pp_picture->texture_target = it->second.texture_target;
- pp_picture->texture_size = it->second.size;
+ texture_target = it->second.texture_target;
+ texture_size = it->second.size;
} else {
NOTREACHED();
}
+
+ if (get_picture_) {
+ DCHECK(!get_picture_0_1_);
+ get_picture_->decode_id = decode_id;
+ get_picture_->texture_id = texture_id;
+ get_picture_->texture_target = texture_target;
+ get_picture_->texture_size = texture_size;
+ get_picture_->visible_rect = picture.visible_rect;
+ get_picture_ = NULL;
+ } else {
+ DCHECK(get_picture_0_1_);
+ get_picture_0_1_->decode_id = decode_id;
+ get_picture_0_1_->texture_id = texture_id;
+ get_picture_0_1_->texture_target = texture_target;
+ get_picture_0_1_->texture_size = texture_size;
+ get_picture_0_1_ = NULL;
+ }
+
received_pictures_.pop();
}
diff --git a/ppapi/proxy/video_decoder_resource.h b/ppapi/proxy/video_decoder_resource.h
index 2e4ea6d..bcc8906 100644
--- a/ppapi/proxy/video_decoder_resource.h
+++ b/ppapi/proxy/video_decoder_resource.h
@@ -56,6 +56,9 @@ class PPAPI_PROXY_EXPORT VideoDecoderResource
uint32_t size,
const void* buffer,
scoped_refptr<TrackedCallback> callback) override;
+ virtual int32_t GetPicture0_1(
+ PP_VideoPicture_0_1* picture,
+ scoped_refptr<TrackedCallback> callback) override;
virtual int32_t GetPicture(PP_VideoPicture* picture,
scoped_refptr<TrackedCallback> callback) override;
virtual void RecyclePicture(const PP_VideoPicture* picture) override;
@@ -96,19 +99,16 @@ class PPAPI_PROXY_EXPORT VideoDecoderResource
// Struct to hold a picture received from the decoder.
struct Picture {
- Picture(int32_t decode_id, uint32_t texture_id);
+ Picture(int32_t decode_id,
+ uint32_t texture_id,
+ const PP_Rect& visible_rect);
~Picture();
int32_t decode_id;
uint32_t texture_id;
+ PP_Rect visible_rect;
};
- int32_t InitializeInternal(PP_Resource graphics_context,
- PP_VideoProfile profile,
- PP_Bool allow_software_fallback,
- scoped_refptr<TrackedCallback> callback,
- bool testing);
-
// Unsolicited reply message handlers.
void OnPluginMsgRequestTextures(const ResourceMessageReplyParams& params,
uint32_t num_textures,
@@ -117,7 +117,8 @@ class PPAPI_PROXY_EXPORT VideoDecoderResource
const std::vector<gpu::Mailbox>& mailboxes);
void OnPluginMsgPictureReady(const ResourceMessageReplyParams& params,
int32_t decode_id,
- uint32_t texture_id);
+ uint32_t texture_id,
+ const PP_Rect& visible_rect);
void OnPluginMsgDismissPicture(const ResourceMessageReplyParams& params,
uint32_t texture_id);
void OnPluginMsgNotifyError(const ResourceMessageReplyParams& params,
@@ -132,7 +133,7 @@ class PPAPI_PROXY_EXPORT VideoDecoderResource
void RunCallbackWithError(scoped_refptr<TrackedCallback>* callback);
void DeleteGLTexture(uint32_t texture_id);
- void WriteNextPicture(PP_VideoPicture* picture);
+ void WriteNextPicture();
// ScopedVector to own the shared memory buffers.
ScopedVector<ShmBuffer> shm_buffers_;
@@ -169,6 +170,7 @@ class PPAPI_PROXY_EXPORT VideoDecoderResource
// State for pending get_picture_callback_.
PP_VideoPicture* get_picture_;
+ PP_VideoPicture_0_1* get_picture_0_1_;
ScopedPPResource graphics3d_;
gpu::gles2::GLES2Implementation* gles2_impl_;
diff --git a/ppapi/proxy/video_decoder_resource_unittest.cc b/ppapi/proxy/video_decoder_resource_unittest.cc
index fa6e89f..7716940 100644
--- a/ppapi/proxy/video_decoder_resource_unittest.cc
+++ b/ppapi/proxy/video_decoder_resource_unittest.cc
@@ -58,9 +58,9 @@ class MockCompletionCallback {
class VideoDecoderResourceTest : public PluginProxyTest {
public:
VideoDecoderResourceTest()
- : decoder_iface_(thunk::GetPPB_VideoDecoder_0_2_Thunk()) {}
+ : decoder_iface_(thunk::GetPPB_VideoDecoder_1_0_Thunk()) {}
- const PPB_VideoDecoder_0_2* decoder_iface() const { return decoder_iface_; }
+ const PPB_VideoDecoder_1_0* decoder_iface() const { return decoder_iface_; }
void SendReply(const ResourceMessageCallParams& params,
int32_t result,
@@ -217,10 +217,9 @@ class VideoDecoderResourceTest : public PluginProxyTest {
void SendPictureReady(const ResourceMessageCallParams& params,
uint32_t decode_count,
uint32_t texture_id) {
- SendReply(
- params,
- PP_OK,
- PpapiPluginMsg_VideoDecoder_PictureReady(decode_count, texture_id));
+ PP_Rect visible_rect = PP_MakeRectFromXYWH(0, 0, 640, 480);
+ SendReply(params, PP_OK, PpapiPluginMsg_VideoDecoder_PictureReady(
+ decode_count, texture_id, visible_rect));
}
void SendFlushReply(const ResourceMessageCallParams& params) {
@@ -298,7 +297,7 @@ class VideoDecoderResourceTest : public PluginProxyTest {
return true;
}
- const PPB_VideoDecoder_0_2* decoder_iface_;
+ const PPB_VideoDecoder_1_0* decoder_iface_;
char decode_buffer_[kDecodeBufferSize];
};
diff --git a/ppapi/thunk/interfaces_ppb_public_stable.h b/ppapi/thunk/interfaces_ppb_public_stable.h
index c26fb8b..a95d505 100644
--- a/ppapi/thunk/interfaces_ppb_public_stable.h
+++ b/ppapi/thunk/interfaces_ppb_public_stable.h
@@ -94,6 +94,7 @@ PROXIED_IFACE(PPB_URLREQUESTINFO_INTERFACE_1_0, PPB_URLRequestInfo_1_0)
PROXIED_IFACE(PPB_URLRESPONSEINFO_INTERFACE_1_0, PPB_URLResponseInfo_1_0)
PROXIED_IFACE(PPB_VAR_ARRAY_INTERFACE_1_0, PPB_VarArray_1_0)
PROXIED_IFACE(PPB_VAR_DICTIONARY_INTERFACE_1_0, PPB_VarDictionary_1_0)
+PROXIED_IFACE(PPB_VIDEODECODER_INTERFACE_1_0, PPB_VideoDecoder_1_0)
PROXIED_IFACE(PPB_VIDEODECODER_INTERFACE_0_2, PPB_VideoDecoder_0_2)
PROXIED_IFACE(PPB_VIDEOFRAME_INTERFACE_0_1, PPB_VideoFrame_0_1)
PROXIED_IFACE(PPB_WEBSOCKET_INTERFACE_1_0, PPB_WebSocket_1_0)
diff --git a/ppapi/thunk/ppb_video_decoder_api.h b/ppapi/thunk/ppb_video_decoder_api.h
index 40bd99c..5acceaa 100644
--- a/ppapi/thunk/ppb_video_decoder_api.h
+++ b/ppapi/thunk/ppb_video_decoder_api.h
@@ -31,6 +31,8 @@ class PPAPI_THUNK_EXPORT PPB_VideoDecoder_API {
uint32_t size,
const void* buffer,
scoped_refptr<TrackedCallback> callback) = 0;
+ virtual int32_t GetPicture0_1(PP_VideoPicture_0_1* picture,
+ scoped_refptr<TrackedCallback> callback) = 0;
virtual int32_t GetPicture(PP_VideoPicture* picture,
scoped_refptr<TrackedCallback> callback) = 0;
virtual void RecyclePicture(const PP_VideoPicture* picture) = 0;
diff --git a/ppapi/thunk/ppb_video_decoder_thunk.cc b/ppapi/thunk/ppb_video_decoder_thunk.cc
index 8219fdf..c2e4c7e 100644
--- a/ppapi/thunk/ppb_video_decoder_thunk.cc
+++ b/ppapi/thunk/ppb_video_decoder_thunk.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// From ppb_video_decoder.idl modified Mon Sep 8 16:40:15 2014.
+// From ppb_video_decoder.idl modified Wed Nov 5 13:39:36 2014.
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
@@ -76,6 +76,17 @@ int32_t Decode(PP_Resource video_decoder,
enter.callback()));
}
+int32_t GetPicture_0_1(PP_Resource video_decoder,
+ struct PP_VideoPicture_0_1* picture,
+ struct PP_CompletionCallback callback) {
+ VLOG(4) << "PPB_VideoDecoder::GetPicture()";
+ EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true);
+ if (enter.failed())
+ return enter.retval();
+ return enter.SetResult(
+ enter.object()->GetPicture0_1(picture, enter.callback()));
+}
+
int32_t GetPicture(PP_Resource video_decoder,
struct PP_VideoPicture* picture,
struct PP_CompletionCallback callback) {
@@ -113,27 +124,32 @@ int32_t Reset(PP_Resource video_decoder,
return enter.SetResult(enter.object()->Reset(enter.callback()));
}
-const PPB_VideoDecoder_0_1 g_ppb_videodecoder_thunk_0_1 = {
- &Create,
- &IsVideoDecoder,
- &Initialize_0_1,
- &Decode,
- &GetPicture,
- &RecyclePicture,
- &Flush,
- &Reset
-};
-
-const PPB_VideoDecoder_0_2 g_ppb_videodecoder_thunk_0_2 = {
- &Create,
- &IsVideoDecoder,
- &Initialize,
- &Decode,
- &GetPicture,
- &RecyclePicture,
- &Flush,
- &Reset
-};
+const PPB_VideoDecoder_0_1 g_ppb_videodecoder_thunk_0_1 = {&Create,
+ &IsVideoDecoder,
+ &Initialize_0_1,
+ &Decode,
+ &GetPicture_0_1,
+ &RecyclePicture,
+ &Flush,
+ &Reset};
+
+const PPB_VideoDecoder_0_2 g_ppb_videodecoder_thunk_0_2 = {&Create,
+ &IsVideoDecoder,
+ &Initialize,
+ &Decode,
+ &GetPicture_0_1,
+ &RecyclePicture,
+ &Flush,
+ &Reset};
+
+const PPB_VideoDecoder_1_0 g_ppb_videodecoder_thunk_1_0 = {&Create,
+ &IsVideoDecoder,
+ &Initialize,
+ &Decode,
+ &GetPicture,
+ &RecyclePicture,
+ &Flush,
+ &Reset};
} // namespace
@@ -147,5 +163,9 @@ PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_2*
return &g_ppb_videodecoder_thunk_0_2;
}
+PPAPI_THUNK_EXPORT const PPB_VideoDecoder_1_0* GetPPB_VideoDecoder_1_0_Thunk() {
+ return &g_ppb_videodecoder_thunk_1_0;
+}
+
} // namespace thunk
} // namespace ppapi
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 89758e5..aead1b0 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -51024,6 +51024,7 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="588532407" label="PPB_Graphics2D;1.1"/>
<int value="612625164" label="PPB_InputEvent;1.0"/>
<int value="615811055" label="PPB_Flash_MessageLoop;0.1"/>
+ <int value="617438958" label="PPB_VideoDecoder;1.0"/>
<int value="629092173" label="PPB_VideoCapture(Dev);0.3"/>
<int value="630100238" label="PPB_AudioBuffer;0.1"/>
<int value="631212065" label="PPB_MouseInputEvent;1.0"/>
@@ -51056,6 +51057,7 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="930528031" label="PPB_OpenGLES2DrawBuffers(Dev);1.0"/>
<int value="930786862" label="PPB_Flash_Clipboard;5.0"/>
<int value="941275733" label="PPB_Flash;12.6"/>
+ <int value="943174056" label="PPB_VideoDecoder;0.2"/>
<int value="944161065" label="PPB_Flash_DRM;1.1"/>
<int value="946515854" label="PPB_View(Dev);0.1"/>
<int value="948969343" label="PPB_OpenGLES2;1.0"/>