Commit 8e366a17 authored by Wim Taymans's avatar Wim Taymans
Browse files

port: add param_changed event

parent 4c8f8671
......@@ -307,6 +307,8 @@ static void emit_params(struct pw_impl_port *port, uint32_t *changed_ids, uint32
struct pw_resource *resource;
int subscribed = 0;
pw_impl_port_emit_param_changed(port, changed_ids[i]);
/* first check if anyone is subscribed */
spa_list_for_each(resource, &port->global->resource_list, link) {
if ((subscribed = resource_is_subscribed(resource, changed_ids[i])))
......
......@@ -57,7 +57,7 @@ enum pw_impl_port_state {
/** Port events, use \ref pw_impl_port_add_listener */
struct pw_impl_port_events {
#define PW_VERSION_IMPL_PORT_EVENTS 0
#define PW_VERSION_IMPL_PORT_EVENTS 1
uint32_t version;
/** The port is destroyed */
......@@ -87,6 +87,9 @@ struct pw_impl_port_events {
/** a control was removed from the port */
void (*control_removed) (void *data, struct pw_control *control);
/** a parameter changed, since version 1 */
void (*param_changed) (void *data, uint32_t id);
};
/** Create a new port \memberof pw_impl_port
......
......@@ -638,6 +638,7 @@ struct pw_impl_port_implementation {
#define pw_impl_port_emit_state_changed(p,o,s,e) pw_impl_port_emit(p, state_changed, 0, o, s, e)
#define pw_impl_port_emit_control_added(p,c) pw_impl_port_emit(p, control_added, 0, c)
#define pw_impl_port_emit_control_removed(p,c) pw_impl_port_emit(p, control_removed, 0, c)
#define pw_impl_port_emit_param_changed(p,i) pw_impl_port_emit(p, param_changed, 1, i)
#define PW_IMPL_PORT_IS_CONTROL(port) SPA_FLAG_MASK(port->flags, \
PW_IMPL_PORT_FLAG_BUFFERS|PW_IMPL_PORT_FLAG_CONTROL,\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment