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

Unified Diff: ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c

Issue 1151973003: ppapi: implement PPB_AudioEncoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More Windows fixes in proxy code Created 5 years, 6 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/examples/audio_encode/audio_encode.html ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
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 7e30452cb8ac1bd6c0f0b650724247271997ad0f..777018648a370152adb2005fea236f0b9de2cc02 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
@@ -17,6 +17,7 @@
#include "ppapi/c/dev/ppb_url_util_dev.h"
#include "ppapi/c/dev/ppb_video_capture_dev.h"
#include "ppapi/c/dev/ppb_video_decoder_dev.h"
+#include "ppapi/c/ppb_audio_encoder.h"
#include "ppapi/c/ppb_compositor.h"
#include "ppapi/c/ppb_compositor_layer.h"
#include "ppapi/c/ppb_console.h"
@@ -93,6 +94,7 @@ static int mystrcmp(const char* s1, const char *s2) {
/* BEGIN Declarations for all Wrapper Infos */
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioEncoder_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Compositor_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_CompositorLayer_0_1;
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_CompositorLayer_0_2;
@@ -215,6 +217,65 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Instance_Private_0_1;
/* Not generating wrapper methods for PPB_AudioConfig_1_1 */
+/* Begin wrapper methods for PPB_AudioEncoder_0_1 */
+
+static PP_Resource Pnacl_M44_PPB_AudioEncoder_Create(PP_Instance instance) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ return iface->Create(instance);
+}
+
+static PP_Bool Pnacl_M44_PPB_AudioEncoder_IsAudioEncoder(PP_Resource resource) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ return iface->IsAudioEncoder(resource);
+}
+
+static int32_t Pnacl_M44_PPB_AudioEncoder_GetSupportedProfiles(PP_Resource audio_encoder, struct PP_ArrayOutput* output, struct PP_CompletionCallback* callback) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ return iface->GetSupportedProfiles(audio_encoder, *output, *callback);
+}
+
+static int32_t Pnacl_M44_PPB_AudioEncoder_Initialize(PP_Resource audio_encoder, uint32_t channels, PP_AudioBuffer_SampleRate input_sample_rate, PP_AudioBuffer_SampleSize input_sample_size, PP_AudioProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback* callback) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ return iface->Initialize(audio_encoder, channels, input_sample_rate, input_sample_size, output_profile, initial_bitrate, acceleration, *callback);
+}
+
+static int32_t Pnacl_M44_PPB_AudioEncoder_GetNumberOfSamples(PP_Resource audio_encoder) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ return iface->GetNumberOfSamples(audio_encoder);
+}
+
+static int32_t Pnacl_M44_PPB_AudioEncoder_GetBuffer(PP_Resource audio_encoder, PP_Resource* audio_buffer, struct PP_CompletionCallback* callback) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ return iface->GetBuffer(audio_encoder, audio_buffer, *callback);
+}
+
+static int32_t Pnacl_M44_PPB_AudioEncoder_Encode(PP_Resource audio_encoder, PP_Resource audio_buffer, struct PP_CompletionCallback* callback) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ return iface->Encode(audio_encoder, audio_buffer, *callback);
+}
+
+static int32_t Pnacl_M44_PPB_AudioEncoder_GetBitstreamBuffer(PP_Resource audio_encoder, struct PP_AudioBitstreamBuffer* bitstream_buffer, struct PP_CompletionCallback* callback) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ return iface->GetBitstreamBuffer(audio_encoder, bitstream_buffer, *callback);
+}
+
+static void Pnacl_M44_PPB_AudioEncoder_RecycleBitstreamBuffer(PP_Resource audio_encoder, const struct PP_AudioBitstreamBuffer* bitstream_buffer) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ iface->RecycleBitstreamBuffer(audio_encoder, bitstream_buffer);
+}
+
+static void Pnacl_M44_PPB_AudioEncoder_RequestBitrateChange(PP_Resource audio_encoder, uint32_t bitrate) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ iface->RequestBitrateChange(audio_encoder, bitrate);
+}
+
+static void Pnacl_M44_PPB_AudioEncoder_Close(PP_Resource audio_encoder) {
+ const struct PPB_AudioEncoder_0_1 *iface = Pnacl_WrapperInfo_PPB_AudioEncoder_0_1.real_iface;
+ iface->Close(audio_encoder);
+}
+
+/* End wrapper methods for PPB_AudioEncoder_0_1 */
+
/* Begin wrapper methods for PPB_Compositor_0_1 */
static PP_Bool Pnacl_M37_PPB_Compositor_IsCompositor(PP_Resource resource) {
@@ -4570,6 +4631,20 @@ static struct PP_Var Pnacl_M18_PPP_Instance_Private_GetInstanceObject(PP_Instanc
/* Not generating wrapper interface for PPB_AudioConfig_1_1 */
+static const struct PPB_AudioEncoder_0_1 Pnacl_Wrappers_PPB_AudioEncoder_0_1 = {
+ .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M44_PPB_AudioEncoder_Create,
+ .IsAudioEncoder = (PP_Bool (*)(PP_Resource resource))&Pnacl_M44_PPB_AudioEncoder_IsAudioEncoder,
+ .GetSupportedProfiles = (int32_t (*)(PP_Resource audio_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_AudioEncoder_GetSupportedProfiles,
+ .Initialize = (int32_t (*)(PP_Resource audio_encoder, uint32_t channels, PP_AudioBuffer_SampleRate input_sample_rate, PP_AudioBuffer_SampleSize input_sample_size, PP_AudioProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_AudioEncoder_Initialize,
+ .GetNumberOfSamples = (int32_t (*)(PP_Resource audio_encoder))&Pnacl_M44_PPB_AudioEncoder_GetNumberOfSamples,
+ .GetBuffer = (int32_t (*)(PP_Resource audio_encoder, PP_Resource* audio_buffer, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_AudioEncoder_GetBuffer,
+ .Encode = (int32_t (*)(PP_Resource audio_encoder, PP_Resource audio_buffer, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_AudioEncoder_Encode,
+ .GetBitstreamBuffer = (int32_t (*)(PP_Resource audio_encoder, struct PP_AudioBitstreamBuffer* bitstream_buffer, struct PP_CompletionCallback callback))&Pnacl_M44_PPB_AudioEncoder_GetBitstreamBuffer,
+ .RecycleBitstreamBuffer = (void (*)(PP_Resource audio_encoder, const struct PP_AudioBitstreamBuffer* bitstream_buffer))&Pnacl_M44_PPB_AudioEncoder_RecycleBitstreamBuffer,
+ .RequestBitrateChange = (void (*)(PP_Resource audio_encoder, uint32_t bitrate))&Pnacl_M44_PPB_AudioEncoder_RequestBitrateChange,
+ .Close = (void (*)(PP_Resource audio_encoder))&Pnacl_M44_PPB_AudioEncoder_Close
+};
+
static const struct PPB_Compositor_0_1 Pnacl_Wrappers_PPB_Compositor_0_1 = {
.IsCompositor = (PP_Bool (*)(PP_Resource resource))&Pnacl_M37_PPB_Compositor_IsCompositor,
.Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M37_PPB_Compositor_Create,
@@ -5769,6 +5844,12 @@ static const struct PPP_Instance_Private_0_1 Pnacl_Wrappers_PPP_Instance_Private
/* Not generating wrapper interface for PPP_PexeStreamHandler_1_0 */
+static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioEncoder_0_1 = {
+ .iface_macro = PPB_AUDIOENCODER_INTERFACE_0_1,
+ .wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_AudioEncoder_0_1,
+ .real_iface = NULL
+};
+
static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Compositor_0_1 = {
.iface_macro = PPB_COMPOSITOR_INTERFACE_0_1,
.wrapped_iface = (const void *) &Pnacl_Wrappers_PPB_Compositor_0_1,
@@ -6430,6 +6511,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Instance_Private_0_1 = {
};
static struct __PnaclWrapperInfo *s_ppb_wrappers[] = {
+ &Pnacl_WrapperInfo_PPB_AudioEncoder_0_1,
&Pnacl_WrapperInfo_PPB_Compositor_0_1,
&Pnacl_WrapperInfo_PPB_CompositorLayer_0_1,
&Pnacl_WrapperInfo_PPB_CompositorLayer_0_2,
« no previous file with comments | « ppapi/examples/audio_encode/audio_encode.html ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698