Go to the documentation of this file.
25 #ifndef PIPEWIRE_BUFFERS_H
26 #define PIPEWIRE_BUFFERS_H
37 #define PW_BUFFERS_FLAG_NONE 0
38 #define PW_BUFFERS_FLAG_NO_MEM (1<<0)
39 #define PW_BUFFERS_FLAG_SHARED (1<<1)
40 #define PW_BUFFERS_FLAG_DYNAMIC (1<<2)
50 struct spa_node *outnode, uint32_t out_port_id,
51 struct spa_node *innode, uint32_t in_port_id,
#define SPA_MAX(a, b)
Definition: defs.h:129
A memory pool is a collection of pw_memblocks.
Definition: src/pipewire/mem.h:72
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
struct pw_memblock * mem
allocated buffer memory
Definition: buffers.h:43
spa_direction
Definition: defs.h:78
#define SPA_DATA_FLAG_READWRITE
Definition: buffer/buffer.h:83
@ SPA_TYPE_OBJECT_ParamBuffers
Definition: build-12775836/doc/spa/utils/type.h:91
@ SPA_PARAM_BUFFERS_blocks
number of data blocks per buffer (Int)
Definition: param.h:83
@ SPA_PARAM_META_size
the expected maximum size the meta (Int)
Definition: param.h:94
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
#define SPA_POD_Int(val)
Definition: vararg.h:59
@ PW_MEMBLOCK_FLAG_READWRITE
Definition: src/pipewire/mem.h:53
#define spa_zero(x)
Definition: defs.h:303
struct spa_param_info params[N_PORT_PARAMS]
Definition: filter.c:110
@ SPA_PARAM_BUFFERS_dataType
possible memory types (Int, mask of enum spa_data_type)
Definition: param.h:87
#define MAX_ALIGN
Definition: buffers.c:41
int spa_pod_builder_raw_padded(struct spa_pod_builder *builder, const void *data, uint32_t size)
Definition: builder.h:167
#define MAX_BLOCKS
Definition: buffers.c:42
user data to add to an object
Definition: filter.c:75
@ SPA_PARAM_BUFFERS_buffers
number of buffers (Int)
Definition: param.h:82
#define SPA_CLAMP(v, low, high)
Definition: defs.h:135
struct pw_memblock * pw_mempool_alloc(struct pw_mempool *pool, enum pw_memblock_flags flags, uint32_t type, size_t size)
Allocate a memory block from the pool.
Definition: mem.c:464
#define SPA_BUFFER_ALLOC_FLAG_INLINE_ALL
Definition: alloc.h:42
struct spa_data * datas
Definition: alloc.h:49
#define PW_BUFFERS_FLAG_DYNAMIC
buffers have dynamic data
Definition: buffers.h:40
#define SPA_EXPORT
Definition: defs.h:208
@ SPA_DIRECTION_INPUT
Definition: defs.h:79
uint32_t n_metas
Definition: alloc.h:46
#define SPA_ROUND_UP_N(num, align)
Definition: defs.h:223
int spa_node_port_enum_params_sync(struct spa_node *node, enum spa_direction direction, uint32_t port_id, uint32_t id, uint32_t *index, const struct spa_pod *filter, struct spa_pod **param, struct spa_pod_builder *builder)
Definition: build-12775836/doc/spa/node/utils.h:92
int pw_buffers_negotiate(struct pw_context *context, uint32_t flags, struct spa_node *outnode, uint32_t out_port_id, struct spa_node *innode, uint32_t in_port_id, struct pw_buffers *result)
Definition: buffers.c:238
void * ptr
mapped pointer
Definition: src/pipewire/mem.h:92
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
struct spa_node * node
Definition: buffers.c:45
#define NAME
Definition: buffers.c:39
#define SPA_POD_OPT_Int(val)
Definition: parser.h:521
#define SPA_POD_BUILDER_INIT(buffer, size)
Definition: builder.h:71
uint32_t flags
data flags
Definition: buffer/buffer.h:84
int pw_context_debug_port_params(struct pw_context *this, struct spa_node *node, enum spa_direction direction, uint32_t port_id, uint32_t id, int err, const char *debug,...)
Definition: context.c:745
#define SPA_DATA_FLAG_DYNAMIC
data pointer can be changed
Definition: buffer/buffer.h:82
@ SPA_PARAM_BUFFERS_size
size of a data block memory (Int)
Definition: param.h:84
bool spa_pod_is_object_type(const struct spa_pod *pod, uint32_t type)
Definition: iter.h:387
int spa_pod_fixate(struct spa_pod *pod)
Definition: iter.h:442
uint32_t flags
Definition: alloc.h:44
#define SPA_FLAG_SET(field, flag)
Definition: defs.h:74
uint32_t n_metas
number of metadata
Definition: buffer/buffer.h:94
@ PW_MEMBLOCK_FLAG_SEAL
seal the fd
Definition: src/pipewire/mem.h:48
A Buffer.
Definition: buffer/buffer.h:93
Definition: build-12775836/doc/spa/node/node.h:53
@ SPA_PARAM_META_type
the metadata, one of enum spa_meta_type (Id enum spa_meta_type)
Definition: param.h:93
uint32_t n_buffers
number of port buffers
Definition: buffers.h:45
int pw_buffers_negotiate(struct pw_context *context, uint32_t flags, struct spa_node *outnode, uint32_t out_port_id, struct spa_node *innode, uint32_t in_port_id, struct pw_buffers *result)
Definition: buffers.c:238
uint32_t type
memory type, one of enum spa_data_type, when allocating memory, the type contains a bitmask of allowe...
Definition: buffer/buffer.h:71
#define PW_BUFFERS_FLAG_SHARED
buffers can be shared
Definition: buffers.h:39
@ PW_MEMBLOCK_FLAG_MAP
mmap the fd
Definition: src/pipewire/mem.h:49
@ SPA_LOG_LEVEL_DEBUG
Definition: build-12775836/doc/spa/support/log.h:51
#define SPA_FLAG_IS_SET(field, flag)
Definition: defs.h:73
struct pw_memmap * map
optional map when PW_MEMBLOCK_FLAG_MAP was given
Definition: src/pipewire/mem.h:86
void spa_pod_builder_init(struct spa_pod_builder *builder, void *data, uint32_t size)
Definition: builder.h:96
size_t mem_size
size of the total memory if not inlined
Definition: alloc.h:55
Definition: impl-port.c:1240
@ SPA_DIRECTION_OUTPUT
Definition: defs.h:80
uint32_t flags
flags
Definition: buffers.h:46
uint32_t port_id
Definition: buffers.c:47
void pw_buffers_clear(struct pw_buffers *buffers)
Definition: buffers.c:356
uint32_t flags
Definition: filter.c:95
#define spa_pod_parse_object(pod, type, id,...)
Definition: parser.h:560
#define spa_strerror(err)
Definition: result.h:51
@ SPA_PARAM_Meta
allowed metadata for buffers as SPA_TYPE_OBJECT_ParamMeta
Definition: param.h:50
Memory block structure.
Definition: src/pipewire/mem.h:78
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
uint32_t max_align
max of all alignments
Definition: alloc.h:45
#define SPA_MIN(a, b)
Definition: defs.h:123
#define SPA_ID_INVALID
Definition: defs.h:182
@ SPA_TYPE_OBJECT_ParamMeta
Definition: build-12775836/doc/spa/utils/type.h:92
uint32_t type
Definition: pod/pod.h:52
@ SPA_DATA_MemFd
generic fd, mmap to get to memory
Definition: buffer/buffer.h:49
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
void pw_buffers_clear(struct pw_buffers *buffers)
Definition: buffers.c:356
@ SPA_DATA_MemPtr
pointer to memory, the data field in struct spa_data is set.
Definition: buffer/buffer.h:47
@ SPA_PARAM_BUFFERS_stride
stride of data block memory (Int)
Definition: param.h:85
#define pw_log_warn(...)
Definition: src/pipewire/log.h:87
#define PW_BUFFERS_FLAG_NO_MEM
don't allocate buffer memory
Definition: buffers.h:38
Data for a buffer this stays constant for a buffer.
Definition: buffer/buffer.h:70
#define SPA_POD_SIZE(pod)
Definition: pod/pod.h:42
#define SPA_PTR_ALIGN(p, align, type)
Definition: defs.h:227
size_t skel_size
size of the struct spa_buffer and inlined meta/chunk/data
Definition: alloc.h:51
struct spa_buffer ** buffers
port buffers
Definition: buffers.h:44
#define SPA_POD_Id(val)
Definition: vararg.h:56
@ SPA_PARAM_BUFFERS_align
alignment of data block memory (Int)
Definition: param.h:86
struct buffer buffers[MAX_BUFFERS]
Definition: filter.c:114
information about the buffer layout
Definition: alloc.h:38
enum spa_direction direction
Definition: buffers.c:46
uint32_t n_datas
Definition: alloc.h:47
@ SPA_PARAM_Buffers
buffer configurations as SPA_TYPE_OBJECT_ParamBuffers
Definition: param.h:49
struct spa_meta * metas
Definition: alloc.h:48
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
#define PW_KEY_CPU_MAX_ALIGN
maximum alignment needed to support all CPU optimizations
Definition: src/pipewire/keys.h:92