mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-08 13:30:08 -05:00
More hacking
Move array and map to pinos Move more things to spa lib ControlCmd -> Message Make pinos log, use for plugins as well work on ringbuffer in alsa and nodes work on making registry with all objects
This commit is contained in:
parent
a1c0bef2ed
commit
7e46f9e3ad
81 changed files with 1831 additions and 1030 deletions
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "memfd-wrappers.h"
|
||||
|
||||
#include <pinos/client/log.h>
|
||||
#include <pinos/server/utils.h>
|
||||
|
||||
#undef USE_MEMFD
|
||||
|
|
@ -47,21 +48,21 @@ pinos_memblock_alloc (PinosMemblockFlags flags,
|
|||
#ifdef USE_MEMFD
|
||||
mem->fd = memfd_create ("pinos-memfd", MFD_CLOEXEC | MFD_ALLOW_SEALING);
|
||||
if (mem->fd == -1) {
|
||||
fprintf (stderr, "Failed to create memfd: %s\n", strerror (errno));
|
||||
pinos_log_error ("Failed to create memfd: %s\n", strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
char filename[] = "/dev/shm/spa-tmpfile.XXXXXX";
|
||||
mem->fd = mkostemp (filename, O_CLOEXEC);
|
||||
if (mem->fd == -1) {
|
||||
fprintf (stderr, "Failed to create temporary file: %s\n", strerror (errno));
|
||||
pinos_log_error ("Failed to create temporary file: %s\n", strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
unlink (filename);
|
||||
#endif
|
||||
|
||||
if (ftruncate (mem->fd, size) < 0) {
|
||||
g_warning ("Failed to truncate temporary file: %s", strerror (errno));
|
||||
pinos_log_warn ("Failed to truncate temporary file: %s", strerror (errno));
|
||||
close (mem->fd);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -69,7 +70,7 @@ pinos_memblock_alloc (PinosMemblockFlags flags,
|
|||
if (flags & PINOS_MEMBLOCK_FLAG_SEAL) {
|
||||
unsigned int seals = F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL;
|
||||
if (fcntl (mem->fd, F_ADD_SEALS, seals) == -1) {
|
||||
g_warning ("Failed to add seals: %s", strerror (errno));
|
||||
pinos_log_warn ("Failed to add seals: %s", strerror (errno));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue