Go to the documentation of this file.
23 #ifndef SPA_BUFFER_ALLOC_H
24 #define SPA_BUFFER_ALLOC_H
39 #define SPA_BUFFER_ALLOC_FLAG_INLINE_META (1<<0)
40 #define SPA_BUFFER_ALLOC_FLAG_INLINE_CHUNK (1<<1)
41 #define SPA_BUFFER_ALLOC_FLAG_INLINE_DATA (1<<2)
42 #define SPA_BUFFER_ALLOC_FLAG_INLINE_ALL 0b111
43 #define SPA_BUFFER_ALLOC_FLAG_NO_DATA (1<<3)
80 uint32_t n_metas,
struct spa_meta metas[],
81 uint32_t n_datas,
struct spa_data datas[],
82 uint32_t data_aligns[])
146 for (i = 0, size = 0; i < n_metas; i++)
163 for (i = 0,
size = 0; i < n_datas; i++) {
201 void *skel_mem,
void *data_mem)
206 void **dp, *skel, *
data;
222 for (i = 0; i < info->
n_metas; i++) {
244 for (i = 0; i < info->
n_datas; i++) {
279 uint32_t n_buffers,
struct spa_buffer *buffers[],
280 void *skel_mem,
void *data_mem)
283 for (i = 0; i < n_buffers; i++) {
316 uint32_t data_aligns[])
#define SPA_MAX(a, b)
Definition: defs.h:129
struct impl * impl
Definition: module-protocol-simple.c:104
int int const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:487
uint32_t maxsize
max size of data
Definition: buffer/buffer.h:87
Definition: module-filter-chain.c:176
#define SPA_BUFFER_ALLOC_FLAG_INLINE_CHUNK
add chunk data in the skeleton
Definition: alloc.h:40
unsigned int active
Definition: access-flatpak.c:60
int sm_access_flatpak_start(struct sm_media_session *session)
Definition: access-flatpak.c:179
int spa_buffer_alloc_fill_info(struct spa_buffer_alloc_info *info, uint32_t n_metas, struct spa_meta metas[], uint32_t n_datas, struct spa_data datas[], uint32_t data_aligns[])
Fill buffer allocation information.
Definition: alloc.h:79
uint32_t n_datas
number of data members
Definition: buffer/buffer.h:95
user data to add to an object
Definition: filter.c:75
uint8_t data[MAX_BUFFER]
Definition: module-profiler.c:87
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
#define SPA_BUFFER_ALLOC_FLAG_INLINE_ALL
Definition: alloc.h:42
struct spa_data * datas
Definition: alloc.h:49
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
size_t meta_size
size of the meta if not inlined
Definition: alloc.h:52
size_t chunk_size
size of the chunk if not inlined
Definition: alloc.h:53
uint32_t n_metas
Definition: alloc.h:46
#define SPA_ROUND_UP_N(num, align)
Definition: defs.h:223
#define PW_PERM_R
object can be seen and events can be received
Definition: permission.h:47
unsigned int is_portal
Definition: access-portal.c:104
struct spa_hook listener
Definition: access-flatpak.c:46
size_t data_size
size of the data if not inlined
Definition: alloc.h:54
uint32_t id
Definition: access-flatpak.c:54
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
Definition: permission.h:64
uint32_t id
Definition: module-echo-cancel.c:139
struct spa_audio_info_raw info
Definition: module-echo-cancel.c:145
#define NAME
Definition: access-flatpak.c:41
#define SPA_BUFFER_ALLOC_FLAG_NO_DATA
don't set data pointers
Definition: alloc.h:43
struct spa_list client_list
Definition: access-flatpak.c:48
uint32_t * data_aligns
Definition: alloc.h:50
#define spa_list_consume(pos, head, member)
Definition: list.h:96
struct spa_hook listener
Definition: access-flatpak.c:59
struct sm_client * obj
Definition: access-flatpak.c:52
struct spa_meta * metas
array of metadata
Definition: buffer/buffer.h:96
#define SESSION_KEY
Definition: access-portal.c:75
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
uint32_t flags
Definition: alloc.h:44
#define PW_TYPE_INTERFACE_Node
Definition: src/pipewire/node.h:50
#define SPA_BUFFER_ALLOC_FLAG_INLINE_META
add metadata data in the skeleton
Definition: alloc.h:39
uint32_t n_metas
number of metadata
Definition: buffer/buffer.h:94
A Buffer.
Definition: buffer/buffer.h:93
#define PW_PERM_ALL
Definition: permission.h:61
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
uint32_t permissions
bitmask of above permissions
Definition: permission.h:66
The client information.
Definition: client.h:55
struct spa_buffer ** spa_buffer_alloc_array(uint32_t n_buffers, uint32_t flags, uint32_t n_metas, struct spa_meta metas[], uint32_t n_datas, struct spa_data datas[], uint32_t data_aligns[])
Allocate an array of buffers.
Definition: alloc.h:313
struct spa_dict * props
extra properties
Definition: client.h:60
#define SPA_FLAG_IS_SET(field, flag)
Definition: defs.h:73
#define NAME
Definition: access-portal.c:74
void spa_list_init(struct spa_list *list)
Definition: list.h:44
size_t mem_size
size of the total memory if not inlined
Definition: alloc.h:55
media_role
Definition: access-portal.c:77
struct spa_chunk * chunk
valid chunk of memory
Definition: buffer/buffer.h:89
Definition: utils/dict.h:48
const char * spa_dict_lookup(const struct spa_dict *dict, const char *key)
Definition: utils/dict.h:99
#define PW_KEY_MEDIA_CATEGORY
Media Category: Playback, Capture, Duplex, Monitor, Manager.
Definition: src/pipewire/keys.h:279
#define PW_PERMISSION_INIT(id, p)
Definition: permission.h:69
#define SPA_BUFFER_ALLOC_FLAG_INLINE_DATA
add buffer data to the skeleton
Definition: alloc.h:41
@ MEDIA_ROLE_CAMERA
Definition: access-portal.c:80
struct spa_buffer * spa_buffer_alloc_layout(struct spa_buffer_alloc_info *info, void *skel_mem, void *data_mem)
Fill skeleton and data according to the allocation info.
Definition: alloc.h:200
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
Definition: module-protocol-native.c:103
uint32_t max_align
max of all alignments
Definition: alloc.h:45
struct sm_media_session * session
Definition: access-flatpak.c:45
char * app_id
Definition: access-portal.c:105
#define PW_ID_ANY
Definition: core.h:69
DBusConnection * bus
Definition: module-portal.c:89
uint32_t size
size of valid data.
Definition: buffer/buffer.h:61
#define spa_dbus_connection_get(c)
Definition: dbus.h:112
int spa_buffer_alloc_layout_array(struct spa_buffer_alloc_info *info, uint32_t n_buffers, struct spa_buffer *buffers[], void *skel_mem, void *data_mem)
Layout an array of buffers.
Definition: alloc.h:278
#define PW_TYPE_INTERFACE_Client
Definition: client.h:46
#define PW_PERM_X
methods can be called on the object.
Definition: permission.h:49
#define pw_log_warn(...)
Definition: src/pipewire/log.h:87
struct spa_data * datas
array of data members
Definition: buffer/buffer.h:97
unsigned int portal_managed
Definition: access-portal.c:102
Data for a buffer this stays constant for a buffer.
Definition: buffer/buffer.h:70
#define PW_KEY_ACCESS
how the client access is controlled
Definition: src/pipewire/keys.h:48
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:336
#define SPA_PTR_ALIGN(p, align, type)
Definition: defs.h:227
#define pw_log_info(...)
Definition: src/pipewire/log.h:88
@ MEDIA_ROLE_INVALID
Definition: access-portal.c:78
size_t skel_size
size of the struct spa_buffer and inlined meta/chunk/data
Definition: alloc.h:51
void * data
optional data pointer
Definition: buffer/buffer.h:88
Chunk of memory, can change for each buffer.
Definition: buffer/buffer.h:57
#define pw_client_update_permissions(c,...)
Definition: client.h:173
information about the buffer layout
Definition: alloc.h:38
int sm_access_portal_start(struct sm_media_session *session)
Definition: access-portal.c:642
enum media_role allowed_media_roles
Definition: access-portal.c:107
struct spa_list link
link in impl client_list
Definition: module-protocol-simple.c:103
uint32_t n_datas
Definition: alloc.h:47
struct spa_meta * metas
Definition: alloc.h:48
enum media_role media_roles
Definition: access-portal.c:106
unsigned int setup_complete
Definition: access-portal.c:103
Definition: properties.h:49
@ MEDIA_ROLE_NONE
Definition: access-portal.c:79
#define PW_KEY_CLIENT_ACCESS
how the client wants to be access controlled
Definition: src/pipewire/keys.h:49
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
#define MEDIA_ROLE_ALL
Definition: access-portal.c:82
#define spa_list_append(list, item)
Definition: list.h:81
#define SESSION_KEY
Definition: access-flatpak.c:42