NPAPI:Pepper: Difference between revisions

Jump to navigation Jump to search
Line 179: Line 179:
== Creating and Manipulating Buffers ==
== Creating and Manipulating Buffers ==


Buffers are shared memory objects used to communicate data between processes in a multiprocess implementation.  There are three fundamental operations
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 ===
=== 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 ===
=== 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 ===
=== Destroying a buffer ===
/* Destroy a buffer associated with a particular context. */
typedef NPError (*NPDeviceDestroyBufferPtr)(
    NPP instance,
    NPDeviceContext* context,
    int32 id);


== Optimizations and Legacy APIs ==
== Optimizations and Legacy APIs ==
89

edits

Navigation menu