From 7a1bd163f7ca91963550d48c892da257ccb2d427 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 13 Feb 2019 12:43:15 +0100 Subject: [PATCH] node: remove port_send_command We don't want to do this, we use a sequence to change things at runtime. --- spa/include/spa/node/node.h | 17 -------- spa/plugins/alsa/alsa-sink.c | 9 ---- spa/plugins/alsa/alsa-source.c | 9 ---- spa/plugins/audioconvert/audioconvert.c | 16 -------- spa/plugins/audioconvert/channelmix.c | 10 ----- spa/plugins/audioconvert/fmtconvert.c | 10 ----- spa/plugins/audioconvert/merger.c | 10 ----- spa/plugins/audioconvert/resample.c | 10 ----- spa/plugins/audioconvert/splitter.c | 10 ----- spa/plugins/audiomixer/audiomixer.c | 10 ----- spa/plugins/audiotestsrc/audiotestsrc.c | 10 ----- spa/plugins/bluez5/a2dp-sink.c | 8 ---- spa/plugins/ffmpeg/ffmpeg-dec.c | 11 ----- spa/plugins/ffmpeg/ffmpeg-enc.c | 9 ---- spa/plugins/test/fakesink.c | 10 ----- spa/plugins/test/fakesrc.c | 10 ----- spa/plugins/v4l2/v4l2-source.c | 9 ---- spa/plugins/videotestsrc/videotestsrc.c | 10 ----- spa/plugins/volume/volume.c | 10 ----- src/extensions/client-node.h | 21 ++-------- src/modules/module-audio-dsp/floatmix.c | 11 ----- src/modules/module-client-node/client-node.c | 35 ---------------- .../module-client-node/client-stream.c | 25 ----------- .../module-client-node/protocol-native.c | 41 ------------------- src/modules/module-client-node/remote-node.c | 18 -------- src/pipewire/port.c | 16 -------- src/pipewire/private.h | 3 -- 27 files changed, 3 insertions(+), 365 deletions(-) diff --git a/spa/include/spa/node/node.h b/spa/include/spa/node/node.h index 017e3fb9c..80233ba81 100644 --- a/spa/include/spa/node/node.h +++ b/spa/include/spa/node/node.h @@ -486,22 +486,6 @@ struct spa_node { */ int (*port_reuse_buffer) (struct spa_node *node, uint32_t port_id, uint32_t buffer_id); - /** - * Send a command to a port - * - * This function must be called from the data thread. - * - * \param node a spa_node - * \param direction a direction - * \param port_id a port id - * \param command a command to send - * \return 0 on success - * -EINVAL when node is NULL - */ - int (*port_send_command) (struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command); /** * Process the node * @@ -536,7 +520,6 @@ struct spa_node { #define spa_node_port_alloc_buffers(n,...) (n)->port_alloc_buffers((n),__VA_ARGS__) #define spa_node_port_set_io(n,...) (n)->port_set_io((n),__VA_ARGS__) #define spa_node_port_reuse_buffer(n,...) (n)->port_reuse_buffer((n),__VA_ARGS__) -#define spa_node_port_send_command(n,...) (n)->port_send_command((n),__VA_ARGS__) #define spa_node_process(n) (n)->process((n)) #ifdef __cplusplus diff --git a/spa/plugins/alsa/alsa-sink.c b/spa/plugins/alsa/alsa-sink.c index 7d4aa65f2..358a44778 100644 --- a/spa/plugins/alsa/alsa-sink.c +++ b/spa/plugins/alsa/alsa-sink.c @@ -638,14 +638,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return -ENOTSUP; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, uint32_t port_id, const struct spa_command *command) -{ - spa_return_val_if_fail(node != NULL, -EINVAL); - return -ENOTSUP; -} - static int impl_node_process(struct spa_node *node) { struct state *this; @@ -701,7 +693,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/alsa/alsa-source.c b/spa/plugins/alsa/alsa-source.c index 4366e57c5..73edf2ba4 100644 --- a/spa/plugins/alsa/alsa-source.c +++ b/spa/plugins/alsa/alsa-source.c @@ -649,14 +649,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, uint32_t port_id, const struct spa_command *command) -{ - spa_return_val_if_fail(node != NULL, -EINVAL); - return -ENOTSUP; -} - static int impl_node_process(struct spa_node *node) { struct state *this; @@ -709,7 +701,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index d27fb6fa8..bdef6b594 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -832,21 +832,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return spa_node_port_reuse_buffer(this->fmt[SPA_DIRECTION_OUTPUT], port_id, buffer_id); } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - struct impl *this; - - spa_return_val_if_fail(node != NULL, -EINVAL); - - this = SPA_CONTAINER_OF(node, struct impl, node); - - return spa_node_port_send_command(this->fmt[direction], direction, port_id, command); -} - static int impl_node_process(struct spa_node *node) { struct impl *this; @@ -906,7 +891,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index c01db3c8a..64db4828b 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -1061,15 +1061,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static int process_control(struct impl *this, struct port *port, struct spa_pod_sequence *sequence) { struct spa_pod_control *c; @@ -1181,7 +1172,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index 3609c00dc..9c0711378 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -808,15 +808,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static int impl_node_process(struct spa_node *node) { struct impl *this; @@ -924,7 +915,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index cbcd8f357..6a1120d7f 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -862,15 +862,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static inline int get_in_buffer(struct impl *this, struct port *port, struct buffer **buf) { struct spa_io_buffers *io; @@ -1023,7 +1014,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/audioconvert/resample.c b/spa/plugins/audioconvert/resample.c index 889eb608b..5a0c559ce 100644 --- a/spa/plugins/audioconvert/resample.c +++ b/spa/plugins/audioconvert/resample.c @@ -722,15 +722,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static int process_control(struct impl *this, struct port *port, struct spa_pod_sequence *sequence) { struct spa_pod_control *c; @@ -861,7 +852,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index 2d2035f82..fe553fb8b 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -827,15 +827,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static int impl_node_process(struct spa_node *node) { struct impl *this; @@ -956,7 +947,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index 59d68ea8a..21d2c1660 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -711,15 +711,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return -ENOTSUP; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static inline void add_port_data(struct impl *this, void *out, size_t outsize, struct port *port, int layer) { @@ -927,7 +918,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index a2eb9b52e..fc8346d25 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -913,15 +913,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static int process_control(struct impl *this, struct spa_pod_sequence *sequence) { struct spa_pod_control *c; @@ -990,7 +981,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index c694c80e6..202522338 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -1248,13 +1248,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return -ENOTSUP; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, uint32_t port_id, const struct spa_command *command) -{ - return -ENOTSUP; -} - static int impl_node_process(struct spa_node *node) { struct impl *this; @@ -1312,7 +1305,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/ffmpeg/ffmpeg-dec.c b/spa/plugins/ffmpeg/ffmpeg-dec.c index 18119dee0..65c0875ff 100644 --- a/spa/plugins/ffmpeg/ffmpeg-dec.c +++ b/spa/plugins/ffmpeg/ffmpeg-dec.c @@ -463,16 +463,6 @@ spa_ffmpeg_dec_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, u return -ENOTSUP; } -static int -spa_ffmpeg_dec_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - - static const struct spa_node ffmpeg_dec_node = { SPA_VERSION_NODE, spa_ffmpeg_dec_node_enum_params, @@ -491,7 +481,6 @@ static const struct spa_node ffmpeg_dec_node = { spa_ffmpeg_dec_node_port_alloc_buffers, spa_ffmpeg_dec_node_port_set_io, spa_ffmpeg_dec_node_port_reuse_buffer, - spa_ffmpeg_dec_node_port_send_command, spa_ffmpeg_dec_node_process, }; diff --git a/spa/plugins/ffmpeg/ffmpeg-enc.c b/spa/plugins/ffmpeg/ffmpeg-enc.c index 0385ff63c..5b5d72f13 100644 --- a/spa/plugins/ffmpeg/ffmpeg-enc.c +++ b/spa/plugins/ffmpeg/ffmpeg-enc.c @@ -417,14 +417,6 @@ spa_ffmpeg_enc_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, u return -ENOTSUP; } -static int -spa_ffmpeg_enc_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, const struct spa_command *command) -{ - return -ENOTSUP; -} - static int spa_ffmpeg_enc_node_process(struct spa_node *node) { struct impl *this; @@ -468,7 +460,6 @@ static const struct spa_node ffmpeg_enc_node = { spa_ffmpeg_enc_node_port_alloc_buffers, spa_ffmpeg_enc_node_port_set_io, spa_ffmpeg_enc_node_port_reuse_buffer, - spa_ffmpeg_enc_node_port_send_command, spa_ffmpeg_enc_node_process, }; diff --git a/spa/plugins/test/fakesink.c b/spa/plugins/test/fakesink.c index f3c3362f7..265164417 100644 --- a/spa/plugins/test/fakesink.c +++ b/spa/plugins/test/fakesink.c @@ -665,15 +665,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return -ENOTSUP; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static int impl_node_process(struct spa_node *node) { struct impl *this; @@ -727,7 +718,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/test/fakesrc.c b/spa/plugins/test/fakesrc.c index 3ad0b7dc3..fe8fa9ce7 100644 --- a/spa/plugins/test/fakesrc.c +++ b/spa/plugins/test/fakesrc.c @@ -709,15 +709,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static int impl_node_process(struct spa_node *node) { struct impl *this; @@ -762,7 +753,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index df073930e..09c2ffa50 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -810,14 +810,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, return res; } -static int impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static uint32_t prop_to_control_id(uint32_t prop) { switch (prop) { @@ -947,7 +939,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index 093080700..9a8af7250 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -813,15 +813,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static int impl_node_process(struct spa_node *node) { struct impl *this; @@ -865,7 +856,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index cc882aec0..76444e6a2 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -667,15 +667,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return 0; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - static struct buffer *find_free_buffer(struct impl *this, struct port *port) { struct buffer *b; @@ -810,7 +801,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/src/extensions/client-node.h b/src/extensions/client-node.h index 4570e461b..b44e2d3eb 100644 --- a/src/extensions/client-node.h +++ b/src/extensions/client-node.h @@ -176,10 +176,9 @@ pw_client_node_proxy_event(struct pw_client_node_proxy *p, struct spa_event *eve #define PW_CLIENT_NODE_PROXY_EVENT_REMOVE_PORT 7 #define PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_PARAM 8 #define PW_CLIENT_NODE_PROXY_EVENT_PORT_USE_BUFFERS 9 -#define PW_CLIENT_NODE_PROXY_EVENT_PORT_COMMAND 10 -#define PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_IO 11 -#define PW_CLIENT_NODE_PROXY_EVENT_SET_ACTIVATION 12 -#define PW_CLIENT_NODE_PROXY_EVENT_NUM 13 +#define PW_CLIENT_NODE_PROXY_EVENT_PORT_SET_IO 10 +#define PW_CLIENT_NODE_PROXY_EVENT_SET_ACTIVATION 11 +#define PW_CLIENT_NODE_PROXY_EVENT_NUM 12 /** \ref pw_client_node events */ struct pw_client_node_proxy_events { @@ -319,18 +318,6 @@ struct pw_client_node_proxy_events { uint32_t mix_id, uint32_t n_buffers, struct pw_client_node_buffer *buffers); - /** - * Notify of a new port command - * - * \param direction a port direction - * \param port_id the port id - * \param command the command - */ - void (*port_command) (void *object, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command); - /** * Configure the io area with \a id of \a port_id. * @@ -390,8 +377,6 @@ pw_client_node_proxy_add_listener(struct pw_client_node_proxy *p, pw_resource_notify(r,struct pw_client_node_proxy_events,port_set_param,__VA_ARGS__) #define pw_client_node_resource_port_use_buffers(r,...) \ pw_resource_notify(r,struct pw_client_node_proxy_events,port_use_buffers,__VA_ARGS__) -#define pw_client_node_resource_port_command(r,...) \ - pw_resource_notify(r,struct pw_client_node_proxy_events,port_command,__VA_ARGS__) #define pw_client_node_resource_port_set_io(r,...) \ pw_resource_notify(r,struct pw_client_node_proxy_events,port_set_io,__VA_ARGS__) #define pw_client_node_resource_set_activation(r,...) \ diff --git a/src/modules/module-audio-dsp/floatmix.c b/src/modules/module-audio-dsp/floatmix.c index 41e7bf83d..4fbb5b57c 100644 --- a/src/modules/module-audio-dsp/floatmix.c +++ b/src/modules/module-audio-dsp/floatmix.c @@ -705,16 +705,6 @@ static int impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, return queue_buffer(this, port, &port->buffers[buffer_id]); } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, - const struct spa_command *command) -{ - return -ENOTSUP; -} - - #if defined (__SSE__) #include static void mix_2(float *dst, float *src1, float *src2, int n_samples) @@ -892,7 +882,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c index 70d486aa7..48f4324e8 100644 --- a/src/modules/module-client-node/client-node.c +++ b/src/modules/module-client-node/client-node.c @@ -981,30 +981,6 @@ impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, uint32_t bu return -ENOTSUP; } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, const struct spa_command *command) -{ - struct node *this; - - spa_return_val_if_fail(node != NULL, -EINVAL); - spa_return_val_if_fail(command != NULL, -EINVAL); - - this = SPA_CONTAINER_OF(node, struct node, node); - - if (this->resource == NULL) - return 0; - - spa_log_trace(this->log, "send command %s", - spa_debug_type_find_name(spa_type_node_command_id, SPA_NODE_COMMAND_ID(command))); - - pw_client_node_resource_port_command(this->resource, - direction, port_id, - command); - return 0; -} - static int impl_node_process(struct spa_node *node) { struct node *this = SPA_CONTAINER_OF(node, struct node, node); @@ -1187,7 +1163,6 @@ static const struct spa_node impl_node = { .port_alloc_buffers = impl_node_port_alloc_buffers, .port_set_io = impl_node_port_set_io, .port_reuse_buffer = impl_node_port_reuse_buffer, - .port_send_command = impl_node_port_send_command, .process = impl_node_process, }; @@ -1503,15 +1478,6 @@ impl_mix_port_reuse_buffer(struct spa_node *node, uint32_t port_id, uint32_t buf return impl_node_port_reuse_buffer(&p->node->node, p->id, buffer_id); } -static int -impl_mix_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, const struct spa_command *command) -{ - struct port *p = SPA_CONTAINER_OF(node, struct port, mix_node); - return impl_node_port_send_command(&p->node->node, direction, p->id, command); -} - static int impl_mix_process(struct spa_node *data) { return SPA_STATUS_HAVE_BUFFER; @@ -1528,7 +1494,6 @@ static const struct spa_node impl_port_mix = { .port_alloc_buffers = impl_mix_port_alloc_buffers, .port_set_io = impl_mix_port_set_io, .port_reuse_buffer = impl_mix_port_reuse_buffer, - .port_send_command = impl_mix_port_send_command, .process = impl_mix_process, }; diff --git a/src/modules/module-client-node/client-stream.c b/src/modules/module-client-node/client-stream.c index aab171fd4..5dbf77d6f 100644 --- a/src/modules/module-client-node/client-stream.c +++ b/src/modules/module-client-node/client-stream.c @@ -827,30 +827,6 @@ impl_node_port_reuse_buffer(struct spa_node *node, uint32_t port_id, uint32_t bu return spa_node_port_reuse_buffer(impl->adapter, port_id, buffer_id); } -static int -impl_node_port_send_command(struct spa_node *node, - enum spa_direction direction, - uint32_t port_id, const struct spa_command *command) -{ - struct node *this; - struct impl *impl; - int res; - - spa_return_val_if_fail(node != NULL, -EINVAL); - spa_return_val_if_fail(command != NULL, -EINVAL); - - this = SPA_CONTAINER_OF(node, struct node, node); - impl = this->impl; - - if (direction != impl->direction) - return -EINVAL; - - if ((res = spa_node_port_send_command(impl->adapter, direction, port_id, command)) < 0) - return res; - - return res; -} - static int impl_node_process(struct spa_node *node) { struct node *this = SPA_CONTAINER_OF(node, struct node, node); @@ -916,7 +892,6 @@ static const struct spa_node impl_node = { impl_node_port_alloc_buffers, impl_node_port_set_io, impl_node_port_reuse_buffer, - impl_node_port_send_command, impl_node_process, }; diff --git a/src/modules/module-client-node/protocol-native.c b/src/modules/module-client-node/protocol-native.c index 8af1d407c..06b0b6122 100644 --- a/src/modules/module-client-node/protocol-native.c +++ b/src/modules/module-client-node/protocol-native.c @@ -384,26 +384,6 @@ static int client_node_demarshal_port_use_buffers(void *object, void *data, size return 0; } -static int client_node_demarshal_port_command(void *object, void *data, size_t size) -{ - struct pw_proxy *proxy = object; - struct spa_pod_parser prs; - const struct spa_command *command; - uint32_t direction, port_id; - - spa_pod_parser_init(&prs, data, size); - if (spa_pod_parser_get_struct(&prs, - SPA_POD_Int(&direction), - SPA_POD_Int(&port_id), - SPA_POD_PodObject(&command)) < 0) - return -EINVAL; - - pw_proxy_notify(proxy, struct pw_client_node_proxy_events, port_command, 0, direction, - port_id, - command); - return 0; -} - static int client_node_demarshal_port_set_io(void *object, void *data, size_t size) { struct pw_proxy *proxy = object; @@ -672,25 +652,6 @@ client_node_marshal_port_use_buffers(void *object, pw_protocol_native_end_resource(resource, b); } -static void -client_node_marshal_port_command(void *object, - uint32_t direction, - uint32_t port_id, - const struct spa_command *command) -{ - struct pw_resource *resource = object; - struct spa_pod_builder *b; - - b = pw_protocol_native_begin_resource(resource, PW_CLIENT_NODE_PROXY_EVENT_PORT_COMMAND); - - spa_pod_builder_add_struct(b, - SPA_POD_Int(direction), - SPA_POD_Int(port_id), - SPA_POD_Pod(command)); - - pw_protocol_native_end_resource(resource, b); -} - static void client_node_marshal_port_set_io(void *object, uint32_t seq, @@ -948,7 +909,6 @@ static const struct pw_client_node_proxy_events pw_protocol_native_client_node_e &client_node_marshal_remove_port, &client_node_marshal_port_set_param, &client_node_marshal_port_use_buffers, - &client_node_marshal_port_command, &client_node_marshal_port_set_io, &client_node_marshal_set_activation, }; @@ -964,7 +924,6 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_node_ { &client_node_demarshal_remove_port, 0 }, { &client_node_demarshal_port_set_param, 0 }, { &client_node_demarshal_port_use_buffers, 0 }, - { &client_node_demarshal_port_command, 0 }, { &client_node_demarshal_port_set_io, 0 }, { &client_node_demarshal_set_activation, 0 } }; diff --git a/src/modules/module-client-node/remote-node.c b/src/modules/module-client-node/remote-node.c index cdbb485af..da80cff15 100644 --- a/src/modules/module-client-node/remote-node.c +++ b/src/modules/module-client-node/remote-node.c @@ -792,23 +792,6 @@ client_node_port_use_buffers(void *object, } -static void -client_node_port_command(void *object, - uint32_t direction, - uint32_t port_id, - const struct spa_command *command) -{ - struct pw_proxy *proxy = object; - struct node_data *data = proxy->user_data; - struct pw_port *port; - - port = pw_node_find_port(data->node, direction, port_id); - if (port == NULL) - return; - - pw_port_send_command(port, true, command); -} - static void client_node_port_set_io(void *object, uint32_t seq, @@ -942,7 +925,6 @@ static const struct pw_client_node_proxy_events client_node_events = { .remove_port = client_node_remove_port, .port_set_param = client_node_port_set_param, .port_use_buffers = client_node_port_use_buffers, - .port_command = client_node_port_command, .port_set_io = client_node_port_set_io, .set_activation = client_node_set_activation, }; diff --git a/src/pipewire/port.c b/src/pipewire/port.c index c09877340..5d18bbf7e 100644 --- a/src/pipewire/port.c +++ b/src/pipewire/port.c @@ -762,22 +762,6 @@ void pw_port_destroy(struct pw_port *port) free(port); } -static int -do_port_command(struct spa_loop *loop, - bool async, uint32_t seq, const void *data, size_t size, void *user_data) -{ - struct pw_port *port = user_data; - struct pw_node *node = port->node; - return spa_node_port_send_command(node->node, port->direction, port->port_id, data); -} - -SPA_EXPORT -int pw_port_send_command(struct pw_port *port, bool block, const struct spa_command *command) -{ - return pw_loop_invoke(port->node->data_loop, do_port_command, 0, - command, SPA_POD_SIZE(command), block, port); -} - int pw_port_for_each_param(struct pw_port *port, uint32_t param_id, uint32_t index, uint32_t max, diff --git a/src/pipewire/private.h b/src/pipewire/private.h index e1e8ac1cb..2c0339752 100644 --- a/src/pipewire/private.h +++ b/src/pipewire/private.h @@ -765,9 +765,6 @@ int pw_port_alloc_buffers(struct pw_port *port, uint32_t mix_id, struct spa_pod **params, uint32_t n_params, struct spa_buffer **buffers, uint32_t *n_buffers); -/** Send a command to a port */ -int pw_port_send_command(struct pw_port *port, bool block, const struct spa_command *command); - /** Change the state of the node */ int pw_node_set_state(struct pw_node *node, enum pw_node_state state);