mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-19 07:00:10 -05:00
update docs
This commit is contained in:
parent
440f681f4b
commit
7204f3e047
8 changed files with 137 additions and 212 deletions
|
|
@ -41,40 +41,33 @@ enum spa_log_level {
|
|||
};
|
||||
|
||||
/**
|
||||
* struct spa_log:
|
||||
*
|
||||
* The Log interface
|
||||
*/
|
||||
struct spa_log {
|
||||
/* the version of this log. This can be used to expand this
|
||||
/** the version of this log. This can be used to expand this
|
||||
* structure in the future */
|
||||
#define SPA_VERSION_LOG 0
|
||||
uint32_t version;
|
||||
/**
|
||||
* struct spa_log::info
|
||||
*
|
||||
* Extra information about the log
|
||||
*/
|
||||
const struct spa_dict *info;
|
||||
|
||||
/**
|
||||
* struct spa_log::level
|
||||
*
|
||||
* Logging level, everything above this level is not logged
|
||||
*/
|
||||
enum spa_log_level level;
|
||||
|
||||
/**
|
||||
* struct spa_log::log
|
||||
* @log: a #struct spa_log
|
||||
* @level: a #enum spa_log_level
|
||||
* @file: the file name
|
||||
* @line: the line number
|
||||
* @func: the function name
|
||||
* @fmt: printf style format
|
||||
* @...: format arguments
|
||||
*
|
||||
* Log a message with the given log level.
|
||||
*
|
||||
* \param log a spa_log
|
||||
* \param level a spa_log_level
|
||||
* \param file the file name
|
||||
* \param line the line number
|
||||
* \param func the function name
|
||||
* \param fmt printf style format
|
||||
* \param ... format arguments
|
||||
*/
|
||||
void (*log) (struct spa_log *log,
|
||||
enum spa_log_level level,
|
||||
|
|
@ -84,16 +77,15 @@ struct spa_log {
|
|||
const char *fmt, ...) SPA_PRINTF_FUNC(6, 7);
|
||||
|
||||
/**
|
||||
* struct spa_log::logv
|
||||
* @log: a #struct spa_log
|
||||
* @level: a #enum spa_log_level
|
||||
* @file: the file name
|
||||
* @line: the line number
|
||||
* @func: the function name
|
||||
* @fmt: printf style format
|
||||
* @args: format arguments
|
||||
*
|
||||
* Log a message with the given log level.
|
||||
*
|
||||
* \param log a spa_log
|
||||
* \param level a spa_log_level
|
||||
* \param file the file name
|
||||
* \param line the line number
|
||||
* \param func the function name
|
||||
* \param fmt printf style format
|
||||
* \param args format arguments
|
||||
*/
|
||||
void (*logv) (struct spa_log *log,
|
||||
enum spa_log_level level,
|
||||
|
|
|
|||
|
|
@ -67,8 +67,6 @@ typedef int (*spa_invoke_func_t) (struct spa_loop *loop,
|
|||
void *user_data);
|
||||
|
||||
/**
|
||||
* spa_loop:
|
||||
*
|
||||
* Register sources and work items to an event loop
|
||||
*/
|
||||
struct spa_loop {
|
||||
|
|
@ -114,8 +112,6 @@ struct spa_loop_control_hooks {
|
|||
};
|
||||
|
||||
/**
|
||||
* spa_loop_control:
|
||||
*
|
||||
* Control an event loop
|
||||
*/
|
||||
struct spa_loop_control {
|
||||
|
|
@ -154,8 +150,6 @@ typedef void (*spa_source_timer_func_t) (void *data, uint64_t expirations);
|
|||
typedef void (*spa_source_signal_func_t) (void *data, int signal_number);
|
||||
|
||||
/**
|
||||
* struct spa_loop_utils:
|
||||
*
|
||||
* Create sources for an event loop
|
||||
*/
|
||||
struct spa_loop_utils {
|
||||
|
|
|
|||
|
|
@ -38,26 +38,22 @@ struct spa_handle {
|
|||
/* user_data that can be set by the application */
|
||||
void *user_data;
|
||||
/**
|
||||
* spa_handle::get_interface:
|
||||
* @handle: a #spa_handle
|
||||
* @interface_id: the interface id
|
||||
* @interface: result to hold the interface.
|
||||
* Get the interface provided by \a handle with \a interface_id.
|
||||
*
|
||||
* Get the interface provided by @handle with @interface_id.
|
||||
*
|
||||
* Returns: #SPA_RESULT_OK on success
|
||||
* #SPA_RESULT_NOT_IMPLEMENTED when there are no extensions
|
||||
* #SPA_RESULT_INVALID_ARGUMENTS when handle or info is %NULL
|
||||
* \param handle a spa_handle
|
||||
* \param interface_id the interface id
|
||||
* \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, uint32_t interface_id, void **interface);
|
||||
/**
|
||||
* spa_handle::clear
|
||||
* @handle: a pointer to memory
|
||||
*
|
||||
* Clean up the memory of @handle. After this, @handle should not be used
|
||||
* Clean up the memory of \a handle. After this, \a handle should not be used
|
||||
* anymore.
|
||||
*
|
||||
* Returns: #SPA_RESULT_OK on success
|
||||
* \param handle a pointer to memory
|
||||
* \return 0 on success
|
||||
*/
|
||||
int (*clear) (struct spa_handle *handle);
|
||||
};
|
||||
|
|
@ -66,29 +62,24 @@ struct spa_handle {
|
|||
#define spa_handle_clear(h) (h)->clear((h))
|
||||
|
||||
/**
|
||||
* struct spa_interface_info:
|
||||
* @type: the type of the interface, can be used to get the interface
|
||||
*
|
||||
* This structure lists the information about available interfaces on
|
||||
* handles.
|
||||
*/
|
||||
struct spa_interface_info {
|
||||
const char *type;
|
||||
const char *type; /*< the type of the interface, can be
|
||||
* used to get the interface */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct spa_support:
|
||||
* @type: the type of the support item
|
||||
* @data: specific data for the item
|
||||
*
|
||||
* Extra supporting infrastructure passed to the init() function of
|
||||
* a factory. It can be extra information or interfaces such as logging.
|
||||
*/
|
||||
struct spa_support {
|
||||
const char *type;
|
||||
void *data;
|
||||
const char *type; /*< the type of the support item */
|
||||
void *data; /*< specific data for the item */
|
||||
};
|
||||
|
||||
/** Find a support item of the given type */
|
||||
static inline void *spa_support_find(const struct spa_support *support,
|
||||
uint32_t n_support,
|
||||
const char *type)
|
||||
|
|
@ -107,42 +98,33 @@ struct spa_handle_factory {
|
|||
#define SPA_VERSION_HANDLE_FACTORY 0
|
||||
uint32_t version;
|
||||
/**
|
||||
* spa_handle_factory::name
|
||||
*
|
||||
* The name
|
||||
*/
|
||||
const char *name;
|
||||
/**
|
||||
* spa_handle_factory::info
|
||||
*
|
||||
* Extra information about the handles of this factory.
|
||||
*/
|
||||
const struct spa_dict *info;
|
||||
/**
|
||||
* spa_handle_factory::size
|
||||
*
|
||||
* The size of handles from this factory
|
||||
*/
|
||||
const size_t size;
|
||||
|
||||
/**
|
||||
* spa_handle_factory::init
|
||||
* @factory: a #spa_handle_factory
|
||||
* @handle: a pointer to memory
|
||||
* @info: extra handle specific information, usually obtained
|
||||
* from a #spa_monitor. This can be used to configure the handle.
|
||||
* @support: support items
|
||||
* @n_support: number of elements in @support
|
||||
*
|
||||
* Initialize an instance of this factory. The caller should allocate
|
||||
* memory at least spa_handle_factory::size bytes and pass this as @handle.
|
||||
* memory at least size bytes and pass this as \a handle.
|
||||
*
|
||||
* @support can optionally contain extra interfaces or data ites that the
|
||||
* \a support can optionally contain extra interfaces or data items that the
|
||||
* plugin can use such as a logger.
|
||||
*
|
||||
* Returns: #SPA_RESULT_OK on success
|
||||
* #SPA_RESULT_NOT_IMPLEMENTED when an instance can't be made
|
||||
* #SPA_RESULT_INVALID_ARGUMENTS when factory or handle are %NULL
|
||||
* \param factory a spa_handle_factory
|
||||
* \param handle a pointer to memory
|
||||
* \param info extra handle specific information, usually obtained
|
||||
* from a spa_monitor. 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) (const struct spa_handle_factory *factory,
|
||||
struct spa_handle *handle,
|
||||
|
|
@ -152,15 +134,15 @@ struct spa_handle_factory {
|
|||
|
||||
/**
|
||||
* spa_handle_factory::enum_interface_info:
|
||||
* @factory: a #spa_handle_factory
|
||||
* @info: result to hold spa_interface_info.
|
||||
* @index: index to keep track of the enumeration, 0 for first item
|
||||
* \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 @factory.
|
||||
* Enumerate the interface information for \a factory.
|
||||
*
|
||||
* Returns: 1 when an item is available
|
||||
* 0 when no more items are available
|
||||
* -errno on error
|
||||
* \return 1 when an item is available
|
||||
* 0 when no more items are available
|
||||
* < 0 errno type error
|
||||
*/
|
||||
int (*enum_interface_info) (const struct spa_handle_factory *factory,
|
||||
const struct spa_interface_info **info,
|
||||
|
|
@ -171,15 +153,13 @@ struct spa_handle_factory {
|
|||
#define spa_handle_factory_enum_interface_info(h,...) (h)->enum_interface_info((h),__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* spa_handle_factory_enum_func_t:
|
||||
* @factory: a location to hold the factory result
|
||||
* @index: index to keep track of the enumeration
|
||||
*
|
||||
* The function signature of the entry point in a plugin.
|
||||
*
|
||||
* Returns: #SPA_RESULT_OK on success
|
||||
* #SPA_RESULT_INVALID_ARGUMENTS when factory is %NULL
|
||||
* #SPA_RESULT_ENUM_END when there are no more factories
|
||||
* \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
|
||||
*/
|
||||
typedef int (*spa_handle_factory_enum_func_t) (const struct spa_handle_factory **factory,
|
||||
uint32_t *index);
|
||||
|
|
@ -187,15 +167,13 @@ typedef int (*spa_handle_factory_enum_func_t) (const struct spa_handle_factory *
|
|||
#define SPA_HANDLE_FACTORY_ENUM_FUNC_NAME "spa_handle_factory_enum"
|
||||
|
||||
/**
|
||||
* spa_handle_factory_enum:
|
||||
* @factory: a location to hold the factory result
|
||||
* @index: index to keep track of the enumeration
|
||||
*
|
||||
* The entry point in a plugin.
|
||||
*
|
||||
* Returns: 1 on success
|
||||
* 0 when no more items are available
|
||||
* -errno on error
|
||||
* \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(const struct spa_handle_factory **factory, uint32_t *index);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,18 +30,14 @@ extern "C" {
|
|||
#define SPA_TYPE__TypeMap SPA_TYPE_INTERFACE_BASE "TypeMap"
|
||||
|
||||
/**
|
||||
* spa_type_map:
|
||||
*
|
||||
* Maps between string types and their type id
|
||||
*/
|
||||
struct spa_type_map {
|
||||
/* the version of this structure. This can be used to expand this
|
||||
/** the version of this structure. This can be used to expand this
|
||||
* structure in the future */
|
||||
#define SPA_VERSION_TYPE_MAP 0
|
||||
uint32_t version;
|
||||
/**
|
||||
* spa_type_map::info
|
||||
*
|
||||
* Extra information about the type map
|
||||
*/
|
||||
const struct spa_dict *info;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue