summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/renderer/pepper/pepper_video_encoder_host.cc31
-rw-r--r--ppapi/api/pp_codecs.idl32
-rw-r--r--ppapi/api/ppb_video_encoder.idl22
-rw-r--r--ppapi/c/pp_codecs.h29
-rw-r--r--ppapi/c/ppb_video_encoder.h40
-rw-r--r--ppapi/cpp/video_encoder.cc116
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c87
-rw-r--r--ppapi/proxy/ppapi_messages.h2
-rw-r--r--ppapi/proxy/video_encoder_resource.cc48
-rw-r--r--ppapi/proxy/video_encoder_resource.h4
-rw-r--r--ppapi/proxy/video_encoder_resource_unittest.cc71
-rw-r--r--ppapi/thunk/interfaces_ppb_public_dev_channel.h1
-rw-r--r--ppapi/thunk/ppb_video_encoder_api.h3
-rw-r--r--ppapi/thunk/ppb_video_encoder_thunk.cc40
14 files changed, 480 insertions, 46 deletions
diff --git a/content/renderer/pepper/pepper_video_encoder_host.cc b/content/renderer/pepper/pepper_video_encoder_host.cc
index 7c0b9fd..732cf74 100644
--- a/content/renderer/pepper/pepper_video_encoder_host.cc
+++ b/content/renderer/pepper/pepper_video_encoder_host.cc
@@ -145,29 +145,25 @@ PP_VideoFrame_Format PP_FromMediaVideoFormat(media::VideoFrame::Format format) {
PP_VideoProfileDescription PP_FromVideoEncodeAcceleratorSupportedProfile(
media::VideoEncodeAccelerator::SupportedProfile profile,
- PP_HardwareAcceleration acceleration) {
+ PP_Bool hardware_accelerated) {
PP_VideoProfileDescription pp_profile;
pp_profile.profile = PP_FromMediaVideoProfile(profile.profile);
pp_profile.max_resolution = PP_FromGfxSize(profile.max_resolution);
pp_profile.max_framerate_numerator = profile.max_framerate_numerator;
pp_profile.max_framerate_denominator = profile.max_framerate_denominator;
- pp_profile.acceleration = acceleration;
+ pp_profile.hardware_accelerated = hardware_accelerated;
return pp_profile;
}
-bool PP_HardwareAccelerationCompatible(PP_HardwareAcceleration supply,
- PP_HardwareAcceleration demand) {
- // TODO(llandwerlin): Change API to use bool instead of
- // PP_HardwareAcceleration
- switch (supply) {
+bool PP_HardwareAccelerationCompatible(bool accelerated,
+ PP_HardwareAcceleration requested) {
+ switch (requested) {
case PP_HARDWAREACCELERATION_ONLY:
- return (demand == PP_HARDWAREACCELERATION_ONLY ||
- demand == PP_HARDWAREACCELERATION_WITHFALLBACK);
+ return accelerated;
+ case PP_HARDWAREACCELERATION_NONE:
+ return !accelerated;
case PP_HARDWAREACCELERATION_WITHFALLBACK:
return true;
- case PP_HARDWAREACCELERATION_NONE:
- return (demand == PP_HARDWAREACCELERATION_WITHFALLBACK ||
- demand == PP_HARDWAREACCELERATION_NONE);
// No default case, to catch unhandled PP_HardwareAcceleration values.
}
return false;
@@ -456,8 +452,8 @@ void PepperVideoEncoderHost::GetSupportedProfiles(
profiles = GpuVideoAcceleratorUtil::ConvertGpuToMediaEncodeProfiles(
channel_->gpu_info().video_encode_accelerator_supported_profiles);
for (media::VideoEncodeAccelerator::SupportedProfile profile : profiles) {
- pp_profiles->push_back(PP_FromVideoEncodeAcceleratorSupportedProfile(
- profile, PP_HARDWAREACCELERATION_ONLY));
+ pp_profiles->push_back(
+ PP_FromVideoEncodeAcceleratorSupportedProfile(profile, PP_TRUE));
}
}
@@ -465,8 +461,8 @@ void PepperVideoEncoderHost::GetSupportedProfiles(
VideoEncoderShim software_encoder(this);
profiles = software_encoder.GetSupportedProfiles();
for (media::VideoEncodeAccelerator::SupportedProfile profile : profiles) {
- pp_profiles->push_back(PP_FromVideoEncodeAcceleratorSupportedProfile(
- profile, PP_HARDWAREACCELERATION_NONE));
+ pp_profiles->push_back(
+ PP_FromVideoEncodeAcceleratorSupportedProfile(profile, PP_FALSE));
}
#endif
}
@@ -484,7 +480,8 @@ bool PepperVideoEncoderHost::IsInitializationValid(
if (output_profile == profile.profile &&
input_size.width <= profile.max_resolution.width &&
input_size.height <= profile.max_resolution.height &&
- PP_HardwareAccelerationCompatible(profile.acceleration, acceleration))
+ PP_HardwareAccelerationCompatible(
+ profile.hardware_accelerated == PP_TRUE, acceleration))
return true;
}
diff --git a/ppapi/api/pp_codecs.idl b/ppapi/api/pp_codecs.idl
index 3a20e98..89642a9 100644
--- a/ppapi/api/pp_codecs.idl
+++ b/ppapi/api/pp_codecs.idl
@@ -142,6 +142,37 @@ struct PP_VideoProfileDescription {
uint32_t max_framerate_denominator;
/**
+ * Whether the profile is hardware accelerated.
+ */
+ PP_Bool hardware_accelerated;
+};
+
+/**
+ * Supported video profile information. See the PPB_VideoEncoder function
+ * GetSupportedProfiles() for more details.
+ */
+struct PP_VideoProfileDescription_0_1 {
+ /**
+ * The codec profile.
+ */
+ PP_VideoProfile profile;
+
+ /**
+ * Dimensions of the maximum resolution of video frames, in pixels.
+ */
+ PP_Size max_resolution;
+
+ /**
+ * The numerator of the maximum frame rate.
+ */
+ uint32_t max_framerate_numerator;
+
+ /**
+ * The denominator of the maximum frame rate.
+ */
+ uint32_t max_framerate_denominator;
+
+ /**
* A value indicating if the profile is available in hardware, software, or
* both.
*/
@@ -167,4 +198,3 @@ struct PP_BitstreamBuffer {
*/
PP_Bool key_frame;
};
-
diff --git a/ppapi/api/ppb_video_encoder.idl b/ppapi/api/ppb_video_encoder.idl
index 78b6e60..68a7f6d 100644
--- a/ppapi/api/ppb_video_encoder.idl
+++ b/ppapi/api/ppb_video_encoder.idl
@@ -10,7 +10,8 @@
[generate_thunk]
label Chrome {
- [channel=dev] M42 = 0.1
+ [channel=dev] M42 = 0.1,
+ [channel=dev] M44 = 0.2
};
/**
@@ -66,6 +67,24 @@ interface PPB_VideoEncoder {
* @param[in] video_encoder A <code>PP_Resource</code> identifying the video
* encoder.
* @param[in] output A <code>PP_ArrayOutput</code> to receive the supported
+ * <code>PP_VideoProfileDescription_0_1</code> structs.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
+ * completion.
+ *
+ * @return If >= 0, the number of supported profiles returned, otherwise an
+ * error code from <code>pp_errors.h</code>.
+ */
+ int32_t GetSupportedProfiles([in] PP_Resource video_encoder,
+ [in] PP_ArrayOutput output,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Gets an array of supported video encoder profiles.
+ * These can be used to choose a profile before calling Initialize().
+ *
+ * @param[in] video_encoder A <code>PP_Resource</code> identifying the video
+ * encoder.
+ * @param[in] output A <code>PP_ArrayOutput</code> to receive the supported
* <code>PP_VideoProfileDescription</code> structs.
* @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
* completion.
@@ -73,6 +92,7 @@ interface PPB_VideoEncoder {
* @return If >= 0, the number of supported profiles returned, otherwise an
* error code from <code>pp_errors.h</code>.
*/
+ [version = 0.2]
int32_t GetSupportedProfiles([in] PP_Resource video_encoder,
[in] PP_ArrayOutput output,
[in] PP_CompletionCallback callback);
diff --git a/ppapi/c/pp_codecs.h b/ppapi/c/pp_codecs.h
index 9f32a72..173f9f4 100644
--- a/ppapi/c/pp_codecs.h
+++ b/ppapi/c/pp_codecs.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From pp_codecs.idl modified Wed Feb 4 05:24:21 2015. */
+/* From pp_codecs.idl modified Fri Apr 17 10:55:27 2015. */
#ifndef PPAPI_C_PP_CODECS_H_
#define PPAPI_C_PP_CODECS_H_
@@ -154,6 +154,33 @@ struct PP_VideoProfileDescription {
*/
uint32_t max_framerate_denominator;
/**
+ * Whether the profile is hardware accelerated.
+ */
+ PP_Bool hardware_accelerated;
+};
+
+/**
+ * Supported video profile information. See the PPB_VideoEncoder function
+ * GetSupportedProfiles() for more details.
+ */
+struct PP_VideoProfileDescription_0_1 {
+ /**
+ * The codec profile.
+ */
+ PP_VideoProfile profile;
+ /**
+ * Dimensions of the maximum resolution of video frames, in pixels.
+ */
+ struct PP_Size max_resolution;
+ /**
+ * The numerator of the maximum frame rate.
+ */
+ uint32_t max_framerate_numerator;
+ /**
+ * The denominator of the maximum frame rate.
+ */
+ uint32_t max_framerate_denominator;
+ /**
* A value indicating if the profile is available in hardware, software, or
* both.
*/
diff --git a/ppapi/c/ppb_video_encoder.h b/ppapi/c/ppb_video_encoder.h
index 3b435cb..0b3ceb0 100644
--- a/ppapi/c/ppb_video_encoder.h
+++ b/ppapi/c/ppb_video_encoder.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_video_encoder.idl modified Tue May 5 18:07:09 2015. */
+/* From ppb_video_encoder.idl modified Tue May 5 23:37:20 2015. */
#ifndef PPAPI_C_PPB_VIDEO_ENCODER_H_
#define PPAPI_C_PPB_VIDEO_ENCODER_H_
@@ -20,6 +20,7 @@
#include "ppapi/c/ppb_video_frame.h"
#define PPB_VIDEOENCODER_INTERFACE_0_1 "PPB_VideoEncoder;0.1" /* dev */
+#define PPB_VIDEOENCODER_INTERFACE_0_2 "PPB_VideoEncoder;0.2" /* dev */
/**
* @file
* This file defines the <code>PPB_VideoEncoder</code> interface.
@@ -53,7 +54,7 @@
* All: vp8 (software).
* ChromeOS, depending on your device: h264 (hardware), vp8 (hardware)
*/
-struct PPB_VideoEncoder_0_1 { /* dev */
+struct PPB_VideoEncoder_0_2 { /* dev */
/**
* Creates a new video encoder resource.
*
@@ -234,6 +235,41 @@ struct PPB_VideoEncoder_0_1 { /* dev */
*/
void (*Close)(PP_Resource video_encoder);
};
+
+struct PPB_VideoEncoder_0_1 { /* dev */
+ PP_Resource (*Create)(PP_Instance instance);
+ PP_Bool (*IsVideoEncoder)(PP_Resource resource);
+ int32_t (*GetSupportedProfiles)(PP_Resource video_encoder,
+ struct PP_ArrayOutput output,
+ struct PP_CompletionCallback callback);
+ int32_t (*Initialize)(PP_Resource video_encoder,
+ PP_VideoFrame_Format input_format,
+ const struct PP_Size* input_visible_size,
+ PP_VideoProfile output_profile,
+ uint32_t initial_bitrate,
+ PP_HardwareAcceleration acceleration,
+ struct PP_CompletionCallback callback);
+ int32_t (*GetFramesRequired)(PP_Resource video_encoder);
+ int32_t (*GetFrameCodedSize)(PP_Resource video_encoder,
+ struct PP_Size* coded_size);
+ int32_t (*GetVideoFrame)(PP_Resource video_encoder,
+ PP_Resource* video_frame,
+ struct PP_CompletionCallback callback);
+ int32_t (*Encode)(PP_Resource video_encoder,
+ PP_Resource video_frame,
+ PP_Bool force_keyframe,
+ struct PP_CompletionCallback callback);
+ int32_t (*GetBitstreamBuffer)(PP_Resource video_encoder,
+ struct PP_BitstreamBuffer* bitstream_buffer,
+ struct PP_CompletionCallback callback);
+ void (*RecycleBitstreamBuffer)(
+ PP_Resource video_encoder,
+ const struct PP_BitstreamBuffer* bitstream_buffer);
+ void (*RequestEncodingParametersChange)(PP_Resource video_encoder,
+ uint32_t bitrate,
+ uint32_t framerate);
+ void (*Close)(PP_Resource video_encoder);
+};
/**
* @}
*/
diff --git a/ppapi/cpp/video_encoder.cc b/ppapi/cpp/video_encoder.cc
index a8c03f2..969fc1f 100644
--- a/ppapi/cpp/video_encoder.cc
+++ b/ppapi/cpp/video_encoder.cc
@@ -20,13 +20,69 @@ const char* interface_name<PPB_VideoEncoder_0_1>() {
return PPB_VIDEOENCODER_INTERFACE_0_1;
}
+template <>
+const char* interface_name<PPB_VideoEncoder_0_2>() {
+ return PPB_VIDEOENCODER_INTERFACE_0_2;
+}
+
+// This struct is used to adapt
+// CompletionCallbackWithOutput<std::vector<PP_VideoProfileDescription>>
+// to the pre-0.2 APIs, which return PP_VideoProfileDescription_0_1.
+// This struct is allocated on the heap, and deleted in
+// CallbackProfileDescriptionConverter.
+struct CallbackProfileDescription_0_1 {
+ explicit CallbackProfileDescription_0_1(const CompletionCallbackWithOutput<
+ std::vector<PP_VideoProfileDescription> >& cc)
+ : output_profiles(&profiles),
+ original_output_profiles(cc.output()),
+ original_callback(cc.pp_completion_callback()) {}
+ std::vector<PP_VideoProfileDescription_0_1> profiles;
+ ArrayOutputAdapter<PP_VideoProfileDescription_0_1> output_profiles;
+ PP_ArrayOutput original_output_profiles;
+ PP_CompletionCallback original_callback;
+};
+
+// Converts data from a 0.1 style callback to 0.2 callback.
+void CallbackProfileDescriptionConverter(void* user_data, int32_t result) {
+ CallbackProfileDescription_0_1* data =
+ static_cast<CallbackProfileDescription_0_1*>(user_data);
+ if (result >= 0) {
+ PP_VideoProfileDescription* original_profiles =
+ static_cast<PP_VideoProfileDescription*>(
+ data->original_output_profiles.GetDataBuffer(
+ data->original_output_profiles.user_data,
+ static_cast<uint32_t>(data->profiles.size()),
+ static_cast<uint32_t>(sizeof(PP_VideoProfileDescription))));
+
+ for (size_t i = 0; i < data->profiles.size(); i++) {
+ const PP_VideoProfileDescription_0_1& profile = data->profiles[i];
+
+ original_profiles[i].profile = profile.profile;
+ original_profiles[i].max_resolution = profile.max_resolution;
+ original_profiles[i].max_framerate_numerator =
+ profile.max_framerate_numerator;
+ original_profiles[i].max_framerate_denominator =
+ profile.max_framerate_denominator;
+ original_profiles[i].hardware_accelerated =
+ PP_FromBool(profile.acceleration == PP_HARDWAREACCELERATION_ONLY);
+ }
+ }
+
+ // Now execute the original callback.
+ PP_RunCompletionCallback(&data->original_callback, result);
+ delete data;
+}
+
} // namespace
VideoEncoder::VideoEncoder() {
}
VideoEncoder::VideoEncoder(const InstanceHandle& instance) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ PassRefFromConstructor(
+ get_interface<PPB_VideoEncoder_0_2>()->Create(instance.pp_instance()));
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
PassRefFromConstructor(
get_interface<PPB_VideoEncoder_0_1>()->Create(instance.pp_instance()));
}
@@ -37,9 +93,16 @@ VideoEncoder::VideoEncoder(const VideoEncoder& other) : Resource(other) {
int32_t VideoEncoder::GetSupportedProfiles(const CompletionCallbackWithOutput<
std::vector<PP_VideoProfileDescription> >& cc) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
- return get_interface<PPB_VideoEncoder_0_1>()->GetSupportedProfiles(
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ return get_interface<PPB_VideoEncoder_0_2>()->GetSupportedProfiles(
pp_resource(), cc.output(), cc.pp_completion_callback());
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
+ // Data for our callback wrapper. The callback handler will delete it.
+ CallbackProfileDescription_0_1* data =
+ new CallbackProfileDescription_0_1(cc);
+ return get_interface<PPB_VideoEncoder_0_1>()->GetSupportedProfiles(
+ pp_resource(), data->output_profiles.pp_array_output(),
+ PP_MakeCompletionCallback(&CallbackProfileDescriptionConverter, data));
}
return cc.MayForce(PP_ERROR_NOINTERFACE);
}
@@ -50,7 +113,12 @@ int32_t VideoEncoder::Initialize(const PP_VideoFrame_Format& input_format,
const uint32_t initial_bitrate,
PP_HardwareAcceleration acceleration,
const CompletionCallback& cc) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ return get_interface<PPB_VideoEncoder_0_2>()->Initialize(
+ pp_resource(), input_format, &input_visible_size.pp_size(),
+ output_profile, initial_bitrate, acceleration,
+ cc.pp_completion_callback());
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
return get_interface<PPB_VideoEncoder_0_1>()->Initialize(
pp_resource(), input_format, &input_visible_size.pp_size(),
output_profile, initial_bitrate, acceleration,
@@ -60,7 +128,10 @@ int32_t VideoEncoder::Initialize(const PP_VideoFrame_Format& input_format,
}
int32_t VideoEncoder::GetFramesRequired() {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ return get_interface<PPB_VideoEncoder_0_2>()->GetFramesRequired(
+ pp_resource());
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
return get_interface<PPB_VideoEncoder_0_1>()->GetFramesRequired(
pp_resource());
}
@@ -68,7 +139,10 @@ int32_t VideoEncoder::GetFramesRequired() {
}
int32_t VideoEncoder::GetFrameCodedSize(Size* coded_size) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ return get_interface<PPB_VideoEncoder_0_2>()->GetFrameCodedSize(
+ pp_resource(), &coded_size->pp_size());
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
return get_interface<PPB_VideoEncoder_0_1>()->GetFrameCodedSize(
pp_resource(), &coded_size->pp_size());
}
@@ -77,7 +151,10 @@ int32_t VideoEncoder::GetFrameCodedSize(Size* coded_size) {
int32_t VideoEncoder::GetVideoFrame(
const CompletionCallbackWithOutput<VideoFrame>& cc) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ return get_interface<PPB_VideoEncoder_0_2>()->GetVideoFrame(
+ pp_resource(), cc.output(), cc.pp_completion_callback());
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
return get_interface<PPB_VideoEncoder_0_1>()->GetVideoFrame(
pp_resource(), cc.output(), cc.pp_completion_callback());
}
@@ -87,7 +164,11 @@ int32_t VideoEncoder::GetVideoFrame(
int32_t VideoEncoder::Encode(const VideoFrame& video_frame,
bool force_keyframe,
const CompletionCallback& cc) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ return get_interface<PPB_VideoEncoder_0_2>()->Encode(
+ pp_resource(), video_frame.pp_resource(), PP_FromBool(force_keyframe),
+ cc.pp_completion_callback());
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
return get_interface<PPB_VideoEncoder_0_1>()->Encode(
pp_resource(), video_frame.pp_resource(), PP_FromBool(force_keyframe),
cc.pp_completion_callback());
@@ -97,7 +178,10 @@ int32_t VideoEncoder::Encode(const VideoFrame& video_frame,
int32_t VideoEncoder::GetBitstreamBuffer(
const CompletionCallbackWithOutput<PP_BitstreamBuffer>& cc) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ return get_interface<PPB_VideoEncoder_0_2>()->GetBitstreamBuffer(
+ pp_resource(), cc.output(), cc.pp_completion_callback());
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
return get_interface<PPB_VideoEncoder_0_1>()->GetBitstreamBuffer(
pp_resource(), cc.output(), cc.pp_completion_callback());
}
@@ -106,7 +190,10 @@ int32_t VideoEncoder::GetBitstreamBuffer(
void VideoEncoder::RecycleBitstreamBuffer(
const PP_BitstreamBuffer& bitstream_buffer) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ get_interface<PPB_VideoEncoder_0_2>()->RecycleBitstreamBuffer(
+ pp_resource(), &bitstream_buffer);
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
get_interface<PPB_VideoEncoder_0_1>()->RecycleBitstreamBuffer(
pp_resource(), &bitstream_buffer);
}
@@ -114,14 +201,19 @@ void VideoEncoder::RecycleBitstreamBuffer(
void VideoEncoder::RequestEncodingParametersChange(uint32_t bitrate,
uint32_t framerate) {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ get_interface<PPB_VideoEncoder_0_2>()->RequestEncodingParametersChange(
+ pp_resource(), bitrate, framerate);
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
get_interface<PPB_VideoEncoder_0_1>()->RequestEncodingParametersChange(
pp_resource(), bitrate, framerate);
}
}
void VideoEncoder::Close() {
- if (has_interface<PPB_VideoEncoder_0_1>()) {
+ if (has_interface<PPB_VideoEncoder_0_2>()) {
+ get_interface<PPB_VideoEncoder_0_2>()->Close(pp_resource());
+ } else if (has_interface<PPB_VideoEncoder_0_1>()) {
get_interface<PPB_VideoEncoder_0_1>()->Close(pp_resource());
}
}
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 c68dd43..9b73b94f 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
@@ -147,6 +147,7 @@ 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_VideoEncoder_0_1;
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoEncoder_0_2;
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;
@@ -2281,6 +2282,70 @@ static void Pnacl_M42_PPB_VideoEncoder_Close(PP_Resource video_encoder) {
/* End wrapper methods for PPB_VideoEncoder_0_1 */
+/* Begin wrapper methods for PPB_VideoEncoder_0_2 */
+
+static PP_Resource Pnacl_M44_PPB_VideoEncoder_Create(PP_Instance instance) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->Create(instance);
+}
+
+static PP_Bool Pnacl_M44_PPB_VideoEncoder_IsVideoEncoder(PP_Resource resource) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->IsVideoEncoder(resource);
+}
+
+static int32_t Pnacl_M44_PPB_VideoEncoder_GetSupportedProfiles(PP_Resource video_encoder, struct PP_ArrayOutput* output, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->GetSupportedProfiles(video_encoder, *output, *callback);
+}
+
+static int32_t Pnacl_M44_PPB_VideoEncoder_Initialize(PP_Resource video_encoder, PP_VideoFrame_Format input_format, const struct PP_Size* input_visible_size, PP_VideoProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->Initialize(video_encoder, input_format, input_visible_size, output_profile, initial_bitrate, acceleration, *callback);
+}
+
+static int32_t Pnacl_M44_PPB_VideoEncoder_GetFramesRequired(PP_Resource video_encoder) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->GetFramesRequired(video_encoder);
+}
+
+static int32_t Pnacl_M44_PPB_VideoEncoder_GetFrameCodedSize(PP_Resource video_encoder, struct PP_Size* coded_size) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->GetFrameCodedSize(video_encoder, coded_size);
+}
+
+static int32_t Pnacl_M44_PPB_VideoEncoder_GetVideoFrame(PP_Resource video_encoder, PP_Resource* video_frame, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->GetVideoFrame(video_encoder, video_frame, *callback);
+}
+
+static int32_t Pnacl_M44_PPB_VideoEncoder_Encode(PP_Resource video_encoder, PP_Resource video_frame, PP_Bool force_keyframe, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->Encode(video_encoder, video_frame, force_keyframe, *callback);
+}
+
+static int32_t Pnacl_M44_PPB_VideoEncoder_GetBitstreamBuffer(PP_Resource video_encoder, struct PP_BitstreamBuffer* bitstream_buffer, struct PP_CompletionCallback* callback) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ return iface->GetBitstreamBuffer(video_encoder, bitstream_buffer, *callback);
+}
+
+static void Pnacl_M44_PPB_VideoEncoder_RecycleBitstreamBuffer(PP_Resource video_encoder, const struct PP_BitstreamBuffer* bitstream_buffer) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ iface->RecycleBitstreamBuffer(video_encoder, bitstream_buffer);
+}
+
+static void Pnacl_M44_PPB_VideoEncoder_RequestEncodingParametersChange(PP_Resource video_encoder, uint32_t bitrate, uint32_t framerate) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ iface->RequestEncodingParametersChange(video_encoder, bitrate, framerate);
+}
+
+static void Pnacl_M44_PPB_VideoEncoder_Close(PP_Resource video_encoder) {
+ const struct PPB_VideoEncoder_0_2 *iface = Pnacl_WrapperInfo_PPB_VideoEncoder_0_2.real_iface;
+ iface->Close(video_encoder);
+}
+
+/* End wrapper methods for PPB_VideoEncoder_0_2 */
+
/* Not generating wrapper methods for PPB_VideoFrame_0_1 */
/* Not generating wrapper methods for PPB_View_1_0 */
@@ -5088,6 +5153,21 @@ static const struct PPB_VideoEncoder_0_1 Pnacl_Wrappers_PPB_VideoEncoder_0_1 = {
.Close = (void (*)(PP_Resource video_encoder))&Pnacl_M42_PPB_VideoEncoder_Close
};
+static const struct PPB_VideoEncoder_0_2 Pnacl_Wrappers_PPB_VideoEncoder_0_2 = {
+ .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M44_PPB_VideoEncoder_Create,
+ .IsVideoEncoder = (PP_Bool (*)(PP_Resource resource))&Pnacl_M44_PPB_VideoEncoder_IsVideoEncoder,
+ .GetSupportedProfiles = (int32_t (*)(PP_Resource video_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_VideoEncoder_GetSupportedProfiles,
+ .Initialize = (int32_t (*)(PP_Resource video_encoder, PP_VideoFrame_Format input_format, const struct PP_Size* input_visible_size, PP_VideoProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_VideoEncoder_Initialize,
+ .GetFramesRequired = (int32_t (*)(PP_Resource video_encoder))&Pnacl_M44_PPB_VideoEncoder_GetFramesRequired,
+ .GetFrameCodedSize = (int32_t (*)(PP_Resource video_encoder, struct PP_Size* coded_size))&Pnacl_M44_PPB_VideoEncoder_GetFrameCodedSize,
+ .GetVideoFrame = (int32_t (*)(PP_Resource video_encoder, PP_Resource* video_frame, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_VideoEncoder_GetVideoFrame,
+ .Encode = (int32_t (*)(PP_Resource video_encoder, PP_Resource video_frame, PP_Bool force_keyframe, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_VideoEncoder_Encode,
+ .GetBitstreamBuffer = (int32_t (*)(PP_Resource video_encoder, struct PP_BitstreamBuffer* bitstream_buffer, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_VideoEncoder_GetBitstreamBuffer,
+ .RecycleBitstreamBuffer = (void (*)(PP_Resource video_encoder, const struct PP_BitstreamBuffer* bitstream_buffer))&Pnacl_M44_PPB_VideoEncoder_RecycleBitstreamBuffer,
+ .RequestEncodingParametersChange = (void (*)(PP_Resource video_encoder, uint32_t bitrate, uint32_t framerate))&Pnacl_M44_PPB_VideoEncoder_RequestEncodingParametersChange,
+ .Close = (void (*)(PP_Resource video_encoder))&Pnacl_M44_PPB_VideoEncoder_Close
+};
+
/* Not generating wrapper interface for PPB_VideoFrame_0_1 */
/* Not generating wrapper interface for PPB_View_1_0 */
@@ -6058,6 +6138,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoEncoder_0_1 = {
.real_iface = NULL
};
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoEncoder_0_2 = {
+ .iface_macro = PPB_VIDEOENCODER_INTERFACE_0_2,
+ .wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_VideoEncoder_0_2,
+ .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,
@@ -6454,6 +6540,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
&Pnacl_WrapperInfo_PPB_VideoDecoder_0_2,
&Pnacl_WrapperInfo_PPB_VideoDecoder_1_0,
&Pnacl_WrapperInfo_PPB_VideoEncoder_0_1,
+ &Pnacl_WrapperInfo_PPB_VideoEncoder_0_2,
&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 a35cc49..8a2aeea 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -450,7 +450,7 @@ IPC_STRUCT_TRAITS_MEMBER(profile)
IPC_STRUCT_TRAITS_MEMBER(max_resolution)
IPC_STRUCT_TRAITS_MEMBER(max_framerate_numerator)
IPC_STRUCT_TRAITS_MEMBER(max_framerate_denominator)
-IPC_STRUCT_TRAITS_MEMBER(acceleration)
+IPC_STRUCT_TRAITS_MEMBER(hardware_accelerated)
IPC_STRUCT_TRAITS_END()
#if !defined(OS_NACL) && !defined(NACL_WIN64)
diff --git a/ppapi/proxy/video_encoder_resource.cc b/ppapi/proxy/video_encoder_resource.cc
index 5f21662..a4e5a66 100644
--- a/ppapi/proxy/video_encoder_resource.cc
+++ b/ppapi/proxy/video_encoder_resource.cc
@@ -31,6 +31,28 @@ void RunCallback(scoped_refptr<TrackedCallback>* callback, int32_t error) {
temp->Run(error);
}
+std::vector<PP_VideoProfileDescription_0_1> PP_VideoProfileDescriptionTo_0_1(
+ std::vector<PP_VideoProfileDescription> profiles) {
+ std::vector<PP_VideoProfileDescription_0_1> profiles_0_1;
+
+ for (uint32_t i = 0; i < profiles.size(); ++i) {
+ const PP_VideoProfileDescription& profile = profiles[i];
+ PP_VideoProfileDescription_0_1 profile_0_1;
+
+ profile_0_1.profile = profile.profile;
+ profile_0_1.max_resolution = profile.max_resolution;
+ profile_0_1.max_framerate_numerator = profile.max_framerate_numerator;
+ profile_0_1.max_framerate_denominator = profile.max_framerate_denominator;
+ profile_0_1.acceleration = profile.hardware_accelerated == PP_TRUE
+ ? PP_HARDWAREACCELERATION_ONLY
+ : PP_HARDWAREACCELERATION_NONE;
+
+ profiles_0_1.push_back(profile_0_1);
+ }
+
+ return profiles_0_1;
+}
+
} // namespace
VideoEncoderResource::ShmBuffer::ShmBuffer(uint32_t id,
@@ -86,7 +108,21 @@ int32_t VideoEncoderResource::GetSupportedProfiles(
Call<PpapiPluginMsg_VideoEncoder_GetSupportedProfilesReply>(
RENDERER, PpapiHostMsg_VideoEncoder_GetSupportedProfiles(),
base::Bind(&VideoEncoderResource::OnPluginMsgGetSupportedProfilesReply,
- this, output));
+ this, output, false));
+ return PP_OK_COMPLETIONPENDING;
+}
+
+int32_t VideoEncoderResource::GetSupportedProfiles0_1(
+ const PP_ArrayOutput& output,
+ const scoped_refptr<TrackedCallback>& callback) {
+ if (TrackedCallback::IsPending(get_supported_profiles_callback_))
+ return PP_ERROR_INPROGRESS;
+
+ get_supported_profiles_callback_ = callback;
+ Call<PpapiPluginMsg_VideoEncoder_GetSupportedProfilesReply>(
+ RENDERER, PpapiHostMsg_VideoEncoder_GetSupportedProfiles(),
+ base::Bind(&VideoEncoderResource::OnPluginMsgGetSupportedProfilesReply,
+ this, output, true));
return PP_OK_COMPLETIONPENDING;
}
@@ -248,6 +284,7 @@ void VideoEncoderResource::OnReplyReceived(
void VideoEncoderResource::OnPluginMsgGetSupportedProfilesReply(
const PP_ArrayOutput& output,
+ bool version0_1,
const ResourceMessageReplyParams& params,
const std::vector<PP_VideoProfileDescription>& profiles) {
int32_t error = params.result();
@@ -262,7 +299,14 @@ void VideoEncoderResource::OnPluginMsgGetSupportedProfilesReply(
return;
}
- if (!writer.StoreVector(profiles)) {
+ bool write_result;
+ if (version0_1)
+ write_result =
+ writer.StoreVector(PP_VideoProfileDescriptionTo_0_1(profiles));
+ else
+ write_result = writer.StoreVector(profiles);
+
+ if (!write_result) {
RunCallback(&get_supported_profiles_callback_, PP_ERROR_FAILED);
return;
}
diff --git a/ppapi/proxy/video_encoder_resource.h b/ppapi/proxy/video_encoder_resource.h
index 3b46759..41f33c7 100644
--- a/ppapi/proxy/video_encoder_resource.h
+++ b/ppapi/proxy/video_encoder_resource.h
@@ -64,6 +64,9 @@ class PPAPI_PROXY_EXPORT VideoEncoderResource
int32_t GetSupportedProfiles(
const PP_ArrayOutput& output,
const scoped_refptr<TrackedCallback>& callback) override;
+ int32_t GetSupportedProfiles0_1(
+ const PP_ArrayOutput& output,
+ const scoped_refptr<TrackedCallback>& callback) override;
int32_t Initialize(PP_VideoFrame_Format input_format,
const PP_Size* input_visible_size,
PP_VideoProfile output_profile,
@@ -93,6 +96,7 @@ class PPAPI_PROXY_EXPORT VideoEncoderResource
// Reply message handlers for operations that are done in the host.
void OnPluginMsgGetSupportedProfilesReply(
const PP_ArrayOutput& output,
+ bool version0_1,
const ResourceMessageReplyParams& params,
const std::vector<PP_VideoProfileDescription>& profiles);
void OnPluginMsgInitializeReply(const ResourceMessageReplyParams& params,
diff --git a/ppapi/proxy/video_encoder_resource_unittest.cc b/ppapi/proxy/video_encoder_resource_unittest.cc
index cc7ecc8..d908d73 100644
--- a/ppapi/proxy/video_encoder_resource_unittest.cc
+++ b/ppapi/proxy/video_encoder_resource_unittest.cc
@@ -58,11 +58,15 @@ class VideoEncoderResourceTest : public PluginProxyTest,
public MediaStreamBufferManager::Delegate {
public:
VideoEncoderResourceTest()
- : encoder_iface_(thunk::GetPPB_VideoEncoder_0_1_Thunk()),
+ : encoder_iface_(thunk::GetPPB_VideoEncoder_0_2_Thunk()),
+ encoder_iface_0_1_(thunk::GetPPB_VideoEncoder_0_1_Thunk()),
video_frames_manager_(this) {}
~VideoEncoderResourceTest() override {}
- const PPB_VideoEncoder_0_1* encoder_iface() const { return encoder_iface_; }
+ const PPB_VideoEncoder_0_2* encoder_iface() const { return encoder_iface_; }
+ const PPB_VideoEncoder_0_1* encoder_iface_0_1() const {
+ return encoder_iface_0_1_;
+ }
const uint32_t kBitstreamBufferSize = 4000;
const uint32_t kBitstreamBufferCount = 5;
@@ -412,7 +416,8 @@ class VideoEncoderResourceTest : public PluginProxyTest,
// MediaStreamBufferManager::Delegate:
void OnNewBufferEnqueued() override {}
- const PPB_VideoEncoder_0_1* encoder_iface_;
+ const PPB_VideoEncoder_0_2* encoder_iface_;
+ const PPB_VideoEncoder_0_1* encoder_iface_0_1_;
ScopedVector<base::SharedMemory> shared_memory_bitstreams_;
@@ -451,14 +456,14 @@ TEST_F(VideoEncoderResourceTest, GetSupportedProfiles) {
profile.max_resolution.height = 1080;
profile.max_framerate_numerator = 30;
profile.max_framerate_denominator = 1;
- profile.acceleration = PP_HARDWAREACCELERATION_ONLY;
+ profile.hardware_accelerated = PP_TRUE;
profiles_response.push_back(profile);
profile.profile = PP_VIDEOPROFILE_VP8_ANY;
profile.max_resolution.width = 1920;
profile.max_resolution.height = 1080;
profile.max_framerate_numerator = 30;
profile.max_framerate_denominator = 1;
- profile.acceleration = PP_HARDWAREACCELERATION_NONE;
+ profile.hardware_accelerated = PP_FALSE;
profiles_response.push_back(profile);
SendGetSupportedProfilesReply(params, profiles_response);
@@ -467,6 +472,62 @@ TEST_F(VideoEncoderResourceTest, GetSupportedProfiles) {
}
}
+TEST_F(VideoEncoderResourceTest, GetSupportedProfiles0_1) {
+ // Verifies that GetSupportedProfiles calls into the renderer and
+ // the we get the right results back.
+ {
+ LockingResourceReleaser encoder(CreateEncoder());
+ PP_VideoProfileDescription_0_1 profiles[2];
+ PP_ArrayOutput output;
+ output.user_data = &profiles[0];
+ output.GetDataBuffer = ForwardUserData;
+ ResourceMessageCallParams params;
+ MockCompletionCallback cb;
+ int32_t result = encoder_iface_0_1()->GetSupportedProfiles(
+ encoder.get(), output, PP_MakeOptionalCompletionCallback(
+ &MockCompletionCallback::Callback, &cb));
+ ASSERT_EQ(PP_OK_COMPLETIONPENDING, result);
+ ASSERT_TRUE(CheckGetSupportedProfilesMsg(&params));
+
+ std::vector<PP_VideoProfileDescription> profiles_response;
+ PP_VideoProfileDescription profile;
+ profile.profile = PP_VIDEOPROFILE_H264MAIN;
+ profile.max_resolution.width = 1920;
+ profile.max_resolution.height = 1080;
+ profile.max_framerate_numerator = 30;
+ profile.max_framerate_denominator = 1;
+ profile.hardware_accelerated = PP_TRUE;
+ profiles_response.push_back(profile);
+ profile.profile = PP_VIDEOPROFILE_VP8_ANY;
+ profile.max_resolution.width = 1920;
+ profile.max_resolution.height = 1080;
+ profile.max_framerate_numerator = 30;
+ profile.max_framerate_denominator = 1;
+ profile.hardware_accelerated = PP_FALSE;
+ profiles_response.push_back(profile);
+
+ SendGetSupportedProfilesReply(params, profiles_response);
+
+ ASSERT_EQ(profiles_response.size(), static_cast<uint32_t>(cb.result()));
+
+ for (uint32 i = 0; i < profiles_response.size(); i++) {
+ ASSERT_EQ(profiles_response[i].profile, profiles[i].profile);
+ ASSERT_EQ(profiles_response[i].max_resolution.width,
+ profiles[i].max_resolution.width);
+ ASSERT_EQ(profiles_response[i].max_resolution.height,
+ profiles[i].max_resolution.height);
+ ASSERT_EQ(profiles_response[i].max_framerate_numerator,
+ profiles[i].max_framerate_numerator);
+ ASSERT_EQ(profiles_response[i].max_framerate_denominator,
+ profiles[i].max_framerate_denominator);
+ if (profiles_response[i].hardware_accelerated)
+ ASSERT_EQ(PP_HARDWAREACCELERATION_ONLY, profiles[i].acceleration);
+ else
+ ASSERT_EQ(PP_HARDWAREACCELERATION_NONE, profiles[i].acceleration);
+ }
+ }
+}
+
TEST_F(VideoEncoderResourceTest, InitializeFailure) {
{
// Verify the initialize callback is called in case of failure.
diff --git a/ppapi/thunk/interfaces_ppb_public_dev_channel.h b/ppapi/thunk/interfaces_ppb_public_dev_channel.h
index 61e39b7..a832da4 100644
--- a/ppapi/thunk/interfaces_ppb_public_dev_channel.h
+++ b/ppapi/thunk/interfaces_ppb_public_dev_channel.h
@@ -14,6 +14,7 @@ PROXIED_IFACE(PPB_COMPOSITORLAYER_INTERFACE_0_2, PPB_CompositorLayer_0_2)
PROXIED_IFACE(PPB_UDPSOCKET_INTERFACE_1_2, PPB_UDPSocket_1_2)
PROXIED_IFACE(PPB_VIDEODECODER_INTERFACE_0_1, PPB_VideoDecoder_0_1)
PROXIED_IFACE(PPB_VIDEOENCODER_INTERFACE_0_1, PPB_VideoEncoder_0_1)
+PROXIED_IFACE(PPB_VIDEOENCODER_INTERFACE_0_2, PPB_VideoEncoder_0_2)
// Note, PPB_TraceEvent is special. We don't want to actually make it stable,
// but we want developers to be able to leverage it when running Chrome Dev or
diff --git a/ppapi/thunk/ppb_video_encoder_api.h b/ppapi/thunk/ppb_video_encoder_api.h
index 7050d6a..cf9b9fa 100644
--- a/ppapi/thunk/ppb_video_encoder_api.h
+++ b/ppapi/thunk/ppb_video_encoder_api.h
@@ -22,6 +22,9 @@ class PPAPI_THUNK_EXPORT PPB_VideoEncoder_API {
virtual int32_t GetSupportedProfiles(
const PP_ArrayOutput& output,
const scoped_refptr<TrackedCallback>& callback) = 0;
+ virtual int32_t GetSupportedProfiles0_1(
+ const PP_ArrayOutput& output,
+ const scoped_refptr<TrackedCallback>& callback) = 0;
virtual int32_t Initialize(
PP_VideoFrame_Format input_format,
const PP_Size* input_visible_size,
diff --git a/ppapi/thunk/ppb_video_encoder_thunk.cc b/ppapi/thunk/ppb_video_encoder_thunk.cc
index b6981e5..19d93b1 100644
--- a/ppapi/thunk/ppb_video_encoder_thunk.cc
+++ b/ppapi/thunk/ppb_video_encoder_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_encoder.idl modified Thu Feb 5 10:33:32 2015.
+// From ppb_video_encoder.idl modified Fri Apr 17 10:38:38 2015.
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
@@ -31,6 +31,17 @@ PP_Bool IsVideoEncoder(PP_Resource resource) {
return PP_FromBool(enter.succeeded());
}
+int32_t GetSupportedProfiles_0_1(PP_Resource video_encoder,
+ struct PP_ArrayOutput output,
+ struct PP_CompletionCallback callback) {
+ VLOG(4) << "PPB_VideoEncoder::GetSupportedProfiles_0_1()";
+ EnterResource<PPB_VideoEncoder_API> enter(video_encoder, callback, true);
+ if (enter.failed())
+ return enter.retval();
+ return enter.SetResult(
+ enter.object()->GetSupportedProfiles0_1(output, enter.callback()));
+}
+
int32_t GetSupportedProfiles(PP_Resource video_encoder,
struct PP_ArrayOutput output,
struct PP_CompletionCallback callback) {
@@ -53,9 +64,12 @@ int32_t Initialize(PP_Resource video_encoder,
EnterResource<PPB_VideoEncoder_API> enter(video_encoder, callback, true);
if (enter.failed())
return enter.retval();
- return enter.SetResult(enter.object()->Initialize(
- input_format, input_visible_size, output_profile, initial_bitrate,
- acceleration, enter.callback()));
+ return enter.SetResult(enter.object()->Initialize(input_format,
+ input_visible_size,
+ output_profile,
+ initial_bitrate,
+ acceleration,
+ enter.callback()));
}
int32_t GetFramesRequired(PP_Resource video_encoder) {
@@ -139,6 +153,20 @@ void Close(PP_Resource video_encoder) {
const PPB_VideoEncoder_0_1 g_ppb_videoencoder_thunk_0_1 = {
&Create,
&IsVideoEncoder,
+ &GetSupportedProfiles_0_1,
+ &Initialize,
+ &GetFramesRequired,
+ &GetFrameCodedSize,
+ &GetVideoFrame,
+ &Encode,
+ &GetBitstreamBuffer,
+ &RecycleBitstreamBuffer,
+ &RequestEncodingParametersChange,
+ &Close};
+
+const PPB_VideoEncoder_0_2 g_ppb_videoencoder_thunk_0_2 = {
+ &Create,
+ &IsVideoEncoder,
&GetSupportedProfiles,
&Initialize,
&GetFramesRequired,
@@ -156,5 +184,9 @@ PPAPI_THUNK_EXPORT const PPB_VideoEncoder_0_1* GetPPB_VideoEncoder_0_1_Thunk() {
return &g_ppb_videoencoder_thunk_0_1;
}
+PPAPI_THUNK_EXPORT const PPB_VideoEncoder_0_2* GetPPB_VideoEncoder_0_2_Thunk() {
+ return &g_ppb_videoencoder_thunk_0_2;
+}
+
} // namespace thunk
} // namespace ppapi