mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
stream: add more timing info
Keep track of queued data in the stream Pass delay field around to make it possible to know about the raw software read/write pointer and the hardware one. Start stream position at 0
This commit is contained in:
parent
d3c203b744
commit
0d148654c0
8 changed files with 72 additions and 21 deletions
|
|
@ -163,6 +163,7 @@ struct impl {
|
|||
int other_fds[2];
|
||||
|
||||
struct pw_client_node_position *position;
|
||||
uint64_t start;
|
||||
};
|
||||
|
||||
/** \endcond */
|
||||
|
|
@ -818,6 +819,7 @@ impl_node_port_use_buffers(struct spa_node *node,
|
|||
}
|
||||
}
|
||||
}
|
||||
impl->start = -1;
|
||||
|
||||
pw_client_node_resource_port_use_buffers(this->resource,
|
||||
this->seq,
|
||||
|
|
@ -912,7 +914,10 @@ static int impl_node_process(struct spa_node *node)
|
|||
rq = SPA_MEMBER(impl->position, sizeof(struct pw_client_node_position),
|
||||
struct pw_driver_quantum);
|
||||
|
||||
if (impl->start == -1)
|
||||
impl->start = q->position;
|
||||
*rq = *q;
|
||||
rq->position -= impl->start;
|
||||
|
||||
if (write(this->writefd, &cmd, 8) != 8)
|
||||
spa_log_warn(this->log, "node %p: error %s", this, strerror(errno));
|
||||
|
|
|
|||
|
|
@ -771,10 +771,10 @@ static int impl_node_process(struct spa_node *node)
|
|||
{
|
||||
struct node *this = SPA_CONTAINER_OF(node, struct node, node);
|
||||
struct impl *impl = this->impl;
|
||||
struct pw_driver_quantum *q = impl->this.node->driver_node->rt.quantum;
|
||||
int status, trigger;
|
||||
|
||||
impl->ctrl.min_size = impl->ctrl.max_size =
|
||||
impl->this.node->driver_node->rt.quantum->size * sizeof(float);
|
||||
impl->ctrl.min_size = impl->ctrl.max_size = q->size * sizeof(float);
|
||||
|
||||
spa_log_trace(this->log, "%p: process %d", this, impl->ctrl.max_size);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue