PipeWire 1.7.0
Loading...
Searching...
No Matches
meta.h
Go to the documentation of this file.
1/* Simple Plugin API */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef SPA_META_H
6#define SPA_META_H
7
8#include <spa/utils/defs.h>
9#include <spa/pod/pod.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#ifndef SPA_API_META
16 #ifdef SPA_API_IMPL
17 #define SPA_API_META SPA_API_IMPL
18 #else
19 #define SPA_API_META static inline
20 #endif
21#endif
22
27
28enum spa_meta_type {
43
44 SPA_META_START_features = 0x10000, /* features start, these have 0 size, the
45 * type in the upper 16 bits and a bitmask in
46 * the lower 16 bits with type specific features. */
47};
48
49#define SPA_META_TYPE_FEATURES(type,features) (((type)<<16)|(features))
50
55
58struct spa_meta {
59 uint32_t type;
60 uint32_t size;
61 void *data;
62};
63
64SPA_API_META void *spa_meta_first(const struct spa_meta *m) {
65 return m->data;
68SPA_API_META void *spa_meta_end(const struct spa_meta *m) {
69 return SPA_PTROFF(m->data,m->size,void);
70}
71#define spa_meta_check(p,m) (SPA_PTROFF(p,sizeof(*(p)),void) <= spa_meta_end(m))
75
76 */
77struct spa_meta_header {
78#define SPA_META_HEADER_FLAG_DISCONT (1 << 0)
79#define SPA_META_HEADER_FLAG_CORRUPTED (1 << 1)
80#define SPA_META_HEADER_FLAG_MARKER (1 << 2)
81#define SPA_META_HEADER_FLAG_HEADER (1 << 3)
82#define SPA_META_HEADER_FLAG_GAP (1 << 4)
83#define SPA_META_HEADER_FLAG_DELTA_UNIT (1 << 5)
84 uint32_t flags;
85 uint32_t offset;
86 int64_t pts;
88 int64_t dts_offset;
89 uint64_t seq;
91};
92
94struct spa_meta_region {
96};
99 return m->region.size.width != 0 && m->region.size.height != 0;
101
103#define spa_meta_for_each(pos,meta) \
104 for ((pos) = (__typeof(pos))spa_meta_first(meta); \
105 spa_meta_check(pos, meta); \
106 (pos)++)
107
108/**
109 * Bitmap information
110 *
111 * This metadata contains a bitmap image in the given format and size.
112 * It is typically used for cursor images or other small images that are
113 * better transferred inline.
114 */
115struct spa_meta_bitmap {
116 uint32_t format;
117 * and invalid format and should be handled as if there is
118 * no new bitmap information. */
119 struct spa_rectangle size;
120 int32_t stride;
121 uint32_t offset;
125};
126
128 return m->format != 0;
136struct spa_meta_cursor {
137 uint32_t id;
139 uint32_t flags;
140 struct spa_point position;
143 uint32_t bitmap_offset;
144
147};
148
150 return m->id != 0;
152
156};
159struct spa_meta_busy {
160 uint32_t flags;
161 uint32_t count;
162};
171
177
190
192 * layout with 2 extra fds.
193 */
194#define SPA_META_FEATURE_SYNC_TIMELINE_RELEASE (1<<0)
195
197#define SPA_META_SYNC_TIMELINE_UNSCHEDULED_RELEASE (1<<0)
200 uint32_t flags;
201 uint32_t padding;
202 uint64_t acquire_point;
204 uint64_t release_point;
206};
207
212#ifdef __cplusplus
213} /* extern "C" */
214#endif
215
216#endif /* SPA_META_H */
spa/utils/defs.h
uint32_t int seq
Definition core.h:432
uint32_t id
Definition core.h:432
SPA_API_META void * spa_meta_first(const struct spa_meta *m)
Definition meta.h:72
SPA_API_META bool spa_meta_bitmap_is_valid(const struct spa_meta_bitmap *m)
Definition meta.h:141
spa_meta_videotransform_value
Definition meta.h:178
SPA_API_META void * spa_meta_end(const struct spa_meta *m)
Definition meta.h:76
spa_meta_type
Definition meta.h:35
SPA_API_META bool spa_meta_region_is_valid(const struct spa_meta_region *m)
Definition meta.h:112
SPA_API_META bool spa_meta_cursor_is_valid(const struct spa_meta_cursor *m)
Definition meta.h:163
@ SPA_META_TRANSFORMATION_Flipped270
flip then rotate around 270 degree counter-clockwise
Definition meta.h:188
@ SPA_META_TRANSFORMATION_Flipped
180 degree flipped around the vertical axis.
Definition meta.h:183
@ SPA_META_TRANSFORMATION_270
270 degree counter-clockwise
Definition meta.h:182
@ SPA_META_TRANSFORMATION_Flipped180
flip then rotate around 180 degree counter-clockwise
Definition meta.h:187
@ SPA_META_TRANSFORMATION_Flipped90
flip then rotate around 90 degree counter-clockwise
Definition meta.h:186
@ SPA_META_TRANSFORMATION_None
no transform
Definition meta.h:179
@ SPA_META_TRANSFORMATION_90
90 degree counter-clockwise
Definition meta.h:180
@ SPA_META_TRANSFORMATION_180
180 degree counter-clockwise
Definition meta.h:181
@ SPA_META_VideoDamage
array of struct spa_meta_region with damage, where an invalid entry or end-of-array marks the end.
Definition meta.h:39
@ SPA_META_Bitmap
struct spa_meta_bitmap
Definition meta.h:40
@ SPA_META_VideoTransform
struct spa_meta_transform
Definition meta.h:45
@ SPA_META_START_features
Definition meta.h:51
@ SPA_META_Cursor
struct spa_meta_cursor
Definition meta.h:41
@ SPA_META_Busy
don't write to buffer when count > 0
Definition meta.h:44
@ SPA_META_VideoCrop
struct spa_meta_region with cropping data
Definition meta.h:38
@ SPA_META_SyncTimeline
struct spa_meta_sync_timeline
Definition meta.h:46
@ SPA_META_Header
struct spa_meta_header
Definition meta.h:37
@ SPA_META_START_custom
Definition meta.h:49
@ SPA_META_Control
metadata contains a spa_meta_control associated with the data
Definition meta.h:42
@ SPA_META_Invalid
Definition meta.h:36
@ _SPA_META_LAST
not part of ABI/API
Definition meta.h:47
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition defs.h:223
#define SPA_API_META
Definition meta.h:26
spa/pod/pod.h
Bitmap information.
Definition meta.h:129
struct spa_rectangle size
width and height of bitmap
Definition meta.h:133
uint32_t format
bitmap video format, one of enum spa_video_format.
Definition meta.h:130
uint32_t offset
offset of bitmap data in this structure.
Definition meta.h:135
int32_t stride
stride of bitmap data
Definition meta.h:134
a busy counter for the buffer
Definition meta.h:173
uint32_t count
number of users busy with the buffer
Definition meta.h:175
a timed set of events associated with the buffer
Definition meta.h:168
struct spa_pod_sequence sequence
Definition meta.h:169
Cursor information.
Definition meta.h:150
uint32_t flags
extra flags
Definition meta.h:153
struct spa_point hotspot
offsets for hotspot in bitmap, this field has no meaning when there is no valid bitmap (see below)
Definition meta.h:155
uint32_t id
cursor id.
Definition meta.h:151
struct spa_point position
position on screen
Definition meta.h:154
uint32_t bitmap_offset
offset of bitmap meta in this structure.
Definition meta.h:157
Describes essential buffer header metadata such as flags and timestamps.
Definition meta.h:85
uint32_t offset
offset in current cycle
Definition meta.h:99
uint32_t flags
flags
Definition meta.h:98
int64_t pts
presentation timestamp in nanoseconds against the monotonic clock (CLOCK_MONOTONIC)
Definition meta.h:100
int64_t dts_offset
decoding timestamp as a difference with pts
Definition meta.h:102
metadata structure for Region or an array of these for RegionArray
Definition meta.h:108
struct spa_region region
Definition meta.h:109
Definition meta.h:211
uint32_t padding
Definition meta.h:217
uint64_t acquire_point
the timeline acquire point, this is when the data can be accessed.
Definition meta.h:218
uint64_t release_point
the timeline release point, this timeline point should be signaled when the data is no longer accesse...
Definition meta.h:220
uint32_t flags
Definition meta.h:216
a transformation of the buffer
Definition meta.h:192
uint32_t transform
orientation transformation that was applied to the buffer, one of enum spa_meta_videotransform_value
Definition meta.h:193
A metadata element.
Definition meta.h:66
uint32_t size
size of metadata
Definition meta.h:68
void * data
pointer to metadata
Definition meta.h:69
a sequence of timed controls
Definition pod.h:271
Definition defs.h:124
Definition defs.h:117
uint32_t width
Definition defs.h:118
uint32_t height
Definition defs.h:119
Definition defs.h:131
struct spa_rectangle size
Definition defs.h:133