Typedefs

typedef void *(* PP_ArrayOutput_GetDataBuffer )(void *user_data, uint32_t element_count, uint32_t element_size)
typedef void(* PP_CompletionCallback_Func )(void *user_data, int32_t result)
typedef int32_t PP_Instance
typedef int32_t PP_Module
typedef int32_t PP_Resource
typedef double PP_Time
typedef double PP_TimeTicks
typedef double PP_TimeDelta
typedef const void *(* PPB_GetInterface )(const char *interface_name)
typedef void(* PPB_Audio_Callback )(void *sample_buffer, uint32_t buffer_size_in_bytes, PP_TimeDelta latency, void *user_data)
typedef int32_t(* PP_InitializeModule_Func )(PP_Module module, PPB_GetInterface get_browser_interface)
typedef void(* PP_ShutdownModule_Func )(void)
typedef const void *(* PP_GetInterface_Func )(const char *interface_name)

Typedef Documentation

typedef void*(* PP_ArrayOutput_GetDataBuffer)(void *user_data, uint32_t element_count, uint32_t element_size)
typedef void(* PP_CompletionCallback_Func)(void *user_data, int32_t result)

This typedef defines the signature that you implement to receive callbacks on asynchronous completion of an operation.

Parameters:
[in]user_dataA pointer to user data passed to a callback function.
[in]resultIf result is 0 (PP_OK), the operation succeeded. Negative values (other than -1 or PP_OK_COMPLETE) indicate error and are specified in pp_errors.h. Positive values for result usually indicate success and have some operation-dependent meaning (such as bytes read).
typedef const void*(* PP_GetInterface_Func)(const char *interface_name)

Defines the type of the PPP_ShutdownModule function.

typedef int32_t(* PP_InitializeModule_Func)(PP_Module module, PPB_GetInterface get_browser_interface)

Defines the type of the PPP_InitializeModule function.

The PP_Instance value uniquely identifies one instance of a module (.nexe/PP_Module).

There will be one module instance for every <embed> tag on a page.

This identifier is an opaque handle assigned by the browser to the module. It is guaranteed never to be 0, so a module can initialize it to 0 to indicate a "NULL handle."

The PP_Module value uniquely identifies the module or .nexe.

This identifier is an opaque handle assigned by the browser to the module. It is guaranteed never to be 0, so a module can initialize it to 0 to indicate a "NULL handle."

This typedef represents an opaque handle assigned by the browser to the resource.

The handle is guaranteed never to be 0 for a valid resource, so a module can initialize it to 0 to indicate a "NULL handle." Some interfaces may return a NULL resource to indicate failure.

While a Var represents something callable to JS or from the module to the DOM, a resource has no meaning or visibility outside of the module interface.

Resources are reference counted. Use AddRefResource() and ReleaseResource() in ppb_core.h to manage the reference count of a resource. The data will be automatically destroyed when the internal reference count reaches 0.

typedef void(* PP_ShutdownModule_Func)(void)

Defines the type of the PPP_ShutdownModule function.

The PP_Time type represents the "wall clock time" according to the browser and is defined as the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970).

A PP_TimeDelta value represents a duration of time which is measured in seconds.

A PP_TimeTicks value represents time ticks which are measured in seconds and are used for indicating the time that certain messages were received.

In contrast to PP_Time, PP_TimeTicks does not correspond to any actual wall clock time and will not change discontinuously if the user changes their computer clock.

The units are in seconds, but are not measured relative to any particular epoch, so the most you can do is compare two values.

typedef void(* PPB_Audio_Callback)(void *sample_buffer, uint32_t buffer_size_in_bytes, PP_TimeDelta latency, void *user_data)

PPB_Audio_Callback defines the type of an audio callback function used to fill the audio buffer with data.

Please see the Create() function in the PPB_Audio interface for more details on this callback.

Parameters:
[in]sample_bufferA buffer to fill with audio data.
[in]buffer_size_in_bytesThe size of the buffer in bytes.
[in]latencyHow long before the audio data is to be presented.
inout]user_data An opaque pointer that was passed into PPB_Audio.Create().
typedef const void*(* PPB_GetInterface)(const char *interface_name)

This function pointer type defines the signature for the PPB_GetInterface function.

A generic PPB_GetInterface pointer is passed to PPP_InitializedModule when your module is loaded. You can use this pointer to request a pointer to a specific browser interface. Browser interface names are ASCII strings and are generally defined in the header file for the interface, such as PPB_AUDIO_INTERFACE found in ppb.audio.h or PPB_GRAPHICS_2D_INTERFACE in ppb_graphics_2d.h. Click here for a complete list of interface names.

This value will be NULL if the interface is not supported on the browser.

This site uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. Learn more about our use of cookies.