mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
control: add control objects
Add control objects for all controllable properties on ports. Try to link compatible control properties in autolink. Allocate shared memory for the output property memory and configure the io area on the ports when the controls are linked. Send the shared memfd to clients when the io area is configured. Add port_set_io support in remote.c, mmap the control io area and set on the port. Add some param helpers Add volume control to export-source update the volume before sending each buffer.
This commit is contained in:
parent
91a3670610
commit
541553be1c
19 changed files with 577 additions and 34 deletions
|
|
@ -137,6 +137,7 @@ struct pw_core {
|
|||
struct spa_list node_list; /**< list of nodes */
|
||||
struct spa_list factory_list; /**< list of factories */
|
||||
struct spa_list link_list; /**< list of links */
|
||||
struct spa_list control_list[2]; /**< list of controls, indexed by direction */
|
||||
|
||||
struct spa_hook_list listener_list;
|
||||
|
||||
|
|
@ -267,6 +268,7 @@ struct pw_port {
|
|||
enum pw_direction direction; /**< port direction */
|
||||
uint32_t port_id; /**< port id */
|
||||
struct pw_properties *properties;
|
||||
const struct spa_port_info *info;
|
||||
|
||||
enum pw_port_state state; /**< state of the port */
|
||||
|
||||
|
|
@ -279,6 +281,8 @@ struct pw_port {
|
|||
|
||||
struct spa_list links; /**< list of \ref pw_link */
|
||||
|
||||
struct spa_list control_list[2]; /**< list of \ref pw_control indexed by direction */
|
||||
|
||||
struct spa_hook_list listener_list;
|
||||
|
||||
struct spa_node *mix; /**< optional port buffer mix/split */
|
||||
|
|
@ -391,6 +395,24 @@ struct pw_factory {
|
|||
void *user_data;
|
||||
};
|
||||
|
||||
struct pw_control {
|
||||
struct spa_list link; /**< link in core control_list */
|
||||
struct pw_core *core; /**< the core */
|
||||
|
||||
struct pw_port *port; /**< owner port or NULL */
|
||||
struct spa_list port_link; /**< link in port control_list */
|
||||
|
||||
enum spa_direction direction; /**< the direction */
|
||||
struct spa_pod *param; /**< control params */
|
||||
|
||||
uint32_t id;
|
||||
int32_t size;
|
||||
|
||||
struct spa_hook_list listener_list;
|
||||
|
||||
void *user_data;
|
||||
};
|
||||
|
||||
/** Find a good format between 2 ports */
|
||||
int pw_core_find_format(struct pw_core *core,
|
||||
struct pw_port *output,
|
||||
|
|
@ -438,6 +460,13 @@ int pw_port_for_each_param(struct pw_port *port,
|
|||
int (*callback) (void *data, struct spa_pod *param),
|
||||
void *data);
|
||||
|
||||
int pw_port_for_each_filtered_param(struct pw_port *in_port,
|
||||
struct pw_port *out_port,
|
||||
uint32_t in_param_id,
|
||||
uint32_t out_param_id,
|
||||
int (*callback) (void *data, struct spa_pod *param),
|
||||
void *data);
|
||||
|
||||
/** Set a param on a port \memberof pw_port */
|
||||
int pw_port_set_param(struct pw_port *port, uint32_t id, uint32_t flags,
|
||||
const struct spa_pod *param);
|
||||
|
|
@ -470,6 +499,14 @@ bool pw_link_activate(struct pw_link *link);
|
|||
/** Deactivate a link \memberof pw_link */
|
||||
bool pw_link_deactivate(struct pw_link *link);
|
||||
|
||||
struct pw_control *
|
||||
pw_control_new(struct pw_core *core,
|
||||
struct pw_port *owner, /**< can be NULL */
|
||||
const struct spa_pod *param, /**< copy is taken */
|
||||
size_t user_data_size /**< extra user data */);
|
||||
|
||||
void pw_control_destroy(struct pw_control *control);
|
||||
|
||||
/** \endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue