struct pw_protocol { struct spa_list link; /**< link in context protocol_list */ struct pw_context *context; /**< context for this protocol */
char *name; /**< type name of the protocol */
struct spa_list marshal_list; /**< list of marshallers for supported interfaces */ struct spa_list client_list; /**< list of current clients */ struct spa_list server_list; /**< list of current servers */ struct spa_hook_list listener_list; /**< event listeners */
conststruct pw_protocol_implementation *implementation; /**< implementation of the protocol */
constvoid *extension; /**< extension API */
void *user_data; /**< user data for the implementation */
};
/** the permission function. It returns the allowed access permissions for \a global
* for \a client */ typedef uint32_t (*pw_permission_func_t) (struct pw_global *global, struct pw_impl_client *client, void *data);
#define pw_impl_client_emit(o,m,v,...) spa_hook_list_call(&o->listener_list, struct pw_impl_client_events, m, v, ##__VA_ARGS__)
struct pw_impl_core { struct pw_context *context; struct spa_list link; /**< link in context object core_impl list */ struct pw_global *global; /**< global object created for this core */ struct spa_hook global_listener;
struct spa_list link; /**< link in context object client list */ struct pw_global *global; /**< global object created for this client */ struct spa_hook global_listener;
pw_permission_func_t permission_func; /**< get permissions of an object */ void *permission_data; /**< data passed to permission function */
struct pw_map objects; /**< list of resource objects */
struct spa_hook_list listener_list;
struct pw_protocol *protocol; /**< protocol in use */ int recv_seq; /**< last received sequence number */ int send_seq; /**< last sender sequence number */
uint64_t recv_generation; /**< last received registry generation */
uint64_t sent_generation; /**< last sent registry generation */
void *user_data; /**< extra user data */
struct ucred ucred; /**< ucred information */ unsignedint registered:1; unsignedint ucred_valid:1; /**< if the ucred member is valid */ unsignedint busy:1; unsignedint destroyed:1;
int refcount;
/* v2 compatibility data */ void *compat_v2;
};
#define pw_global_emit(o,m,v,...) spa_hook_list_call(&o->listener_list, struct pw_global_events, m, v, ##__VA_ARGS__)
struct pw_global { struct pw_context *context; /**< the context */
struct spa_list link; /**< link in context list of globals */
uint32_t id; /**< server id of the object */
struct pw_properties *properties; /**< properties of the global */
struct spa_hook_list listener_list;
constchar *type; /**< type of interface */
uint32_t version; /**< version of interface */
pw_global_bind_func_t func; /**< bind function */ void *object; /**< object associated with the interface */
uint64_t serial; /**< increasing serial number */
uint64_t generation; /**< registry generation number */
struct spa_list resource_list; /**< The list of resources of this global */
struct pw_mempool *pool; /**< global memory pool */
uint64_t stamp;
uint64_t serial;
uint64_t generation; /**< registry generation number */ struct pw_map globals; /**< map of globals */
struct spa_list core_impl_list; /**< list of core_imp */ struct spa_list protocol_list; /**< list of protocols */ struct spa_list core_list; /**< list of core connections */ struct spa_list registry_resource_list; /**< list of registry resources */ struct spa_list module_list; /**< list of modules */ struct spa_list device_list; /**< list of devices */ struct spa_list global_list; /**< list of globals */ struct spa_list client_list; /**< list of clients */ struct spa_list node_list; /**< list of nodes */ struct spa_list factory_list; /**< list of factories */ struct spa_list metadata_list; /**< list of metadata */ struct spa_list link_list; /**< list of links */ struct spa_list control_list[2]; /**< list of controls, indexed by direction */ struct spa_list export_list; /**< list of export types */ struct spa_list driver_list; /**< list of driver nodes */
struct spa_thread_utils *thread_utils; struct pw_loop *main_loop; /**< main loop for control */ struct pw_loop *data_loop; /**< data loop for data passing */ struct pw_data_loop *data_loop_impl; struct spa_system *data_system; /**< data system for data passing */ struct pw_work_queue *work_queue; /**< work queue */
struct spa_support support[16]; /**< support for spa plugins */
uint32_t n_support; /**< number of support items */ struct pw_array factory_lib; /**< mapping of factory_name regexp to library */
struct pw_array objects; /**< objects */
struct pw_impl_client *current_client; /**< client currently executing code in mainloop */
struct pw_impl_device { struct pw_context *context; /**< the context object */ struct spa_list link; /**< link in the context device_list */ struct pw_global *global; /**< global object for this device */ struct spa_hook global_listener;
struct pw_properties *properties; /**< properties of the device */ struct pw_device_info info; /**< introspectable device info */ struct spa_param_info params[MAX_PARAMS];
struct pw_impl_module { struct pw_context *context; /**< the context object */ struct spa_list link; /**< link in the context module_list */ struct pw_global *global; /**< global object for this module */ struct spa_hook global_listener;
struct pw_properties *properties; /**< properties of the module */ struct pw_module_info info; /**< introspectable module info */
struct spa_hook_list listener_list;
void *user_data; /**< module user_data */
};
struct pw_node_activation_state { int status; /**< current status, the result of spa_node_process() */
int32_t required; /**< required number of signals */
int32_t pending; /**< number of pending signals */
};
unsignedint version:1; unsignedint pending_sync:1; /* a sync is pending */ unsignedint pending_new_pos:1; /* a new position is pending */
struct pw_node_activation_state state[2]; /* one current state and one next state,
* as version flag */
uint64_t signal_time;
uint64_t awake_time;
uint64_t finish_time;
uint64_t prev_signal_time;
/* updates */ struct spa_io_segment reposition; /* reposition info, used when driver reposition_owner
* has this node id */ struct spa_io_segment segment; /* update for the extra segment info fields.
* used when driver segment_owner has this node id */
/* for drivers, shared with all nodes */
uint32_t segment_owner[32]; /* id of owners for each segment info struct. * nodes that want to update segment info need to
* CAS their node id in this array. */ struct spa_io_position position; /* contains current position and segment info. * extra info is updated by nodes that have set
* themselves as owner in the segment structs */
uint64_t sync_timeout; /* sync timeout in nanoseconds * position goes to RUNNING without waiting any
* longer for sync clients. */
uint64_t sync_left; /* number of cycles before timeout */
float cpu_load[3]; /* averaged over short, medium, long time */
uint32_t xrun_count; /* number of xruns */
uint64_t xrun_time; /* time of last xrun in microseconds */
uint64_t xrun_delay; /* delay of last xrun in microseconds */
uint64_t max_delay; /* max of all xruns in microseconds */
#define PW_NODE_ACTIVATION_COMMAND_NONE 0 #define PW_NODE_ACTIVATION_COMMAND_START 1 #define PW_NODE_ACTIVATION_COMMAND_STOP 2
uint32_t command; /* next command */
uint32_t reposition_owner; /* owner id with new reposition info, last one
* to update wins */
};
uint32_t priority_driver; /** priority for being driver */ char group[128]; /** group to schedule this node in */
uint64_t spa_flags;
unsignedint registered:1; unsignedint active:1; /**< if the node is active */ unsignedint live:1; /**< if the node is live */ unsignedint driver:1; /**< if the node can drive the graph */ unsignedint exported:1; /**< if the node is exported */ unsignedint remote:1; /**< if the node is implemented remotely */ unsignedint driving:1; /**< a driving node is one of the driver nodes that
* is selected to drive the graph */ unsignedint visited:1; /**< for sorting */ unsignedint want_driver:1; /**< this node wants to be assigned to a driver */ unsignedint passive:1; /**< driver graph only has passive links */ unsignedint freewheel:1; /**< if this is the freewheel driver */ unsignedint loopchecked:1; /**< for feedback loop checking */ unsignedint always_process:1; /**< this node wants to always be processing, even when idle */ unsignedint lock_quantum:1; /**< don't change graph quantum */ unsignedint lock_rate:1; /**< don't change graph rate */ unsignedint transport_sync:1; /**< supports transport sync */ unsignedint current_pending:1; /**< a quantum/rate update is pending */ unsignedint moved:1; /**< the node was moved drivers */
uint32_t port_user_data_size; /**< extra size for port user data */
struct spa_list input_ports; /**< list of input ports */ struct pw_map input_port_map; /**< map from port_id to port */ struct spa_list output_ports; /**< list of output ports */ struct pw_map output_port_map; /**< map from port_id to port */
struct spa_hook_list listener_list;
struct pw_loop *data_loop; /**< the data loop for this node */
struct spa_fraction latency; /**< requested latency */ struct spa_fraction max_latency; /**< maximum latency */ struct spa_fraction rate; /**< requested rate */
uint32_t force_quantum; /**< forced quantum */
uint32_t force_rate; /**< forced rate */
uint32_t stamp; /**< stamp of last update */ struct spa_source source; /**< source to remotely trigger this node */ struct pw_memblock *activation; struct { struct spa_io_clock *clock; /**< io area of the clock or NULL */ struct spa_io_position *position; struct pw_node_activation *activation;
struct spa_list target_list; /* list of targets to signal after
* this node */ struct pw_node_target driver_target; /* driver target that we signal */ struct spa_list input_mix; /* our input ports (and mixers) */ struct spa_list output_mix; /* output ports (and mixers) */
struct pw_node_target target; /* our target that is signaled by the
driver */ struct spa_list driver_link; /* our link in driver */
#define PW_IMPL_PORT_IS_CONTROL(port) SPA_FLAG_MASK(port->flags, \
PW_IMPL_PORT_FLAG_BUFFERS|PW_IMPL_PORT_FLAG_CONTROL,\
PW_IMPL_PORT_FLAG_CONTROL) struct pw_impl_port { struct spa_list link; /**< link in node port_list */
struct pw_impl_node *node; /**< owner node */ struct pw_global *global; /**< global for this port */ struct spa_hook global_listener;
#define PW_IMPL_PORT_FLAG_TO_REMOVE (1<<0) /**< if the port should be removed from the
* implementation when destroyed */ #define PW_IMPL_PORT_FLAG_BUFFERS (1<<1) /**< port has data */ #define PW_IMPL_PORT_FLAG_CONTROL (1<<2) /**< port has control */ #define PW_IMPL_PORT_FLAG_NO_MIXER (1<<3) /**< don't try to add mixer to port */
uint32_t flags;
uint64_t spa_flags;
enum pw_direction direction; /**< port direction */
uint32_t port_id; /**< port id */
enum pw_impl_port_state state; /**< state of the port */ constchar *error; /**< error state */
struct pw_properties *properties; /**< properties of the port */ struct pw_port_info info; struct spa_param_info params[MAX_PARAMS];
struct pw_buffers buffers; /**< buffers managed by this port, only on
* output ports, shared with all links */
struct spa_list links; /**< list of \ref pw_impl_link */
struct spa_list control_list[2];/**< list of \ref pw_control indexed by direction */
struct spa_hook_list listener_list;
struct spa_callbacks impl;
struct spa_node *mix; /**< port buffer mix/split */ #define PW_IMPL_PORT_MIX_FLAG_MULTI (1<<0) /**< multi input or output */ #define PW_IMPL_PORT_MIX_FLAG_MIX_ONLY (1<<1) /**< only negotiate mix ports */ #define PW_IMPL_PORT_MIX_FLAG_NEGOTIATE (1<<2) /**< negotiate buffers */
uint32_t mix_flags; /**< flags for the mixing */ struct spa_handle *mix_handle; /**< mix plugin handle */ struct pw_buffers mix_buffers; /**< buffers between mixer and node */
struct spa_list mix_list; /**< list of \ref pw_impl_port_mix */ struct pw_map mix_port_map; /**< map from port_id from mixer */
uint32_t n_mix;
struct { struct spa_io_buffers io; /**< io area of the port */ struct spa_io_clock clock; /**< io area of the clock */ struct spa_list mix_list; struct spa_list node_link;
} rt; /**< data only accessed from the data thread */ unsignedint added:1; unsignedint destroying:1; int busy_count;
struct pw_impl_link { struct pw_context *context; /**< context object */ struct spa_list link; /**< link in context link_list */ struct pw_global *global; /**< global for this link */ struct spa_hook global_listener;
char *name;
struct pw_link_info info; /**< introspectable link info */ struct pw_properties *properties; /**< extra link properties */
struct spa_io_buffers *io; /**< link io area */
struct pw_impl_port *output; /**< output port */ struct spa_list output_link; /**< link in output port links */ struct pw_impl_port *input; /**< input port */ struct spa_list input_link; /**< link in input port links */
struct { struct pw_impl_port_mix out_mix; /**< port added to the output mixer */ struct pw_impl_port_mix in_mix; /**< port added to the input mixer */ struct pw_node_target target; /**< target to trigger the input node */
} rt;
struct pw_context *context; /**< the context object */ struct pw_global *global; /**< global of resource */ struct spa_list link; /**< link in global resource_list */
uint32_t id; /**< per client unique id, index in client objects */
uint32_t permissions; /**< resource permissions */ constchar *type; /**< type of the client interface */
uint32_t version; /**< version of the client interface */
uint32_t bound_id; /**< global id we are bound to */ int refcount;
unsignedint removed:1; /**< resource was removed from server */ unsignedint destroyed:1; /**< resource was destroyed */
struct pw_core *core; /**< the owner core of this proxy */
uint32_t id; /**< client side id */ constchar *type; /**< type of the interface */
uint32_t version; /**< client side version */
uint32_t bound_id; /**< global id we are bound to */ int refcount; unsignedint zombie:1; /**< proxy is removed locally and waiting to
* be removed from server */ unsignedint removed:1; /**< proxy was removed from server */ unsignedint destroyed:1; /**< proxy was destroyed by client */ unsignedint in_map:1; /**< proxy is in core object map */
conststruct pw_protocol_marshal *marshal; /**< protocol specific marshal functions */
void *user_data; /**< extra user data */
};
struct pw_core { struct pw_proxy proxy;
struct pw_context *context; /**< context */ struct spa_list link; /**< link in context core_list */ struct pw_properties *properties; /**< extra properties */
struct pw_mempool *pool; /**< memory pool */ struct pw_core *core; /**< proxy for the core object */ struct spa_hook core_listener; struct spa_hook proxy_core_listener;
struct pw_map objects; /**< map of client side proxy objects
* indexed with the client id */ struct pw_client *client; /**< proxy for the client object */
struct spa_list stream_list; /**< list of \ref pw_stream objects */ struct spa_list filter_list; /**< list of \ref pw_stream objects */
struct pw_protocol_client *conn; /**< the protocol client connection */ int recv_seq; /**< last received sequence number */ int send_seq; /**< last protocol result code */
uint64_t recv_generation; /**< last received registry generation */
char *name; /**< the name of the stream */ struct pw_properties *properties; /**< properties of the stream */
uint32_t node_id; /**< node id for remote node, available from
* CONFIGURE state and higher */ enum pw_stream_state state; /**< stream state */ char *error; /**< error reason when state is in error */
struct spa_list link; /**< link in the core proxy */
char *name; /**< the name of the filter */ struct pw_properties *properties; /**< properties of the filter */
uint32_t node_id; /**< node id for remote node, available from
* CONFIGURE state and higher */ enum pw_filter_state state; /**< filter state */ char *error; /**< error reason when state is in error */
int pw_impl_port_register(struct pw_impl_port *port, struct pw_properties *properties);
/** Get the user data of a port, the size of the memory was given \ref in pw_context_create_port */ void * pw_impl_port_get_user_data(struct pw_impl_port *port);
int pw_impl_port_set_mix(struct pw_impl_port *port, struct spa_node *node, uint32_t flags);
int pw_impl_port_init_mix(struct pw_impl_port *port, struct pw_impl_port_mix *mix); int pw_impl_port_release_mix(struct pw_impl_port *port, struct pw_impl_port_mix *mix);
/** Unlink a port */ void pw_impl_port_unlink(struct pw_impl_port *port);
/** Destroy a port */ void pw_impl_port_destroy(struct pw_impl_port *port);
/** Iterate the params of the given port. The callback should return * 1 to fetch the next item, 0 to stop iteration or <0 on error.
* The function returns 0 on success or the error returned by the callback. */ int pw_impl_port_for_each_param(struct pw_impl_port *port, int seq, uint32_t param_id,
uint32_t index, uint32_t max, conststruct spa_pod *filter, int (*callback) (void *data, int seq,
uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data);
int pw_impl_port_for_each_filtered_param(struct pw_impl_port *in_port, struct pw_impl_port *out_port, int seq,
uint32_t in_param_id,
uint32_t out_param_id, conststruct spa_pod *filter, int (*callback) (void *data, int seq,
uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data);
/** Iterate the links of the port. The callback should return * 0 to fetch the next item, any other value stops the iteration and returns * the value. When all callbacks return 0, this function returns 0 when all
* items are iterated. */ int pw_impl_port_for_each_link(struct pw_impl_port *port, int (*callback) (void *data, struct pw_impl_link *link), void *data);
/** Set a param on a port, use SPA_ID_INVALID for mix_id to set
* the param on all mix ports */ int pw_impl_port_set_param(struct pw_impl_port *port,
uint32_t id, uint32_t flags, conststruct spa_pod *param);
/** Use buffers on a port */ int pw_impl_port_use_buffers(struct pw_impl_port *port, struct pw_impl_port_mix *mix, uint32_t flags, struct spa_buffer **buffers, uint32_t n_buffers);
int pw_impl_port_recalc_latency(struct pw_impl_port *port);
/** Change the state of the node */ int pw_impl_node_set_state(struct pw_impl_node *node, enum pw_node_state state);
int pw_impl_node_update_ports(struct pw_impl_node *node);
int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driver);
/** Prepare a link
* Starts the negotiation of formats and buffers on \a link */ int pw_impl_link_prepare(struct pw_impl_link *link); /** starts streaming on a link */ int pw_impl_link_activate(struct pw_impl_link *link);
/** Deactivate a link */ int pw_impl_link_deactivate(struct pw_impl_link *link);
struct pw_control *
pw_control_new(struct pw_context *context, struct pw_impl_port *owner, /**< can be NULL */
uint32_t id, uint32_t size,
size_t user_data_size /**< extra user data */);
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.