mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
node: remove info from node interface
Replace with info event emited when callbacks are set. This makes it easier to implement dynamic changes.
This commit is contained in:
parent
57e94f7bc4
commit
7bc9c1ebfe
23 changed files with 69 additions and 89 deletions
|
|
@ -387,6 +387,10 @@ static int impl_node_send_command(struct spa_node *node, const struct spa_comman
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct spa_dict_item node_info_items[] = {
|
||||
{ "media.class", "Video/Source" },
|
||||
};
|
||||
|
||||
static int
|
||||
impl_node_set_callbacks(struct spa_node *node,
|
||||
const struct spa_node_callbacks *callbacks,
|
||||
|
|
@ -401,6 +405,10 @@ impl_node_set_callbacks(struct spa_node *node,
|
|||
this->callbacks = callbacks;
|
||||
this->callbacks_data = data;
|
||||
|
||||
if (callbacks) {
|
||||
if (callbacks->info)
|
||||
callbacks->info(data, &SPA_DICT_INIT_ARRAY(node_info_items));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -834,18 +842,8 @@ static int impl_node_process(struct spa_node *node)
|
|||
return SPA_STATUS_OK;
|
||||
}
|
||||
|
||||
static const struct spa_dict_item node_info_items[] = {
|
||||
{ "media.class", "Video/Source" },
|
||||
};
|
||||
|
||||
static const struct spa_dict node_info = {
|
||||
node_info_items,
|
||||
SPA_N_ELEMENTS(node_info_items),
|
||||
};
|
||||
|
||||
static const struct spa_node impl_node = {
|
||||
SPA_VERSION_NODE,
|
||||
&node_info,
|
||||
impl_node_enum_params,
|
||||
impl_node_set_param,
|
||||
impl_node_set_io,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue