This commit is contained in:
Frank Krick 2025-08-15 19:38:17 -04:00
parent 1c53fdbfc0
commit 0a6d1ce7ef

View file

@ -1228,16 +1228,8 @@ static void capture_process(void *d)
static int apply_props(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct impl *impl = user_data;
const struct spa_pod *props = data;
if (props == NULL) {
fprintf(stdout, "no props\n");
}
//spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_INPUT, props);
spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT, props);
/* props was allocated with spa_pod_copy before invoking */
return 0;
}
@ -1248,23 +1240,9 @@ static void control_process(void *d)
struct impl *impl = d;
struct pw_buffer *control = pw_stream_dequeue_buffer(impl->control);
/*
while (true) {
struct pw_buffer *t;
if ((t = pw_stream_dequeue_buffer(impl->control)) == NULL)
break;
if (control)
pw_stream_queue_buffer(impl->control, control);
control = t;
}
*/
if (control == NULL) {
fprintf(stdout, "out of control buffers\n");
if (control == NULL)
goto done;
}
fprintf(stdout, "\n\nprocessing buffer\n");
if (control->buffer->n_datas > 0) {
fprintf(stdout, "creating pod\n");
struct spa_pod *pod = spa_pod_from_data(
control->buffer->datas[0].data,
control->buffer->datas[0].maxsize,
@ -1272,20 +1250,16 @@ static void control_process(void *d)
control->buffer->datas[0].chunk->size);
if (spa_pod_is_sequence(pod)) {
fprintf(stdout, "processing sequence\n");
struct spa_pod_sequence *sequence = (struct spa_pod_sequence *)pod;
struct spa_pod_control *pod_control;
SPA_POD_SEQUENCE_FOREACH(sequence, pod_control) {
fprintf(stdout, "processing sequence item\n");
if (pod_control->type == SPA_CONTROL_Properties) {
fprintf(stdout, "processing properties\n");
struct pw_loop *loop = pw_context_get_main_loop(impl->context);
pw_loop_invoke(loop, apply_props, 0, &pod_control->value, SPA_POD_SIZE(&pod_control->value), false, impl);
} else if (pod_control->type != SPA_CONTROL_OSC) {}
pw_loop_invoke(loop, apply_props, 0, &pod_control->value,
SPA_POD_SIZE(&pod_control->value), false, impl);
}
}
} else {
fprintf(stdout, "not a sequence\n");
}
}