[Devel] Requiring hosts to pre-initialize outputs, and plugins to always write

David Robillard d at drobilla.net
Sun Feb 12 14:10:55 PST 2012


Proposed solution:

/**
   The contents of an atom:AtomPort buffer.

   This contains a pointer to an Atom, which is the data to be
   processed/written, as well as additional metadata.  This
   struct may be augmented in the future to add more metadata
   fields as they become necessary.  Implementations MUST check
   that any fields they wish to use are actually present by
   comparing the size with the offset of that field.  For
   example:

   @code
   if (offsetof(LV2_Atom_Port_Buffer, capacity) < buf->size) {
       do_stuff_with(buf->capacity);
   }
   @endcode
*/
typedef struct {
	LV2_Atom* data;      /** Pointer to data. */
	uint32_t  size;      /** Total size of this struct. */
	uint32_t  capacity;  /** Available space for data body. */
} LV2_Atom_Port_Buffer;

-dr




More information about the Devel mailing list