PipeWire  0.3.45
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 
46 #define PW_BUFFERS_FLAG_NONE 0
47 #define PW_BUFFERS_FLAG_NO_MEM (1<<0)
48 #define PW_BUFFERS_FLAG_SHARED (1<<1)
49 #define PW_BUFFERS_FLAG_DYNAMIC (1<<2)
50 #define PW_BUFFERS_FLAG_SHARED_MEM (1<<3)
52 struct pw_buffers {
53  struct pw_memblock *mem;
54  struct spa_buffer **buffers;
55  uint32_t n_buffers;
56  uint32_t flags;
57 };
58 
59 int pw_buffers_negotiate(struct pw_context *context, uint32_t flags,
60  struct spa_node *outnode, uint32_t out_port_id,
61  struct spa_node *innode, uint32_t in_port_id,
62  struct pw_buffers *result);
63 
64 void pw_buffers_clear(struct pw_buffers *buffers);
65 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* PIPEWIRE_BUFFERS_H */
pipewire/context.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:239
void pw_buffers_clear(struct pw_buffers *buffers)
Definition: buffers.c:359
spa/node/node.h
pipewire/mem.h
Definition: buffers.h:61
uint32_t flags
flags
Definition: buffers.h:65
uint32_t n_buffers
number of port buffers
Definition: buffers.h:64
struct spa_buffer ** buffers
port buffers
Definition: buffers.h:63
struct pw_memblock * mem
allocated buffer memory
Definition: buffers.h:62
Memory block structure.
Definition: mem.h:83
A Buffer.
Definition: buffer.h:105
Definition: node.h:61