mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
command: remove clock-update
This commit is contained in:
parent
6976175d65
commit
5a3eee9cac
5 changed files with 4 additions and 108 deletions
|
|
@ -335,13 +335,9 @@ static int impl_node_send_command(struct spa_node *node, const struct spa_comman
|
|||
|
||||
t = this->impl->t;
|
||||
|
||||
if (SPA_COMMAND_TYPE(command) == t->command_node.ClockUpdate) {
|
||||
pw_client_node_resource_command(this->resource, this->seq++, command);
|
||||
} else {
|
||||
/* send start */
|
||||
pw_client_node_resource_command(this->resource, this->seq, command);
|
||||
res = SPA_RESULT_RETURN_ASYNC(this->seq++);
|
||||
}
|
||||
pw_client_node_resource_command(this->resource, this->seq, command);
|
||||
res = SPA_RESULT_RETURN_ASYNC(this->seq++);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,36 +127,6 @@ static int suspend_node(struct pw_node *this)
|
|||
return res;
|
||||
}
|
||||
|
||||
static void send_clock_update(struct pw_node *this)
|
||||
{
|
||||
int res;
|
||||
struct spa_command_node_clock_update cu =
|
||||
SPA_COMMAND_NODE_CLOCK_UPDATE_INIT(this->core->type.command_node.ClockUpdate,
|
||||
SPA_COMMAND_NODE_CLOCK_UPDATE_TIME |
|
||||
SPA_COMMAND_NODE_CLOCK_UPDATE_SCALE |
|
||||
SPA_COMMAND_NODE_CLOCK_UPDATE_STATE |
|
||||
SPA_COMMAND_NODE_CLOCK_UPDATE_LATENCY, /* change_mask */
|
||||
1, /* rate */
|
||||
0, /* ticks */
|
||||
0, /* monotonic_time */
|
||||
0, /* offset */
|
||||
(1 << 16) | 1, /* scale */
|
||||
SPA_CLOCK_STATE_RUNNING, /* state */
|
||||
0, /* flags */
|
||||
0); /* latency */
|
||||
|
||||
if (this->clock && this->live) {
|
||||
cu.body.flags.value = SPA_COMMAND_NODE_CLOCK_UPDATE_FLAG_LIVE;
|
||||
res = spa_clock_get_time(this->clock,
|
||||
&cu.body.rate.value,
|
||||
&cu.body.ticks.value,
|
||||
&cu.body.monotonic_time.value);
|
||||
}
|
||||
res = spa_node_send_command(this->node, (struct spa_command *) &cu);
|
||||
if (res < 0)
|
||||
pw_log_debug("node %p: send clock update error %s", this, spa_strerror(res));
|
||||
}
|
||||
|
||||
static void node_unbind_func(void *data)
|
||||
{
|
||||
struct pw_resource *resource = data;
|
||||
|
|
@ -643,9 +613,6 @@ static void node_event(void *data, struct spa_event *event)
|
|||
struct pw_node *node = data;
|
||||
|
||||
pw_log_trace("node %p: event %d", node, SPA_EVENT_TYPE(event));
|
||||
if (SPA_EVENT_TYPE(event) == node->core->type.event_node.RequestClockUpdate) {
|
||||
send_clock_update(node);
|
||||
}
|
||||
spa_hook_list_call(&node->listener_list, struct pw_node_events, event, event);
|
||||
}
|
||||
|
||||
|
|
@ -1053,7 +1020,6 @@ int pw_node_set_state(struct pw_node *node, enum pw_node_state state)
|
|||
case PW_NODE_STATE_RUNNING:
|
||||
if (node->active) {
|
||||
node_activate(node);
|
||||
send_clock_update(node);
|
||||
res = start_node(node);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -869,21 +869,6 @@ static void client_node_command(void *object, uint32_t seq, const struct spa_com
|
|||
|
||||
pw_client_node_proxy_done(data->node_proxy, seq, res);
|
||||
}
|
||||
else if (SPA_COMMAND_TYPE(command) == remote->core->type.command_node.ClockUpdate) {
|
||||
struct spa_command_node_clock_update *cu = (__typeof__(cu)) command;
|
||||
|
||||
#if 0
|
||||
if (cu->body.flags.value & SPA_COMMAND_NODE_CLOCK_UPDATE_FLAG_LIVE) {
|
||||
pw_properties_set(stream->properties, PW_STREAM_PROP_IS_LIVE, "1");
|
||||
pw_properties_setf(stream->properties,
|
||||
PW_STREAM_PROP_LATENCY_MIN, "%" PRId64,
|
||||
cu->body.latency.value);
|
||||
}
|
||||
impl->last_ticks = cu->body.ticks.value;
|
||||
impl->last_rate = cu->body.rate.value;
|
||||
impl->last_monotonic = cu->body.monotonic_time.value;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
pw_log_warn("unhandled node command %d", SPA_COMMAND_TYPE(command));
|
||||
pw_client_node_proxy_done(data->node_proxy, seq, -ENOTSUP);
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@ do_call_process(struct spa_loop *loop,
|
|||
{
|
||||
struct stream *impl = user_data;
|
||||
struct pw_stream *stream = &impl->this;
|
||||
pw_log_trace("do process");
|
||||
spa_hook_list_call(&stream->listener_list, struct pw_stream_events, process);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue