struct spa_handle { /** Version of this struct */ #define SPA_VERSION_HANDLE 0
uint32_t version;
/** * Get the interface provided by \a handle with \a type. * * \a interface is always a struct spa_interface but depending on * \a type, the struct might contain other information. * * \param handle a spa_handle * \param type the interface type * \param interface result to hold the interface. * \return 0 on success * -ENOTSUP when there are no interfaces * -EINVAL when handle or info is NULL
*/ int (*get_interface) (struct spa_handle *handle, constchar *type, void **interface); /** * Clean up the memory of \a handle. After this, \a handle should not be used * anymore. * * \param handle a pointer to memory * \return 0 on success
*/ int (*clear) (struct spa_handle *handle);
};
/** * This structure lists the information about available interfaces on * handles.
*/ struct spa_interface_info { constchar *type; /*< the type of the interface, can be
* used to get the interface */
};
/** * Extra supporting infrastructure passed to the init() function of * a factory. It can be extra information or interfaces such as logging.
*/ struct spa_support { constchar *type; /*< the type of the support item */ void *data; /*< specific data for the item */
};
/** Find a support item of the given type */ staticinlinevoid *spa_support_find(conststruct spa_support *support,
uint32_t n_support, constchar *type)
{
uint32_t i; for (i = 0; i < n_support; i++) { if (strcmp(support[i].type, type) == 0) return support[i].data;
} return NULL;
}
struct spa_handle_factory { /** The version of this structure */ #define SPA_VERSION_HANDLE_FACTORY 1
uint32_t version; /** * The name of the factory contains a logical name that describes * the function of the handle. Other plugins might contain an alternative * implementation with the same name. * * See utils/names.h for the list of standard names. * * Examples include: * * api.alsa.pcm.sink: an object to write PCM samples to an alsa PLAYBACK * device * api.v4l2.source: an object to read from a v4l2 source.
*/ constchar *name; /** * Extra information about the handles of this factory.
*/ conststruct spa_dict *info; /** * Get the size of handles from this factory. * * \param factory a spa_handle_factory * \param params extra parameters that determine the size of the * handle.
*/
size_t (*get_size) (conststruct spa_handle_factory *factory, conststruct spa_dict *params);
/** * Initialize an instance of this factory. The caller should allocate * memory at least size bytes and pass this as \a handle. * * \a support can optionally contain extra interfaces or data items that the * plugin can use such as a logger. * * \param factory a spa_handle_factory * \param handle a pointer to memory * \param info extra handle specific information, usually obtained * from a spa_device. This can be used to configure the handle. * \param support support items * \param n_support number of elements in \a support * \return 0 on success * < 0 errno type error
*/ int (*init) (conststruct spa_handle_factory *factory, struct spa_handle *handle, conststruct spa_dict *info, conststruct spa_support *support,
uint32_t n_support);
/** * spa_handle_factory::enum_interface_info: * \param factory: a #spa_handle_factory * \param info: result to hold spa_interface_info. * \param index: index to keep track of the enumeration, 0 for first item * * Enumerate the interface information for \a factory. * * \return 1 when an item is available * 0 when no more items are available * < 0 errno type error
*/ int (*enum_interface_info) (conststruct spa_handle_factory *factory, conststruct spa_interface_info **info,
uint32_t *index);
};
/** * The function signature of the entry point in a plugin. * * \param factory a location to hold the factory result * \param index index to keep track of the enumeration * \return 1 on success * 0 when there are no more factories * -EINVAL when factory is NULL
*/ typedefint (*spa_handle_factory_enum_func_t) (conststruct spa_handle_factory **factory,
uint32_t *index);
/** * The entry point in a plugin. * * \param factory a location to hold the factory result * \param index index to keep track of the enumeration * \return 1 on success * 0 when no more items are available * < 0 errno type error
*/ int spa_handle_factory_enum(conststruct spa_handle_factory **factory, uint32_t *index);
#define SPA_KEY_FACTORY_NAME "factory.name"/**< the name of a factory */ #define SPA_KEY_FACTORY_AUTHOR "factory.author"/**< a comma separated list of factory authors */ #define SPA_KEY_FACTORY_DESCRIPTION "factory.description"/**< description of a factory */ #define SPA_KEY_FACTORY_USAGE "factory.usage"/**< usage of a factory */
#define SPA_KEY_LIBRARY_NAME "library.name"/**< the name of a library. This is usually * the filename of the plugin without the
* path or the plugin extension. */
/** * \}
*/
#ifdef __cplusplus
} /* extern "C" */ #endif
#endif/* SPA_PLUGIN_H */
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.