mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-14 20:02:38 +00:00
libcamera: use the buffer datatype as the port type
In use buffers we need to respect the buffer data type.
This commit is contained in:
parent
ee2df25237
commit
6e0ba50a9c
|
@ -675,7 +675,14 @@ static int spa_libcamera_use_buffers(struct impl *this, struct spa_buffer **buff
|
|||
if (n_buffers > 0) {
|
||||
d = buffers[0]->datas;
|
||||
|
||||
port->memtype = SPA_DATA_DmaBuf;
|
||||
if (d[0].type == SPA_DATA_MemPtr && d[0].data != NULL) {
|
||||
port->memtype = SPA_DATA_MemPtr;
|
||||
} else if (d[0].type == SPA_DATA_DmaBuf) {
|
||||
port->memtype = SPA_DATA_DmaBuf;
|
||||
} else {
|
||||
spa_log_error(this->log, "v4l2: can't use buffers of type %d", d[0].type);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < n_buffers; i++) {
|
||||
|
|
Loading…
Reference in a new issue