examples: set the MAPPABLE flag for MemFd

This commit is contained in:
Wim Taymans 2024-04-02 11:01:06 +02:00
parent 2f8740dee8
commit 77f3b7f6e4
3 changed files with 3 additions and 3 deletions

View file

@ -223,7 +223,7 @@ static void on_stream_add_buffer(void *_data, struct pw_buffer *buffer)
/* create the memfd on the buffer, set the type and flags */
d[0].type = SPA_DATA_MemFd;
d[0].flags = SPA_DATA_FLAG_READWRITE;
d[0].flags = SPA_DATA_FLAG_READWRITE | SPA_DATA_FLAG_MAPPABLE;
#ifdef HAVE_MEMFD_CREATE
d[0].fd = memfd_create("video-src-memfd", MFD_CLOEXEC | MFD_ALLOW_SEALING);
#else

View file

@ -308,7 +308,7 @@ static void on_stream_add_buffer(void *_data, struct pw_buffer *buffer)
printf("use memfd\n");
/* create the memfd on the buffer, set the type and flags */
d[0].type = SPA_DATA_MemFd;
d[0].flags = SPA_DATA_FLAG_READWRITE;
d[0].flags = SPA_DATA_FLAG_READWRITE | SPA_DATA_FLAG_MAPPABLE;
#ifdef HAVE_MEMFD_CREATE
d[0].fd = memfd_create("video-src-fixate-memfd", MFD_CLOEXEC | MFD_ALLOW_SEALING);
#else

View file

@ -237,7 +237,7 @@ static void on_stream_add_buffer(void *_data, struct pw_buffer *buffer)
/* create the memfd on the buffer, set the type and flags */
d[0].type = SPA_DATA_MemFd;
d[0].flags = SPA_DATA_FLAG_READWRITE;
d[0].flags = SPA_DATA_FLAG_READWRITE | SPA_DATA_FLAG_MAPPABLE;
#ifdef HAVE_MEMFD_CREATE
d[0].fd = memfd_create("video-src-memfd", MFD_CLOEXEC | MFD_ALLOW_SEALING);
#else