mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
node: process -> ready
Change the process callback to ready to avoid confusion with the process method and it also describes better what happened.
This commit is contained in:
parent
8ae5424359
commit
3c78036a97
13 changed files with 28 additions and 27 deletions
|
|
@ -183,7 +183,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
|
||||
static void set_timer(struct impl *this, bool enabled)
|
||||
{
|
||||
if ((this->callbacks && this->callbacks->process) || this->props.live) {
|
||||
if ((this->callbacks && this->callbacks->ready) || this->props.live) {
|
||||
if (enabled) {
|
||||
if (this->props.live) {
|
||||
uint64_t next_time = this->start_time + this->elapsed_time;
|
||||
|
|
@ -205,7 +205,7 @@ static inline void read_timer(struct impl *this)
|
|||
{
|
||||
uint64_t expirations;
|
||||
|
||||
if ((this->callbacks && this->callbacks->process) || this->props.live) {
|
||||
if ((this->callbacks && this->callbacks->ready) || this->props.live) {
|
||||
if (read(this->timer_source.fd, &expirations, sizeof(uint64_t)) != sizeof(uint64_t))
|
||||
perror("read timerfd");
|
||||
}
|
||||
|
|
@ -225,8 +225,8 @@ static int consume_buffer(struct impl *this)
|
|||
|
||||
if (spa_list_is_empty(&this->ready)) {
|
||||
io->status = SPA_STATUS_NEED_BUFFER;
|
||||
if (this->callbacks->process)
|
||||
this->callbacks->process(this->callbacks_data, SPA_STATUS_NEED_BUFFER);
|
||||
if (this->callbacks->ready)
|
||||
this->callbacks->ready(this->callbacks_data, SPA_STATUS_NEED_BUFFER);
|
||||
}
|
||||
if (spa_list_is_empty(&this->ready)) {
|
||||
spa_log_error(this->log, NAME " %p: no buffers", this);
|
||||
|
|
@ -694,7 +694,7 @@ static int impl_node_process(struct spa_node *node)
|
|||
input->buffer_id = SPA_ID_INVALID;
|
||||
input->status = SPA_STATUS_OK;
|
||||
}
|
||||
if (this->callbacks == NULL || this->callbacks->process == NULL)
|
||||
if (this->callbacks == NULL || this->callbacks->ready == NULL)
|
||||
return consume_buffer(this);
|
||||
else
|
||||
return SPA_STATUS_OK;
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ static int fill_buffer(struct impl *this, struct buffer *b)
|
|||
|
||||
static void set_timer(struct impl *this, bool enabled)
|
||||
{
|
||||
if ((this->callbacks && this->callbacks->process) || this->props.live) {
|
||||
if ((this->callbacks && this->callbacks->ready) || this->props.live) {
|
||||
if (enabled) {
|
||||
if (this->props.live) {
|
||||
uint64_t next_time = this->start_time + this->elapsed_time;
|
||||
|
|
@ -225,7 +225,7 @@ static inline void read_timer(struct impl *this)
|
|||
{
|
||||
uint64_t expirations;
|
||||
|
||||
if ((this->callbacks && this->callbacks->process) || this->props.live) {
|
||||
if ((this->callbacks && this->callbacks->ready) || this->props.live) {
|
||||
if (read(this->timer_source.fd, &expirations, sizeof(uint64_t)) != sizeof(uint64_t))
|
||||
perror("read timerfd");
|
||||
}
|
||||
|
|
@ -282,8 +282,8 @@ static void on_output(struct spa_source *source)
|
|||
|
||||
res = make_buffer(this);
|
||||
|
||||
if (res == SPA_STATUS_HAVE_BUFFER && this->callbacks && this->callbacks->process)
|
||||
this->callbacks->process(this->callbacks_data, res);
|
||||
if (res == SPA_STATUS_HAVE_BUFFER && this->callbacks && this->callbacks->ready)
|
||||
this->callbacks->ready(this->callbacks_data, res);
|
||||
}
|
||||
|
||||
static int impl_node_send_command(struct spa_node *node, const struct spa_command *command)
|
||||
|
|
@ -728,7 +728,7 @@ static int impl_node_process(struct spa_node *node)
|
|||
this->io->buffer_id = SPA_ID_INVALID;
|
||||
}
|
||||
|
||||
if ((this->callbacks == NULL || this->callbacks->process == NULL) &&
|
||||
if ((this->callbacks == NULL || this->callbacks->ready == NULL) &&
|
||||
(io->status == SPA_STATUS_NEED_BUFFER))
|
||||
return make_buffer(this);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue