mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
stream: map buffers when using converter
This commit is contained in:
parent
96c87c3f7f
commit
e33c76f728
1 changed files with 6 additions and 2 deletions
|
|
@ -582,6 +582,7 @@ static int impl_port_use_buffers(struct spa_node *node, enum spa_direction direc
|
|||
struct stream *impl = SPA_CONTAINER_OF(node, struct stream, impl_node);
|
||||
struct pw_stream *stream = &impl->this;
|
||||
struct pw_type *t = impl->t;
|
||||
uint32_t flags = impl->flags;
|
||||
int i, j, prot, res;
|
||||
int size = 0;
|
||||
|
||||
|
|
@ -589,6 +590,9 @@ static int impl_port_use_buffers(struct spa_node *node, enum spa_direction direc
|
|||
|
||||
clear_buffers(stream);
|
||||
|
||||
if (impl->use_converter)
|
||||
SPA_FLAG_SET(flags, PW_STREAM_FLAG_MAP_BUFFERS);
|
||||
|
||||
for (i = 0; i < n_buffers; i++) {
|
||||
int buf_size = 0;
|
||||
struct buffer *b = &impl->buffers[i];
|
||||
|
|
@ -596,7 +600,7 @@ static int impl_port_use_buffers(struct spa_node *node, enum spa_direction direc
|
|||
b->flags = 0;
|
||||
b->id = buffers[i]->id;
|
||||
|
||||
if (SPA_FLAG_CHECK(impl->flags, PW_STREAM_FLAG_MAP_BUFFERS)) {
|
||||
if (SPA_FLAG_CHECK(flags, PW_STREAM_FLAG_MAP_BUFFERS)) {
|
||||
for (j = 0; j < buffers[i]->n_datas; j++) {
|
||||
struct spa_data *d = &buffers[i]->datas[j];
|
||||
if (d->type == t->data.MemFd ||
|
||||
|
|
@ -618,7 +622,7 @@ static int impl_port_use_buffers(struct spa_node *node, enum spa_direction direc
|
|||
} else
|
||||
size = buf_size;
|
||||
}
|
||||
pw_log_info("got buffer %d %d datas, total size %d", i,
|
||||
pw_log_info("got buffer %d %d datas, mapped size %d", i,
|
||||
buffers[i]->n_datas, size);
|
||||
}
|
||||
impl->n_buffers = n_buffers;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue