params: make method on node and port to enum params

Do not pass the params of the node in the node_info, instead,
make a method to enumerate the params. This makes it possible for
clients to only enumerate what they need and when they need it.
Improve introspection of a port, add the name and properties.
Add an enum_param method on the port that can be used to enumerate
port formats.
Change -monitor and -cli and add support for enum_params on the node
and port.
This commit is contained in:
Wim Taymans 2018-02-20 10:31:55 +01:00
parent a9a95a4205
commit 58667d6ced
14 changed files with 977 additions and 259 deletions

View file

@ -292,8 +292,12 @@ 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;
const struct spa_port_info *spa_info;
struct pw_properties *properties; /**< properties of the port */
struct pw_port_info info;
struct spa_list resource_list; /**< list of resources for this port */
enum pw_port_state state; /**< state of the port */
@ -498,15 +502,20 @@ void pw_port_destroy(struct pw_port *port);
* The function returns 0 on success or the error returned by the callback. */
int pw_port_for_each_param(struct pw_port *port,
uint32_t param_id,
uint32_t index, uint32_t max,
const struct spa_pod *filter,
int (*callback) (void *data, struct spa_pod *param),
int (*callback) (void *data,
uint32_t id, uint32_t index, uint32_t next,
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),
int (*callback) (void *data,
uint32_t id, uint32_t index, uint32_t next,
struct spa_pod *param),
void *data);
/** Set a param on a port \memberof pw_port */