This commit is contained in:
Frank Krick 2025-08-15 19:47:53 -04:00
parent 0a6d1ce7ef
commit 8e2d02c08c

View file

@ -1228,6 +1228,7 @@ 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)
{
const struct impl *impl = user_data;
const struct spa_pod *props = data;
spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT, props);
return 0;
@ -1235,8 +1236,6 @@ static int apply_props(struct spa_loop *loop, bool async, uint32_t seq, const vo
static void control_process(void *d)
{
fprintf(stdout, "control process\n");
struct impl *impl = d;
struct pw_buffer *control = pw_stream_dequeue_buffer(impl->control);
@ -1269,7 +1268,6 @@ static void control_process(void *d)
static void playback_process(void *d)
{
pw_log_error("playback process");
struct impl *impl = d;
struct pw_buffer *in, *out;
uint32_t i, data_size = 0;
@ -1627,12 +1625,38 @@ static const struct pw_stream_events out_stream_events = {
.param_changed = playback_param_changed,
};
static void control_destroy(void *d)
{
struct impl *impl = d;
spa_hook_remove(&impl->control_listener);
impl->control = NULL;
}
static void control_state_changed(void *data, enum pw_stream_state old,
enum pw_stream_state state, const char *error)
{
struct impl *impl = data;
switch (state) {
case PW_STREAM_STATE_PAUSED:
pw_stream_flush(impl->control, false);
break;
case PW_STREAM_STATE_ERROR:
pw_log_info("module %p: error: %s", impl, error);
break;
case PW_STREAM_STATE_STREAMING:
default:
break;
}
return;
}
static const struct pw_stream_events control_stream_events = {
PW_VERSION_STREAM_EVENTS,
.destroy = NULL,
.destroy = control_destroy,
.process = control_process,
.io_changed = NULL,
.state_changed = NULL,
.state_changed = control_state_changed,
.param_changed = NULL,
};
@ -1940,8 +1964,6 @@ static void copy_props(struct impl *impl, struct pw_properties *props, const cha
SPA_EXPORT
int pipewire__module_init(struct pw_impl_module *module, const char *args)
{
fprintf(stdout, "module init reached\n");
struct pw_context *context = pw_impl_module_get_context(module);
const struct pw_properties *p;
struct pw_properties *props;