mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
buffer: add MAPPABLE data flag
Add a MAPPABLE data flag that hints that the fd in the data is mappable with a simple mmap/munmap. Normally, DmaBuf is not mappable like that unless explicitly indicated with this flag. Set the MAPPABLE flag on the DmaBuf from v4l2 and libcamera fd. When asked, mmap the buffer memory in all cases when the MAPPABLE flag is set. This solves the case where v4l2 has exported DmaBuf and is streaming to node A and then node B links but doesn't get automatically mmaped memory. Fixes #3840
This commit is contained in:
parent
4715fa1775
commit
858d4e9e1c
6 changed files with 11 additions and 4 deletions
|
|
@ -65,6 +65,9 @@ struct spa_data {
|
|||
#define SPA_DATA_FLAG_WRITABLE (1u<<1) /**< data is writable */
|
||||
#define SPA_DATA_FLAG_DYNAMIC (1u<<2) /**< data pointer can be changed */
|
||||
#define SPA_DATA_FLAG_READWRITE (SPA_DATA_FLAG_READABLE|SPA_DATA_FLAG_WRITABLE)
|
||||
#define SPA_DATA_FLAG_MAPPABLE (1u<<3) /**< data is mappable with simple mmap/munmap. Some memory
|
||||
* types are not simply mappable (DmaBuf) unless explicitly
|
||||
* specified with this flag. */
|
||||
uint32_t flags; /**< data flags */
|
||||
int64_t fd; /**< optional fd for data */
|
||||
uint32_t mapoffset; /**< offset to map fd at */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue