mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-07-04 00:06:43 -04:00
filter-graph: add set_io functions
Make it possible to set io areas like the clock and latency
This commit is contained in:
parent
c06b6c53c2
commit
95b95179d2
3 changed files with 32 additions and 3 deletions
|
|
@ -77,6 +77,8 @@ struct spa_filter_graph_methods {
|
||||||
int (*get_props) (void *object, struct spa_pod_builder *b, struct spa_pod **props);
|
int (*get_props) (void *object, struct spa_pod_builder *b, struct spa_pod **props);
|
||||||
int (*set_props) (void *object, enum spa_direction direction, const struct spa_pod *props);
|
int (*set_props) (void *object, enum spa_direction direction, const struct spa_pod *props);
|
||||||
|
|
||||||
|
int (*set_io) (void *object, const char *type, void *data, size_t size);
|
||||||
|
|
||||||
int (*activate) (void *object, const struct spa_dict *props);
|
int (*activate) (void *object, const struct spa_dict *props);
|
||||||
int (*deactivate) (void *object);
|
int (*deactivate) (void *object);
|
||||||
|
|
||||||
|
|
@ -114,6 +116,13 @@ SPA_API_FILTER_GRAPH int spa_filter_graph_set_props(struct spa_filter_graph *obj
|
||||||
spa_filter_graph, &object->iface, set_props, 0, direction, props);
|
spa_filter_graph, &object->iface, set_props, 0, direction, props);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SPA_API_FILTER_GRAPH int spa_filter_graph_set_io(struct spa_filter_graph *object,
|
||||||
|
const char *type, void *data, size_t size)
|
||||||
|
{
|
||||||
|
return spa_api_method_r(int, -ENOTSUP,
|
||||||
|
spa_filter_graph, &object->iface, set_io, 0, type, data, size);
|
||||||
|
}
|
||||||
|
|
||||||
SPA_API_FILTER_GRAPH int spa_filter_graph_activate(struct spa_filter_graph *object, const struct spa_dict *props)
|
SPA_API_FILTER_GRAPH int spa_filter_graph_activate(struct spa_filter_graph *object, const struct spa_dict *props)
|
||||||
{
|
{
|
||||||
return spa_api_method_r(int, -ENOTSUP,
|
return spa_api_method_r(int, -ENOTSUP,
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,8 @@ struct spa_fga_descriptor {
|
||||||
|
|
||||||
void (*cleanup) (void *instance);
|
void (*cleanup) (void *instance);
|
||||||
|
|
||||||
|
void (*set_io) (void *instance, const char *type, void *data, size_t size);
|
||||||
|
|
||||||
void (*connect_port) (void *instance, unsigned long port, void *data);
|
void (*connect_port) (void *instance, unsigned long port, void *data);
|
||||||
void (*control_changed) (void *instance);
|
void (*control_changed) (void *instance);
|
||||||
void (*control_sync) (void *instance);
|
void (*control_sync) (void *instance);
|
||||||
|
|
|
||||||
|
|
@ -875,6 +875,25 @@ static int impl_set_props(void *object, enum spa_direction direction, const stru
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int impl_set_io(void *object, const char *type, void *data, size_t size)
|
||||||
|
{
|
||||||
|
struct impl *impl = object;
|
||||||
|
struct graph *graph = &impl->graph;
|
||||||
|
struct node *node;
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
spa_list_for_each(node, &graph->node_list, link) {
|
||||||
|
const struct spa_fga_descriptor *d = node->desc->desc;
|
||||||
|
if (d->set_io == NULL)
|
||||||
|
continue;
|
||||||
|
for (i = 0; i < node->n_hndl; i++) {
|
||||||
|
if (node->hndl[i] != NULL)
|
||||||
|
d->set_io(node->hndl[i], type, data, size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static uint32_t count_array(struct spa_json *json)
|
static uint32_t count_array(struct spa_json *json)
|
||||||
{
|
{
|
||||||
struct spa_json it = *json;
|
struct spa_json it = *json;
|
||||||
|
|
@ -1757,9 +1776,7 @@ static int impl_activate(void *object, const struct spa_dict *props)
|
||||||
|
|
||||||
/* now activate */
|
/* now activate */
|
||||||
spa_list_for_each(node, &graph->node_list, link) {
|
spa_list_for_each(node, &graph->node_list, link) {
|
||||||
desc = node->desc;
|
d = node->desc->desc;
|
||||||
d = desc->desc;
|
|
||||||
|
|
||||||
for (i = 0; i < node->n_hndl; i++) {
|
for (i = 0; i < node->n_hndl; i++) {
|
||||||
if (d->activate)
|
if (d->activate)
|
||||||
d->activate(node->hndl[i]);
|
d->activate(node->hndl[i]);
|
||||||
|
|
@ -2399,6 +2416,7 @@ static const struct spa_filter_graph_methods impl_filter_graph = {
|
||||||
.enum_prop_info = impl_enum_prop_info,
|
.enum_prop_info = impl_enum_prop_info,
|
||||||
.get_props = impl_get_props,
|
.get_props = impl_get_props,
|
||||||
.set_props = impl_set_props,
|
.set_props = impl_set_props,
|
||||||
|
.set_io = impl_set_io,
|
||||||
.activate = impl_activate,
|
.activate = impl_activate,
|
||||||
.deactivate = impl_deactivate,
|
.deactivate = impl_deactivate,
|
||||||
.reset = impl_reset,
|
.reset = impl_reset,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue