formatting

This commit is contained in:
Frank Krick 2025-08-16 21:40:25 -04:00
parent 3d3f34d4b9
commit f6a52e0c11

View file

@ -1182,7 +1182,7 @@ struct impl {
struct pw_properties *control_props; struct pw_properties *control_props;
struct pw_stream *control; struct pw_stream *control;
struct spa_hook control_listener; struct spa_hook control_listener;
bool control_stream_active; bool control_stream_active;
struct spa_audio_info_raw info; struct spa_audio_info_raw info;
@ -1229,42 +1229,42 @@ 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)
{ {
const struct impl *impl = user_data; const struct impl *impl = user_data;
const struct spa_pod *props = data; const struct spa_pod *props = data;
spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT, props); spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT, props);
return 0; return 0;
} }
static void control_process(void *d) 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) if (control == NULL)
goto done; goto done;
if (control->buffer->n_datas > 0) { if (control->buffer->n_datas > 0) {
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,
control->buffer->datas[0].chunk->offset, control->buffer->datas[0].chunk->offset,
control->buffer->datas[0].chunk->size); control->buffer->datas[0].chunk->size);
if (spa_pod_is_sequence(pod)) { if (spa_pod_is_sequence(pod)) {
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) {
if (pod_control->type == SPA_CONTROL_Properties) { if (pod_control->type == SPA_CONTROL_Properties) {
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, pw_loop_invoke(loop, apply_props, 0, &pod_control->value,
SPA_POD_SIZE(&pod_control->value), false, impl); SPA_POD_SIZE(&pod_control->value), false, impl);
} }
} }
} }
} }
done: done:
pw_stream_queue_buffer(impl->control, control); pw_stream_queue_buffer(impl->control, control);
} }
static void playback_process(void *d) static void playback_process(void *d)
@ -1634,22 +1634,22 @@ static void control_destroy(void *d)
} }
static void control_state_changed(void *data, enum pw_stream_state old, static void control_state_changed(void *data, enum pw_stream_state old,
enum pw_stream_state state, const char *error) enum pw_stream_state state, const char *error)
{ {
struct impl *impl = data; struct impl *impl = data;
switch (state) { switch (state) {
case PW_STREAM_STATE_PAUSED: case PW_STREAM_STATE_PAUSED:
pw_stream_flush(impl->control, false); pw_stream_flush(impl->control, false);
break; break;
case PW_STREAM_STATE_ERROR: case PW_STREAM_STATE_ERROR:
pw_log_info("module %p: error: %s", impl, error); pw_log_info("module %p: error: %s", impl, error);
break; break;
case PW_STREAM_STATE_STREAMING: case PW_STREAM_STATE_STREAMING:
default: default:
break; break;
} }
return; return;
} }
static const struct pw_stream_events control_stream_events = { static const struct pw_stream_events control_stream_events = {