mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
audiomixer: small improvements
Improve the audiomixer state handling Improve PortIO status handling.
This commit is contained in:
parent
e734d239b9
commit
fe68ca1be3
9 changed files with 109 additions and 97 deletions
|
|
@ -804,12 +804,15 @@ spa_v4l2_source_node_process_output (SpaNode *node)
|
|||
spa_return_val_if_fail (node != NULL, SPA_RESULT_INVALID_ARGUMENTS);
|
||||
|
||||
this = SPA_CONTAINER_OF (node, SpaV4l2Source, node);
|
||||
io = this->state[0].io;
|
||||
spa_return_val_if_fail (io != NULL, SPA_RESULT_WRONG_STATE);
|
||||
|
||||
if ((io = this->state[0].io)) {
|
||||
if (io->buffer_id != SPA_ID_INVALID) {
|
||||
res = spa_v4l2_buffer_recycle (this, io->buffer_id);
|
||||
io->buffer_id = SPA_ID_INVALID;
|
||||
}
|
||||
if (io->status == SPA_RESULT_HAVE_BUFFER)
|
||||
return SPA_RESULT_HAVE_BUFFER;
|
||||
|
||||
if (io->buffer_id != SPA_ID_INVALID) {
|
||||
res = spa_v4l2_buffer_recycle (this, io->buffer_id);
|
||||
io->buffer_id = SPA_ID_INVALID;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -933,7 +933,7 @@ mmap_read (SpaV4l2Source *this)
|
|||
V4l2Buffer *b;
|
||||
SpaData *d;
|
||||
int64_t pts;
|
||||
SpaPortIO *io;
|
||||
SpaPortIO *io = state->io;
|
||||
|
||||
CLEAR(buf);
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
|
|
@ -972,12 +972,12 @@ mmap_read (SpaV4l2Source *this)
|
|||
d[0].chunk->size = buf.bytesused;
|
||||
d[0].chunk->stride = state->fmt.fmt.pix.bytesperline;
|
||||
|
||||
if ((io = state->io)) {
|
||||
{
|
||||
SpaEvent event = SPA_EVENT_INIT (this->type.event_node.HaveOutput);
|
||||
|
||||
b->outstanding = true;
|
||||
io->buffer_id = b->outbuf->id;
|
||||
io->status = SPA_RESULT_OK;
|
||||
io->status = SPA_RESULT_HAVE_BUFFER;
|
||||
|
||||
this->event_cb (&this->node, &event, this->user_data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue