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_RATE_CONTROL_MODE (vdo_rate_control_mode_get_type())
21 #define VDO_TYPE_RATE_CONTROL_PRIORITY (vdo_rate_control_priority_get_type())
22 #define VDO_TYPE_FRAME_TYPE (vdo_frame_type_get_type())
23 #define VDO_TYPE_TIMESTAMP (vdo_timestamp_get_type())
24 #define VDO_TYPE_BUFFER_ACCESS (vdo_buffer_access_get_type())
25 #define VDO_TYPE_BUFFER_STRATEGY (vdo_buffer_strategy_get_type())
26 #define VDO_TYPE_ZIPSTREAM_PROFILE (vdo_zipstream_profile_get_type())
27 
31 typedef enum {
38 } VdoWdrMode;
39 
43 typedef enum {
55 } VdoFormat;
56 
64 static inline gboolean
65 vdo_format_is_encoded(VdoFormat format)
66 {
67  return (format == VDO_FORMAT_H264 ||
68  format == VDO_FORMAT_H265 ||
69  format == VDO_FORMAT_JPEG);
70 }
71 
79 static inline gboolean
80 vdo_format_is_motion_encoded(VdoFormat format)
81 {
82  return (vdo_format_is_encoded(format) &&
83  format != VDO_FORMAT_JPEG);
84 }
85 
89 typedef enum {
95 
99 typedef enum {
104 
108 typedef enum {
115 
119 typedef enum {
125 
129 typedef enum {
152 } VdoFrameType;
153 
157 typedef enum {
163 
167 typedef enum {
169  VDO_CHUNK_ERROR = 1u << 31u,
170 } VdoChunkType;
171 
175 typedef struct {
176  gpointer data;
177  gsize size;
178  VdoChunkType type;
179 } VdoChunk;
180 
188 static inline gboolean
189 vdo_frame_is_encoded(VdoFrameType type)
190 {
191  return (type >= VDO_FRAME_TYPE_H264_SPS &&
192  type <= VDO_FRAME_TYPE_JPEG);
193 }
194 
202 static inline VdoFormat
203 vdo_frame_is_of_format(VdoFrameType type)
204 {
205  switch (type) {
213  return VDO_FORMAT_H264;
214 
223  return VDO_FORMAT_H265;
224 
225  case VDO_FRAME_TYPE_JPEG:
226  return VDO_FORMAT_JPEG;
227 
228  case VDO_FRAME_TYPE_YUV:
229  return VDO_FORMAT_YUV;
230 
231  case VDO_FRAME_TYPE_RAW:
232  return VDO_FORMAT_RAW;
233 
234  case VDO_FRAME_TYPE_RGBA:
235  return VDO_FORMAT_RGBA;
236 
237  case VDO_FRAME_TYPE_RGB:
238  return VDO_FORMAT_RGB;
239 
241  return VDO_FORMAT_PLANAR_RGB;
242 
243  default:
244  return VDO_FORMAT_NONE;
245  }
246 }
247 
248 typedef enum {
249  VDO_OVERLAY_ALIGN_NONE = -1,
250  VDO_OVERLAY_ALIGN_TOP = 0,
251  VDO_OVERLAY_ALIGN_BOTTOM = 1,
252 } VdoOverlayAlign;
253 
254 typedef enum {
255  VDO_OVERLAY_COLOR_TRANSPARENT = 0x0000,
256  VDO_OVERLAY_COLOR_BLACK = 0xF000,
257  VDO_OVERLAY_COLOR_WHITE = 0xFFFF,
258 } VdoOverlayColor;
259 
260 typedef enum {
261  VDO_OVERLAY_TEXT_SIZE_SMALL = 16,
262  VDO_OVERLAY_TEXT_SIZE_MEDIUM = 32,
263  VDO_OVERLAY_TEXT_SIZE_LARGE = 48,
264 } VdoOverlayTextSize;
265 
269 typedef enum {
272 
275 
281  VDO_TIMESTAMP_DIFF = 4,
282 
288 
294 
300 
306  VDO_TIMESTAMP_DIFF | VDO_TIMESTAMP_MONO_CLIENT \
308 
314  VDO_TIMESTAMP_DIFF | VDO_TIMESTAMP_MONO_CLIENT \
317 
324 typedef enum {
333 } VdoIntent;
334 
340 typedef enum {
350 
360 typedef enum {
363 
366 
369 
372 
375 
378 
381 
384 
387 
391 
400 typedef enum {
403 
406 
409 
412 
416 
420 typedef struct {
421  gpointer data;
422  gsize data_size;
423 } VdoMemChunk;
424 
428 typedef struct {
429  guint32 width;
430  guint32 height;
431 } VdoResolution;
432 
436 typedef struct {
437  gsize count;
438  VdoResolution resolutions[];
440 
444 typedef struct {
445  guint width;
446  guint height;
447  guint x;
448  guint y;
449 } VdoRect;
450 
456 GType vdo_wdr_mode_get_type(void);
457 
463 GType vdo_format_get_type(void);
464 
470 GType vdo_h264_profile_get_type(void);
471 
477 GType vdo_h265_profile_get_type(void);
478 
485 
492 
499 
507 GType vdo_frame_type_get_type(void);
508 
509 GType vdo_color_get_type(void);
510 
511 GType vdo_timestamp_get_type(void);
512 
513 GType vdo_intent_get_type(void);
514 
515 GType vdo_buffer_access_get_type(void);
516 
517 GType vdo_buffer_strategy_get_type(void);
518 
519 const char *vdo_format_to_str(VdoFormat format);
520 
521 G_END_DECLS
522 
523 #endif
Definition: vdo-types.h:161
Definition: vdo-types.h:331
Definition: vdo-types.h:344
Definition: vdo-types.h:271
Definition: vdo-types.h:330
Definition: vdo-types.h:138
Definition: vdo-types.h:383
Definition: vdo-types.h:377
Definition: vdo-types.h:365
VdoStreamEvent
Stream related events.
Definition: vdo-types.h:340
Definition: vdo-types.h:120
Definition: vdo-types.h:374
Definition: vdo-types.h:362
Definition: vdo-types.h:36
Definition: vdo-types.h:287
Definition: vdo-types.h:408
Definition: vdo-types.h:47
Definition: vdo-types.h:341
Definition: vdo-types.h:168
Definition: vdo-types.h:46
Definition: vdo-types.h:100
Definition: vdo-types.h:145
VdoFormat
Video formats.
Definition: vdo-types.h:43
VdoRateControlMode
Bitrate control modes.
Definition: vdo-types.h:108
Definition: vdo-types.h:137
Definition: vdo-types.h:139
Definition: vdo-types.h:293
Definition: vdo-types.h:389
A memory chunk.
Definition: vdo-types.h:420
Definition: vdo-types.h:110
Definition: vdo-types.h:148
Definition: vdo-types.h:143
Definition: vdo-types.h:93
Definition: vdo-types.h:113
Definition: vdo-types.h:347
VdoFrameType
Video frame types.
Definition: vdo-types.h:129
Definition: vdo-types.h:91
Definition: vdo-types.h:52
VdoWdrMode
Wide Dynamic Range (WDR) modes.
Definition: vdo-types.h:31
Definition: vdo-types.h:405
GType vdo_h264_profile_get_type(void)
Get h264 profile type.
Definition: vdo-types.h:345
Definition: vdo-types.h:305
Definition: vdo-types.h:346
VdoZipStreamProfile
Zipstream profiles.
Definition: vdo-types.h:157
Definition: vdo-types.h:37
VdoStreamTimestamp
Timestamp types.
Definition: vdo-types.h:269
Definition: vdo-types.h:169
Definition: vdo-types.h:280
Definition: vdo-types.h:32
Definition: vdo-types.h:123
Definition: vdo-types.h:368
Definition: vdo-types.h:150
VdoIntent
Intent values.
Definition: vdo-types.h:324
Definition: vdo-types.h:332
Definition: vdo-types.h:49
Definition: vdo-types.h:122
Definition: vdo-types.h:160
GType vdo_zipstream_profile_get_type(void)
Get zipstream profile type.
Definition: vdo-types.h:53
Definition: vdo-types.h:159
Definition: vdo-types.h:45
Definition: vdo-types.h:54
Definition: vdo-types.h:50
Definition: vdo-types.h:51
Definition: vdo-types.h:33
Definition: vdo-types.h:44
Definition: vdo-types.h:325
Definition: vdo-types.h:371
VdoH264Profile
H.264 profiles.
Definition: vdo-types.h:89
GType vdo_rate_control_mode_get_type(void)
Get rate control mode type.
Definition: vdo-types.h:299
Definition: vdo-types.h:146
Definition: vdo-types.h:112
Definition: vdo-types.h:328
Definition: vdo-types.h:134
Definition: vdo-types.h:111
Definition: vdo-types.h:342
VdoChunkType
Video chunk types.
Definition: vdo-types.h:167
A rectangle.
Definition: vdo-types.h:444
Definition: vdo-types.h:35
Definition: vdo-types.h:343
Definition: vdo-types.h:130
Definition: vdo-types.h:414
Definition: vdo-types.h:149
Definition: vdo-types.h:140
Definition: vdo-types.h:132
Definition: vdo-types.h:109
GType vdo_format_get_type(void)
Get vdo format type.
Definition: vdo-types.h:151
VdoH265Profile
H.265 profiles.
Definition: vdo-types.h:99
Definition: vdo-types.h:92
Definition: vdo-types.h:348
Definition: vdo-types.h:48
GType vdo_h265_profile_get_type(void)
Get h265 profile type.
Definition: vdo-types.h:133
Definition: vdo-types.h:329
Definition: vdo-types.h:144
GType vdo_rate_control_priority_get_type(void)
Get rate control priority type.
VdoBufferAccess
Buffer access definitions.
Definition: vdo-types.h:360
Definition: vdo-types.h:142
Definition: vdo-types.h:141
Definition: vdo-types.h:402
Definition: vdo-types.h:90
Definition: vdo-types.h:147
Definition: vdo-types.h:411
VdoBufferStrategy
Buffer strategy.
Definition: vdo-types.h:400
GType vdo_frame_type_get_type(void)
Get vdo frame type.
Definition: vdo-types.h:380
Definition: vdo-types.h:274
Definition: vdo-types.h:386
Definition: vdo-types.h:131
Definition: vdo-types.h:313
Definition: vdo-types.h:102
Definition: vdo-types.h:101
A set of resolutions.
Definition: vdo-types.h:436
Definition: vdo-types.h:34
VdoRateControlPriority
Bitrate control priorities.
Definition: vdo-types.h:119
Definition: vdo-types.h:327
Definition: vdo-types.h:135
GType vdo_wdr_mode_get_type(void)
Get wdr mode type.
Definition: vdo-types.h:326
A video chunk.
Definition: vdo-types.h:175
Definition: vdo-types.h:158
Definition: vdo-types.h:136
A resolution.
Definition: vdo-types.h:428
Definition: vdo-types.h:121