PipeWire  0.3.29
buffers.h
Go to the documentation of this file.
1 /* PipeWire
2  *
3  * Copyright © 2019 Wim Taymans
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef PIPEWIRE_BUFFERS_H
26 #define PIPEWIRE_BUFFERS_H
27 
28 #include <spa/node/node.h>
29 
30 #include <pipewire/context.h>
31 #include <pipewire/mem.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
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)
42 struct pw_buffers {
43  struct pw_memblock *mem;
44  struct spa_buffer **buffers;
45  uint32_t n_buffers;
46  uint32_t flags;
47 };
48 
49 int pw_buffers_negotiate(struct pw_context *context, uint32_t flags,
50  struct spa_node *outnode, uint32_t out_port_id,
51  struct spa_node *innode, uint32_t in_port_id,
52  struct pw_buffers *result);
53 
54 void pw_buffers_clear(struct pw_buffers *buffers);
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 
60 #endif /* PIPEWIRE_BUFFERS_H */
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 pw_buffers_clear(struct pw_buffers *buffers)
Definition: buffers.c:356
Definition: buffers.h:42
uint32_t flags
flags
Definition: buffers.h:46
uint32_t n_buffers
number of port buffers
Definition: buffers.h:45
struct spa_buffer ** buffers
port buffers
Definition: buffers.h:44
struct pw_memblock * mem
allocated buffer memory
Definition: buffers.h:43
Memory block structure.
Definition: src/pipewire/mem.h:78
A Buffer.
Definition: buffer/buffer.h:93
Definition: output/doc/spa/node/node.h:52