mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-16 07:00:00 -05:00
cleanup
This commit is contained in:
parent
1c53fdbfc0
commit
0a6d1ce7ef
1 changed files with 4 additions and 30 deletions
|
|
@ -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)
|
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;
|
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);
|
spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT, props);
|
||||||
|
|
||||||
/* props was allocated with spa_pod_copy before invoking */
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1248,23 +1240,9 @@ static void control_process(void *d)
|
||||||
struct impl *impl = d;
|
struct impl *impl = d;
|
||||||
|
|
||||||
struct pw_buffer *control = pw_stream_dequeue_buffer(impl->control);
|
struct pw_buffer *control = pw_stream_dequeue_buffer(impl->control);
|
||||||
/*
|
if (control == NULL)
|
||||||
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");
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
|
||||||
fprintf(stdout, "\n\nprocessing buffer\n");
|
|
||||||
if (control->buffer->n_datas > 0) {
|
if (control->buffer->n_datas > 0) {
|
||||||
fprintf(stdout, "creating pod\n");
|
|
||||||
struct spa_pod *pod = spa_pod_from_data(
|
struct spa_pod *pod = spa_pod_from_data(
|
||||||
control->buffer->datas[0].data,
|
control->buffer->datas[0].data,
|
||||||
control->buffer->datas[0].maxsize,
|
control->buffer->datas[0].maxsize,
|
||||||
|
|
@ -1272,20 +1250,16 @@ static void control_process(void *d)
|
||||||
control->buffer->datas[0].chunk->size);
|
control->buffer->datas[0].chunk->size);
|
||||||
|
|
||||||
if (spa_pod_is_sequence(pod)) {
|
if (spa_pod_is_sequence(pod)) {
|
||||||
fprintf(stdout, "processing sequence\n");
|
|
||||||
struct spa_pod_sequence *sequence = (struct spa_pod_sequence *)pod;
|
struct spa_pod_sequence *sequence = (struct spa_pod_sequence *)pod;
|
||||||
|
|
||||||
struct spa_pod_control *pod_control;
|
struct spa_pod_control *pod_control;
|
||||||
SPA_POD_SEQUENCE_FOREACH(sequence, pod_control) {
|
SPA_POD_SEQUENCE_FOREACH(sequence, pod_control) {
|
||||||
fprintf(stdout, "processing sequence item\n");
|
|
||||||
if (pod_control->type == SPA_CONTROL_Properties) {
|
if (pod_control->type == SPA_CONTROL_Properties) {
|
||||||
fprintf(stdout, "processing properties\n");
|
|
||||||
struct pw_loop *loop = pw_context_get_main_loop(impl->context);
|
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);
|
pw_loop_invoke(loop, apply_props, 0, &pod_control->value,
|
||||||
} else if (pod_control->type != SPA_CONTROL_OSC) {}
|
SPA_POD_SIZE(&pod_control->value), false, impl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
fprintf(stdout, "not a sequence\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue