mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
node: remove port_send_command
We don't want to do this, we use a sequence to change things at runtime.
This commit is contained in:
parent
04f1046113
commit
7a1bd163f7
27 changed files with 3 additions and 365 deletions
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue