libvdo
vdo-types.h
Go to the documentation of this file.
1 
9 #ifndef __VDO_TYPES_H__
10 #define __VDO_TYPES_H__
11 
12 #include <glib-object.h>
13 
14 G_BEGIN_DECLS
15 
16 #define VDO_TYPE_WDR_MODE (vdo_wdr_mode_get_type())
17 #define VDO_TYPE_FORMAT (vdo_format_get_type())
18 #define VDO_TYPE_H264_PROFILE (vdo_h264_profile_get_type())
19 #define VDO_TYPE_H265_PROFILE (vdo_h265_profile_get_type())
20 #define VDO_TYPE_AV1_PROFILE (vdo_av1_profile_get_type())
21 #define VDO_TYPE_RATE_CONTROL_MODE (vdo_rate_control_mode_get_type())
22 #define VDO_TYPE_RATE_CONTROL_PRIORITY (vdo_rate_control_priority_get_type())
23 #define VDO_TYPE_FRAME_TYPE (vdo_frame_type_get_type())
24 #define VDO_TYPE_TIMESTAMP (vdo_timestamp_get_type())
25 #define VDO_TYPE_BUFFER_ACCESS (vdo_buffer_access_get_type())
26 #define VDO_TYPE_BUFFER_STRATEGY (vdo_buffer_strategy_get_type())
27 #define VDO_TYPE_ZIPSTREAM_PROFILE (vdo_zipstream_profile_get_type())
28 #define VDO_TYPE_ZIPSTREAM_GDR (vdo_zipstream_gdr_get_type())
29 
33 typedef enum {
42 } VdoWdrMode;
43 
49 typedef enum {
56  VDO_FORMAT_BAYER = 4,
57  VDO_FORMAT_IVS = 5,
58  VDO_FORMAT_RAW = 6,
59  VDO_FORMAT_RGBA = 7,
65 } VdoFormat;
66 
74 static inline gboolean
75 vdo_format_is_encoded(VdoFormat format)
76 {
77  return (format == VDO_FORMAT_H264 ||
78  format == VDO_FORMAT_H265 ||
79  format == VDO_FORMAT_AV1 ||
80  format == VDO_FORMAT_AVIF ||
81  format == VDO_FORMAT_JPEG);
82 }
83 
91 static inline gboolean
92 vdo_format_is_motion_encoded(VdoFormat format)
93 {
94  switch (format) {
95  case VDO_FORMAT_AVIF:
96  case VDO_FORMAT_JPEG:
97  return FALSE;
98  default:
99  return vdo_format_is_encoded(format);
100  }
101 }
102 
106 typedef enum {
112 
116 typedef enum {
121 
125 typedef enum {
129 } VdoAV1Profile;
130 
134 typedef enum {
141 
145 typedef enum {
151 
157 typedef enum {
160  VDO_FRAME_TYPE_H264_SPS = 1,
161  VDO_FRAME_TYPE_H264_PPS = 2,
162  VDO_FRAME_TYPE_H264_SEI = 3,
166  VDO_FRAME_TYPE_H264_I = 5,
171  VDO_FRAME_TYPE_H265_SPS = 8,
172  VDO_FRAME_TYPE_H265_PPS = 9,
173  VDO_FRAME_TYPE_H265_VPS = 10,
174  VDO_FRAME_TYPE_H265_SEI = 11,
178  VDO_FRAME_TYPE_H265_I = 13,
185  VDO_FRAME_TYPE_RAW = 18,
194 } VdoFrameType;
195 
199 typedef enum {
205 
209 typedef enum {
216 
220 typedef enum {
222  VDO_CHUNK_ERROR = 1u << 31u,
223 } VdoChunkType;
224 
228 typedef enum {
230  VDO_CHUNK_OPTION_MMAP = 1u << 31u,
232 
236 typedef struct {
237  union __attribute__((__may_alias__)) {
238  gpointer data;
239  gchar* chars;
240  guint8* bytes;
241  };
242  gsize size;
244  gint64 offset;
245 } VdoChunk;
246 
250 typedef enum {
253 
259 
265  VDO_TIMESTAMP_DIFF = 4,
266 
272 
278 
284 
290  VDO_TIMESTAMP_DIFF | VDO_TIMESTAMP_MONO_CLIENT \
292 
298  VDO_TIMESTAMP_DIFF | VDO_TIMESTAMP_MONO_CLIENT \
301 
308 typedef enum {
317 } VdoIntent;
318 
324 typedef enum {
340 
350 typedef enum {
353 
356 
359 
362 
365 
368 
371 
374 
377 
381 
390 typedef enum {
393 
395 
396  VDO_BUFFER_STRATEGY_INPUT = 1,
397 
399  VDO_BUFFER_STRATEGY_EXTERNAL = 2,
401 
407 
411 
415 typedef struct {
416  gpointer data;
417  gsize data_size;
418 } VdoMemChunk;
419 
423 typedef struct {
424  guint32 width;
425  guint32 height;
426 } VdoResolution;
427 
431 typedef struct {
432  gsize count;
433  __extension__ VdoResolution resolutions[];
435 
439 typedef struct {
440  guint width;
441  guint height;
442  guint x;
443  guint y;
444 } VdoRect;
445 
471 typedef union __attribute__((__may_alias__)) {
472  __extension__ struct {gint32 x; gint32 y;};
473  __extension__ struct {gint32 w; gint32 h;};
474  __extension__ struct {gint32 num; gint32 den;};
475  gint32 val[2];
476 } VdoPair32i;
477 
503 typedef union __attribute__((__may_alias__)) {
504  __extension__ struct {guint32 x; guint32 y;};
505  __extension__ struct {guint32 w; guint32 h;};
506  __extension__ struct {guint32 num; guint32 den;};
507  VdoResolution res;
508  guint32 val[2];
509 } VdoPair32u;
510 
530 typedef union __attribute__((__may_alias__)) {
531  __extension__ struct {gint32 x; gint32 y; gint32 w; gint32 h;};
532  gint32 val[4];
533 } VdoQuad32i;
534 
554 typedef union __attribute__((__may_alias__)) {
555  __extension__ struct {guint32 x; guint32 y; guint32 w; guint32 h;};
556  __extension__ struct {guint32 min; guint32 target; guint32 max;};
557  guint32 val[4];
558 } VdoQuad32u;
559 
566 
573 
580 
587 
594 
601 
609 
616 
623 
634 
635 GType vdo_timestamp_get_type(void);
636 
637 GType vdo_intent_get_type(void);
638 
639 GType vdo_buffer_access_get_type(void);
640 
641 GType vdo_buffer_strategy_get_type(void);
642 
644 const char *vdo_format_to_str(VdoFormat format);
645 
646 G_END_DECLS
647 
648 #endif
A video chunk.
Definition: vdo-types.h:236
VdoChunkType type
Definition: vdo-types.h:243
gint64 offset
Definition: vdo-types.h:244
gsize size
Definition: vdo-types.h:241
A memory chunk.
Definition: vdo-types.h:415
gsize data_size
Definition: vdo-types.h:417
gpointer data
Definition: vdo-types.h:416
A representation of a rectangle with a position.
Definition: vdo-types.h:439
guint x
Definition: vdo-types.h:442
guint y
Definition: vdo-types.h:443
guint width
Definition: vdo-types.h:440
guint height
Definition: vdo-types.h:441
A set of resolutions.
Definition: vdo-types.h:431
gsize count
Definition: vdo-types.h:432
A resolution.
Definition: vdo-types.h:423
guint32 height
Definition: vdo-types.h:425
guint32 width
Definition: vdo-types.h:424
VdoStreamTimestamp
Timestamp types.
Definition: vdo-types.h:250
@ VDO_TIMESTAMP_MONO_SERVER
Definition: vdo-types.h:277
@ VDO_TIMESTAMP_UTC
Definition: vdo-types.h:258
@ VDO_TIMESTAMP_MONO_CAPTURE
Definition: vdo-types.h:271
@ VDO_TIMESTAMP_MONO_CLIENT
Definition: vdo-types.h:283
@ VDO_TIMESTAMP_ZIPSTREAM
Definition: vdo-types.h:264
@ VDO_TIMESTAMP_MONO_CLIENT_SERVER_DIFF
Definition: vdo-types.h:289
@ VDO_TIMESTAMP_NONE
Definition: vdo-types.h:252
@ VDO_TIMESTAMP_MONO_CLIENT_CAPTURE_DIFF
Definition: vdo-types.h:297
VdoH265Profile
H.265 profiles.
Definition: vdo-types.h:116
@ VDO_H265_PROFILE_NONE
Definition: vdo-types.h:117
@ VDO_H265_PROFILE_MAIN_10
Definition: vdo-types.h:119
@ VDO_H265_PROFILE_MAIN
Definition: vdo-types.h:118
GType vdo_frame_type_get_type(void)
Get vdo frame type.
GType vdo_h265_profile_get_type(void)
Get h265 profile type.
VdoRateControlPriority
Bitrate control priorities.
Definition: vdo-types.h:145
@ VDO_RATE_CONTROL_PRIORITY_NONE
Definition: vdo-types.h:146
@ VDO_RATE_CONTROL_PRIORITY_FRAMERATE
Definition: vdo-types.h:147
@ VDO_RATE_CONTROL_PRIORITY_QUALITY
Definition: vdo-types.h:148
@ VDO_RATE_CONTROL_PRIORITY_FULL_FRAMERATE
Definition: vdo-types.h:149
VdoH264Profile
H.264 profiles.
Definition: vdo-types.h:106
@ VDO_H264_PROFILE_MAIN
Definition: vdo-types.h:109
@ VDO_H264_PROFILE_NONE
Definition: vdo-types.h:107
@ VDO_H264_PROFILE_HIGH
Definition: vdo-types.h:110
@ VDO_H264_PROFILE_BASELINE
Definition: vdo-types.h:108
GType vdo_av1_profile_get_type(void)
Get AV1 profile type.
GType vdo_rate_control_priority_get_type(void)
Get rate control priority type.
GType vdo_rate_control_mode_get_type(void)
Get rate control mode type.
union __attribute__((__may_alias__))
Generic object for two signed 32bit values.
Definition: vdo-types.h:471
VdoFormat
Video formats.
Definition: vdo-types.h:49
@ VDO_FORMAT_NONE
Definition: vdo-types.h:50
@ VDO_FORMAT_AV1
Definition: vdo-types.h:63
@ VDO_FORMAT_YUV
Definition: vdo-types.h:54
@ VDO_FORMAT_JPEG
Definition: vdo-types.h:53
@ VDO_FORMAT_RGB
Definition: vdo-types.h:61
@ VDO_FORMAT_PLANAR_RGB
Definition: vdo-types.h:62
@ VDO_FORMAT_AVIF
Definition: vdo-types.h:64
@ VDO_FORMAT_H265
Definition: vdo-types.h:52
@ VDO_FORMAT_H264
Definition: vdo-types.h:51
VdoZipStreamProfile
Zipstream profiles.
Definition: vdo-types.h:199
@ VDO_ZIPSTREAM_PROFILE_NONE
Definition: vdo-types.h:200
@ VDO_ZIPSTREAM_PROFILE_LIVE
Definition: vdo-types.h:203
@ VDO_ZIPSTREAM_PROFILE_STORAGE
Definition: vdo-types.h:202
@ VDO_ZIPSTREAM_PROFILE_CLASSIC
Definition: vdo-types.h:201
VdoRateControlMode
Bitrate control modes.
Definition: vdo-types.h:134
@ VDO_RATE_CONTROL_MODE_VBR
Definition: vdo-types.h:137
@ VDO_RATE_CONTROL_MODE_NONE
Definition: vdo-types.h:135
@ VDO_RATE_CONTROL_MODE_CBR
Definition: vdo-types.h:136
@ VDO_RATE_CONTROL_MODE_ABR
Definition: vdo-types.h:139
@ VDO_RATE_CONTROL_MODE_MBR
Definition: vdo-types.h:138
VdoChunkType
Video chunk types.
Definition: vdo-types.h:220
@ VDO_CHUNK_NONE
Definition: vdo-types.h:221
@ VDO_CHUNK_ERROR
Definition: vdo-types.h:222
GType vdo_zipstream_gdr_get_type(void)
Get zipstream GDR type.
GType vdo_zipstream_profile_get_type(void)
Get zipstream profile type.
VdoStreamEvent
Stream related events.
Definition: vdo-types.h:324
@ VDO_STREAM_EVENT_NONE
Definition: vdo-types.h:325
@ VDO_STREAM_EVENT_BUFFERING_WARN
Definition: vdo-types.h:333
@ VDO_STREAM_EVENT_CREATED
Definition: vdo-types.h:335
@ VDO_STREAM_EVENT_STOPPED
Definition: vdo-types.h:327
@ VDO_STREAM_EVENT_QUOTA_SOFT
Definition: vdo-types.h:329
@ VDO_STREAM_EVENT_STARTED
Definition: vdo-types.h:326
@ VDO_STREAM_EVENT_RESOURCE
Definition: vdo-types.h:328
@ VDO_STREAM_EVENT_CLOSED
Definition: vdo-types.h:336
@ VDO_STREAM_EVENT_INVALID
Definition: vdo-types.h:338
@ VDO_STREAM_EVENT_EXISTING
Definition: vdo-types.h:337
@ VDO_STREAM_EVENT_BUFFERING
Definition: vdo-types.h:332
@ VDO_STREAM_EVENT_ZIPSTREAM
Definition: vdo-types.h:331
@ VDO_STREAM_EVENT_QUOTA_HARD
Definition: vdo-types.h:330
@ VDO_STREAM_EVENT_BUFFERING_FAIL
Definition: vdo-types.h:334
VdoAV1Profile
AV1 profiles.
Definition: vdo-types.h:125
@ VDO_AV1_PROFILE_NONE
Definition: vdo-types.h:126
@ VDO_AV1_PROFILE_MAIN_10
Definition: vdo-types.h:128
@ VDO_AV1_PROFILE_MAIN
Definition: vdo-types.h:127
VdoBufferAccess
Buffer access definitions.
Definition: vdo-types.h:350
@ VDO_BUFFER_ACCESS_ANY_RD
Definition: vdo-types.h:361
@ VDO_BUFFER_ACCESS_CPU_WR
Definition: vdo-types.h:364
@ VDO_BUFFER_ACCESS_CPU_RW
Definition: vdo-types.h:373
@ VDO_BUFFER_ACCESS_ANY_WR
Definition: vdo-types.h:370
@ VDO_BUFFER_ACCESS_DEV_RD
Definition: vdo-types.h:358
@ VDO_BUFFER_ACCESS_ANY_RW
Definition: vdo-types.h:379
@ VDO_BUFFER_ACCESS_DEV_WR
Definition: vdo-types.h:367
@ VDO_BUFFER_ACCESS_DEV_RW
Definition: vdo-types.h:376
@ VDO_BUFFER_ACCESS_CPU_RD
Definition: vdo-types.h:355
@ VDO_BUFFER_ACCESS_NONE
Definition: vdo-types.h:352
VdoZipStreamGdr
Zipstream GDR (Live only).
Definition: vdo-types.h:209
@ VDO_ZIPSTREAM_GDR_OFF
Definition: vdo-types.h:212
@ VDO_ZIPSTREAM_GDR_NONE
Definition: vdo-types.h:210
@ VDO_ZIPSTREAM_GDR_AUTO
Definition: vdo-types.h:211
@ VDO_ZIPSTREAM_GDR_BALANCED
Definition: vdo-types.h:213
@ VDO_ZIPSTREAM_GDR_EXTREME
Definition: vdo-types.h:214
VdoBufferStrategy
Buffer strategy.
Definition: vdo-types.h:390
@ VDO_BUFFER_STRATEGY_NONE
Definition: vdo-types.h:392
@ VDO_BUFFER_STRATEGY_INFINITE
Definition: vdo-types.h:409
@ VDO_BUFFER_STRATEGY_EXPLICIT
Definition: vdo-types.h:406
VdoIntent
Intent values.
Definition: vdo-types.h:308
@ VDO_INTENT_NONE
Definition: vdo-types.h:309
@ VDO_INTENT_PRODUCE
Definition: vdo-types.h:313
@ VDO_INTENT_EVENTFD
Definition: vdo-types.h:315
@ VDO_INTENT_CONSUME
Definition: vdo-types.h:312
@ VDO_INTENT_CONTROL
Definition: vdo-types.h:310
@ VDO_INTENT_MONITOR
Definition: vdo-types.h:311
@ VDO_INTENT_UNIVERSE
Definition: vdo-types.h:316
@ VDO_INTENT_DEFAULT
Definition: vdo-types.h:314
GType vdo_wdr_mode_get_type(void)
Get wdr mode type.
VdoChunkOption
Video chunk options.
Definition: vdo-types.h:228
@ VDO_CHUNK_OPTION_MMAP
Definition: vdo-types.h:230
@ VDO_CHUNK_OPTION_NONE
Definition: vdo-types.h:229
GType vdo_h264_profile_get_type(void)
Get h264 profile type.
VdoWdrMode
Wide Dynamic Range (WDR) modes.
Definition: vdo-types.h:33
@ VDO_WDR_MODE_AUTO
Definition: vdo-types.h:41
@ VDO_WDR_MODE_NONE
Definition: vdo-types.h:34
@ VDO_WDR_MODE_LINEAR
Definition: vdo-types.h:35
@ VDO_WDR_MODE_SENSOR
Definition: vdo-types.h:39
@ VDO_WDR_MODE_4X
Definition: vdo-types.h:38
@ VDO_WDR_MODE_OFF
Definition: vdo-types.h:40
@ VDO_WDR_MODE_2X
Definition: vdo-types.h:36
@ VDO_WDR_MODE_3X
Definition: vdo-types.h:37
VdoFrameType
Video frame types.
Definition: vdo-types.h:157
@ VDO_FRAME_TYPE_YUV
Definition: vdo-types.h:183
@ VDO_FRAME_TYPE_H265_B
Definition: vdo-types.h:181
@ VDO_FRAME_TYPE_H265_IDR
Definition: vdo-types.h:176
@ VDO_FRAME_TYPE_RGB
Definition: vdo-types.h:188
@ VDO_FRAME_TYPE_H265_P
Definition: vdo-types.h:180
@ VDO_FRAME_TYPE_NONE
Definition: vdo-types.h:158
@ VDO_FRAME_TYPE_AV1_BIDI
Definition: vdo-types.h:192
@ VDO_FRAME_TYPE_PLANAR_RGB
Definition: vdo-types.h:189
@ VDO_FRAME_TYPE_H264_P
Definition: vdo-types.h:168
@ VDO_FRAME_TYPE_AV1_KEY
Definition: vdo-types.h:190
@ VDO_FRAME_TYPE_RGBA
Definition: vdo-types.h:187
@ VDO_FRAME_TYPE_H264_IDR
Definition: vdo-types.h:164
@ VDO_FRAME_TYPE_AVIF
Definition: vdo-types.h:193
@ VDO_FRAME_TYPE_AV1_INTER
Definition: vdo-types.h:191
@ VDO_FRAME_TYPE_H264_B
Definition: vdo-types.h:169
@ VDO_FRAME_TYPE_JPEG
Definition: vdo-types.h:182
GType vdo_format_get_type(void)
Get vdo format type.