Changes

Jump to: navigation, search

NPAPI:Pepper

883 bytes added, 01:00, 30 March 2010
Creating and Manipulating Buffers
== Creating and Manipulating Buffers ==
Buffers are shared memory objects associated with a specific device context that are used to communicate data between processes in a multiprocess implementation. There are three fundamental operations
=== Creating a buffer ===
 
/* Create a buffer associated with a particular context. The usage of the */
/* buffer is device specific. The lifetime of the buffer is scoped with the */
/* lifetime of the context. */
typedef NPError (*NPDeviceCreateBufferPtr)(
NPP instance,
NPDeviceContext* context,
size_t size,
int32* id);
=== Mapping a buffer ===
 
/* Inserts the buffer into the address space of the caller.
Unmapping implicitly happens when the buffer or context is destroyed. */
typedef struct _NPDeviceBuffer {
void* ptr;
size_t size;
} NPDeviceBuffer;
 
typedef NPError (*NPDeviceMapBufferPtr)(
NPP instance,
NPDeviceContext* context,
int32 id,
NPDeviceBuffer* buffer);
=== Destroying a buffer ===
 
/* Destroy a buffer associated with a particular context. */
typedef NPError (*NPDeviceDestroyBufferPtr)(
NPP instance,
NPDeviceContext* context,
int32 id);
== Optimizations and Legacy APIs ==
89
edits

Navigation menu