UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
types.h File Reference

This file contains some common data types. More...

#include <stddef.h>
#include <stdint.h>
#include <string>
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  device_info
 
struct  device_info::mode
 
struct  device_option
 
struct  fec_desc
 
struct  pixfmt_desc
 
struct  tile
 Struct tile is an area of video_frame. More...
 
struct  video_desc
 
struct  video_frame
 Struct video_frame represents a video frame and contains video description. More...
 
struct  video_frame_callbacks
 Struct containing callbacks of a video_frame. More...
 

Macros

#define FLEXIBLE_ARRAY_MEMBER   0
 
#define VF_METADATA_END   tile_count
 
#define VF_METADATA_SIZE   (offsetof(struct video_frame, VF_METADATA_END) - offsetof(struct video_frame, VF_METADATA_START))
 
#define VF_METADATA_START   fec_params
 

Typedefs

typedef void(* device_probe_func) (struct device_info **available_cards, int *count, void(**deleter) (void *))
 
typedef enum frame_type frame_type_t
 

Enumerations

enum  { kHz8 = 8000 , kHz48 = 48000 , kHz90 = 90000 }
 
enum  codec_t {
  VIDEO_CODEC_NONE = 0 , VC_NONE = VIDEO_CODEC_NONE , VIDEO_CODEC_FIRST , VC_FIRST = VIDEO_CODEC_FIRST ,
  RGBA = VIDEO_CODEC_FIRST , UYVY , YUYV , R10k ,
  R12L , v210 , DVS10 , DXT1 ,
  DXT1_YUV , DXT5 , RGB , JPEG ,
  RAW , H264 , H265 , MJPG ,
  VP8 , VP9 , BGR , J2K ,
  J2KR , HW_VDPAU , HFYU , FFV1 ,
  CFHD , RG48 , AV1 , I420 ,
  Y216 , Y416 , PRORES , PRORES_4444 ,
  PRORES_4444_XQ , PRORES_422_HQ , PRORES_422 , PRORES_422_PROXY ,
  PRORES_422_LT , DRM_PRIME , VIDEO_CODEC_COUNT , VC_COUNT = VIDEO_CODEC_COUNT ,
  VC_END = VIDEO_CODEC_COUNT , VIDEO_CODEC_END = VIDEO_CODEC_COUNT
}
 
enum  depth { DEPTH8 = 8 , DEPTH10 = 10 , DEPTH12 = 12 , DEPTH16 = 16 }
 
enum  fec_type { FEC_NONE = 0 , FEC_MULT = 1 , FEC_LDGM = 2 , FEC_RS = 3 }
 
enum  frame_flags_common { TIMESTAMP_VALID = 1 << 0 }
 flags common for both audio and video frame More...
 
enum  frame_type { INTRA = 0 , BFRAME , OTHER }
 
enum  hw_accel_type {
  HWACCEL_NONE , HWACCEL_VDPAU , HWACCEL_VAAPI , HWACCEL_VIDEOTOOLBOX ,
  HWACCEL_CUDA , HWACCEL_VULKAN , HWACCEL_DRM_PRIME , HWACCEL_COUNT
}
 
enum  interlacing_t {
  PROGRESSIVE = 0 , UPPER_FIELD_FIRST = 1 , LOWER_FIELD_FIRST = 2 , INTERLACED_MERGED = 3 ,
  SEGMENTED_FRAME = 4 , INTERLACING_MAX = SEGMENTED_FRAME
}
 
enum  mem_location_t { CPU_MEM = 0 , CUDA_MEM }
 
enum  subsampling { SUBS_420 = 4200 , SUBS_422 = 4220 , SUBS_444 = 4440 , SUBS_4444 = 4444 }
 
enum  tx_media_type { TX_MEDIA_AUDIO , TX_MEDIA_VIDEO }
 
enum  video_mode {
  VIDEO_UNKNOWN , VIDEO_NORMAL , VIDEO_DUAL , VIDEO_STEREO ,
  VIDEO_4K , VIDEO_3X1
}
 

Functions

void dev_add_option (struct device_info *dev, const char *name, const char *desc, const char *key, const char *opt_str, bool is_boolean)
 

Detailed Description

This file contains some common data types.

Author
Martin Pulec pulec.nosp@m.@ces.nosp@m.net.c.nosp@m.z

This file should be directly included only from header files, not implementation files.

Definition in file types.h.

Macro Definition Documentation

◆ FLEXIBLE_ARRAY_MEMBER

#define FLEXIBLE_ARRAY_MEMBER   0

Definition at line 295 of file types.h.

◆ VF_METADATA_END

#define VF_METADATA_END   tile_count

Definition at line 340 of file types.h.

◆ VF_METADATA_SIZE

#define VF_METADATA_SIZE   (offsetof(struct video_frame, VF_METADATA_END) - offsetof(struct video_frame, VF_METADATA_START))

Definition at line 348 of file types.h.

Referenced by vf_copy_metadata(), vf_restore_metadata(), and vf_store_metadata().

◆ VF_METADATA_START

#define VF_METADATA_START   fec_params

Definition at line 327 of file types.h.

Referenced by vf_copy_metadata(), vf_restore_metadata(), and vf_store_metadata().

Typedef Documentation

◆ device_probe_func

typedef void(* device_probe_func) (struct device_info **available_cards, int *count, void(**deleter)(void *))

Definition at line 404 of file types.h.

◆ frame_type_t

typedef enum frame_type frame_type_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kHz8 
kHz48 
kHz90 

timestamp time base

Definition at line 146 of file types.h.

146 {
147 kHz8 = 8000,
148 kHz48 = 48000,
149 kHz90 = 90000,
150};
@ kHz8
Definition types.h:147
@ kHz48
Definition types.h:148
@ kHz90
timestamp time base
Definition types.h:149

◆ codec_t

enum codec_t

Video codec identificator

See also
video_frame::color_spec
Enumerator
VIDEO_CODEC_NONE 

dummy color spec

VC_NONE 
VIDEO_CODEC_FIRST 
VC_FIRST 
RGBA 

RGBA 8-bit, big-endian.

UYVY 

YCbCr 422 8-bit - Cb Y0 Cr Y1.

YUYV 

YCbCr 422 8-bit - Y0 Cb Y1 Cr.

R10k 

RGB 10-bit packed - RGBX, big-endian (2 bit padding)

R12L 

RGB 12-bit packed, little-endian.

v210 

YCbCr 422 10-bit - xVY0U|xY2UY1|xUY3V|xY5VY4, little-endian (2 bit padding /'x'/), line aligned to 128 B.

DVS10 

DVS 10-bit format.

DXT1 

S3 Texture Compression DXT1.

DXT1_YUV 

Structure same as DXT1, instead of RGB, YCbCr values are stored.

DXT5 

S3 Texture Compression DXT5.

RGB 

RGB 8-bit (packed into 24-bit word)

JPEG 

JPEG image, restart intervals may be used. Compatible with GPUJPEG.

RAW 

RAW HD-SDI frame.

H264 

H.264 frame.

H265 

H.264 frame.

MJPG 

JPEG image, without restart intervals.

Note
May include features not compatible with GPUJPEG.
VP8 

VP8 frame.

VP9 

VP9 frame.

BGR 

8-bit BGR

J2K 

JPEG 2000.

J2KR 

JPEG 2000 RGB.

HW_VDPAU 

VDPAU hardware surface.

HFYU 

HuffYUV.

FFV1 

FFV1.

CFHD 

Cineform.

RG48 

16-bit RGB little-endian (RlRhGl...)

AV1 

AOMedia Video 1.

I420 

planar YCbCr 4:2:0

Y216 

YCbCr 422 16-bit little-endian - Y0 Cb Y1 Cr.

Y416 

interleaved little-endian YCbCr 4444 16-bit - UYVA

PRORES 

abstract Apple ProRes, must not be used in transmit

PRORES_4444 

Apple ProRes 4444.

PRORES_4444_XQ 

Apple ProRes 4444 (XQ)

PRORES_422_HQ 

Apple ProRes 422 (HQ)

PRORES_422 

Apple ProRes 422.

PRORES_422_PROXY 

Apple ProRes 422 (Proxy)

PRORES_422_LT 

Apple ProRes 422 (LT)

DRM_PRIME 

DRM Prime buffer, data contains struct drm_prime_frame.

VIDEO_CODEC_COUNT 

count of known video codecs (including VIDEO_CODEC_NONE)

VC_COUNT 
VC_END 
VIDEO_CODEC_END 

Definition at line 65 of file types.h.

65 {
67 VC_NONE = VIDEO_CODEC_NONE, // shortcut
71 UYVY,
72 YUYV,
73 R10k,
74 R12L,
75 v210,
76 DVS10,
77 DXT1,
78 DXT1_YUV,
79 DXT5,
80 RGB,
81 JPEG,
82 RAW,
83 H264,
84 H265,
85 MJPG,
86 VP8,
87 VP9,
88 BGR,
89 J2K,
90 J2KR,
91 HW_VDPAU,
92 HFYU,
93 FFV1,
94 CFHD,
95 RG48,
96 AV1,
97 I420,
98 Y216,
99 Y416,
100 PRORES,
104 PRORES_422,
107 DRM_PRIME,
112} codec_t;
codec_t
Definition types.h:65
@ YUYV
YCbCr 422 8-bit - Y0 Cb Y1 Cr.
Definition types.h:72
@ VP8
VP8 frame.
Definition types.h:86
@ DXT1
S3 Texture Compression DXT1.
Definition types.h:77
@ PRORES_422_LT
Apple ProRes 422 (LT)
Definition types.h:106
@ R10k
RGB 10-bit packed - RGBX, big-endian (2 bit padding)
Definition types.h:73
@ RGB
RGB 8-bit (packed into 24-bit word)
Definition types.h:80
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
Definition types.h:71
@ VIDEO_CODEC_NONE
dummy color spec
Definition types.h:66
@ PRORES
abstract Apple ProRes, must not be used in transmit
Definition types.h:100
@ PRORES_422_PROXY
Apple ProRes 422 (Proxy)
Definition types.h:105
@ BGR
8-bit BGR
Definition types.h:88
@ HW_VDPAU
VDPAU hardware surface.
Definition types.h:91
@ VC_FIRST
Definition types.h:69
@ VIDEO_CODEC_FIRST
Definition types.h:68
@ RG48
16-bit RGB little-endian (RlRhGl...)
Definition types.h:95
@ AV1
AOMedia Video 1.
Definition types.h:96
@ Y416
interleaved little-endian YCbCr 4444 16-bit - UYVA
Definition types.h:99
@ VC_NONE
Definition types.h:67
@ J2KR
JPEG 2000 RGB.
Definition types.h:90
@ CFHD
Cineform.
Definition types.h:94
@ VIDEO_CODEC_END
Definition types.h:111
@ J2K
JPEG 2000.
Definition types.h:89
@ PRORES_422_HQ
Apple ProRes 422 (HQ)
Definition types.h:103
@ Y216
YCbCr 422 16-bit little-endian - Y0 Cb Y1 Cr.
Definition types.h:98
@ PRORES_4444
Apple ProRes 4444.
Definition types.h:101
@ JPEG
JPEG image, restart intervals may be used. Compatible with GPUJPEG.
Definition types.h:81
@ HFYU
HuffYUV.
Definition types.h:92
@ MJPG
JPEG image, without restart intervals.
Definition types.h:85
@ VIDEO_CODEC_COUNT
count of known video codecs (including VIDEO_CODEC_NONE)
Definition types.h:108
@ R12L
RGB 12-bit packed, little-endian.
Definition types.h:74
@ FFV1
FFV1.
Definition types.h:93
@ PRORES_422
Apple ProRes 422.
Definition types.h:104
@ DRM_PRIME
DRM Prime buffer, data contains struct drm_prime_frame.
Definition types.h:107
@ RAW
RAW HD-SDI frame.
Definition types.h:82
@ VC_COUNT
Definition types.h:109
@ H264
H.264 frame.
Definition types.h:83
@ DVS10
DVS 10-bit format.
Definition types.h:76
@ VP9
VP9 frame.
Definition types.h:87
@ H265
H.264 frame.
Definition types.h:84
@ DXT5
S3 Texture Compression DXT5.
Definition types.h:79
@ I420
planar YCbCr 4:2:0
Definition types.h:97
@ PRORES_4444_XQ
Apple ProRes 4444 (XQ)
Definition types.h:102
@ DXT1_YUV
Structure same as DXT1, instead of RGB, YCbCr values are stored.
Definition types.h:78
@ RGBA
RGBA 8-bit, big-endian.
Definition types.h:70
@ v210
YCbCr 422 10-bit - xVY0U|xY2UY1|xUY3V|xY5VY4, little-endian (2 bit padding /'x'/),...
Definition types.h:75
@ VC_END
Definition types.h:110

◆ depth

enum depth
Enumerator
DEPTH8 
DEPTH10 
DEPTH12 
DEPTH16 

Definition at line 125 of file types.h.

125 {
126 DEPTH8 = 8,
127 DEPTH10 = 10,
128 DEPTH12 = 12,
129 DEPTH16 = 16,
130};
@ DEPTH16
Definition types.h:129
@ DEPTH10
Definition types.h:127
@ DEPTH12
Definition types.h:128
@ DEPTH8
Definition types.h:126

◆ fec_type

enum fec_type
Enumerator
FEC_NONE 
FEC_MULT 
FEC_LDGM 
FEC_RS 

Definition at line 200 of file types.h.

200 {
201 FEC_NONE = 0,
202 FEC_MULT = 1,
203 FEC_LDGM = 2,
204 FEC_RS = 3,
205};
@ FEC_LDGM
Definition types.h:203
@ FEC_MULT
Definition types.h:202
@ FEC_RS
Definition types.h:204
@ FEC_NONE
Definition types.h:201

◆ frame_flags_common

flags common for both audio and video frame

Enumerator
TIMESTAMP_VALID 

timestamp set by source (in 90 kHz clock)

Definition at line 222 of file types.h.

222 {
223 TIMESTAMP_VALID = 1 << 0,
224};
@ TIMESTAMP_VALID
timestamp set by source (in 90 kHz clock)
Definition types.h:223

◆ frame_type

enum frame_type
Enumerator
INTRA 
BFRAME 
OTHER 

Definition at line 194 of file types.h.

194 {
195 INTRA = 0,
196 BFRAME,
197 OTHER
enum frame_type frame_type_t
@ INTRA
Definition types.h:195
@ BFRAME
Definition types.h:196
@ OTHER
Definition types.h:197

◆ hw_accel_type

Enumerator
HWACCEL_NONE 
HWACCEL_VDPAU 
HWACCEL_VAAPI 
HWACCEL_VIDEOTOOLBOX 
HWACCEL_CUDA 
HWACCEL_VULKAN 
HWACCEL_DRM_PRIME 
HWACCEL_COUNT 

Definition at line 114 of file types.h.

114 {
123};
@ HWACCEL_NONE
Definition types.h:115
@ HWACCEL_VULKAN
Definition types.h:120
@ HWACCEL_VDPAU
Definition types.h:116
@ HWACCEL_COUNT
Definition types.h:122
@ HWACCEL_CUDA
Definition types.h:119
@ HWACCEL_VAAPI
Definition types.h:117
@ HWACCEL_DRM_PRIME
Definition types.h:121
@ HWACCEL_VIDEOTOOLBOX
Definition types.h:118

◆ interlacing_t

Specifies interlacing mode of the frame

See also
video_frame::interlacing
Enumerator
PROGRESSIVE 

progressive frame

UPPER_FIELD_FIRST 

First stored field is top, followed by bottom.

LOWER_FIELD_FIRST 

First stored field is bottom, followed by top.

INTERLACED_MERGED 

Columngs of both fields are interlaced together.

SEGMENTED_FRAME 

Segmented frame. Contains the same data as progressive frame.

Note
This is included to allow describing video mode, not content of a frame.
INTERLACING_MAX 

Definition at line 163 of file types.h.

163 {
164 PROGRESSIVE = 0,
168 SEGMENTED_FRAME = 4,
170};
@ LOWER_FIELD_FIRST
First stored field is bottom, followed by top.
Definition types.h:166
@ UPPER_FIELD_FIRST
First stored field is top, followed by bottom.
Definition types.h:165
@ INTERLACING_MAX
Definition types.h:169
@ PROGRESSIVE
progressive frame
Definition types.h:164
@ SEGMENTED_FRAME
Segmented frame. Contains the same data as progressive frame.
Definition types.h:168
@ INTERLACED_MERGED
Columngs of both fields are interlaced together.
Definition types.h:167

◆ mem_location_t

Enumerator
CPU_MEM 
CUDA_MEM 

Definition at line 297 of file types.h.

297 {
298 CPU_MEM = 0,
300};
@ CUDA_MEM
Definition types.h:299
@ CPU_MEM
Definition types.h:298

◆ subsampling

Enumerator
SUBS_420 
SUBS_422 
SUBS_444 
SUBS_4444 

Definition at line 132 of file types.h.

132 {
133 SUBS_420 = 4200,
134 SUBS_422 = 4220,
135 SUBS_444 = 4440,
136 SUBS_4444 = 4444,
137};
@ SUBS_444
Definition types.h:135
@ SUBS_4444
Definition types.h:136
@ SUBS_420
Definition types.h:133
@ SUBS_422
Definition types.h:134

◆ tx_media_type

Enumerator
TX_MEDIA_AUDIO 
TX_MEDIA_VIDEO 

Definition at line 363 of file types.h.

363 {
366};
@ TX_MEDIA_AUDIO
Definition types.h:364
@ TX_MEDIA_VIDEO
Definition types.h:365

◆ video_mode

enum video_mode

Video Mode

Video mode metadata are stored in file video.c in video_mode_info.

Enumerator
VIDEO_UNKNOWN 

unspecified video mode

VIDEO_NORMAL 

normal video (one tile)

VIDEO_DUAL 

1x2 video grid (is this ever used?)

VIDEO_STEREO 

stereoscopic 3D video (full left and right eye)

VIDEO_4K 

tiled 4K video

VIDEO_3X1 

3x1 video

Definition at line 354 of file types.h.

354 {
357 VIDEO_DUAL,
359 VIDEO_4K,
360 VIDEO_3X1,
361};
@ VIDEO_STEREO
stereoscopic 3D video (full left and right eye)
Definition types.h:358
@ VIDEO_UNKNOWN
unspecified video mode
Definition types.h:355
@ VIDEO_NORMAL
normal video (one tile)
Definition types.h:356
@ VIDEO_4K
tiled 4K video
Definition types.h:359
@ VIDEO_DUAL
1x2 video grid (is this ever used?)
Definition types.h:357
@ VIDEO_3X1
3x1 video
Definition types.h:360

Function Documentation

◆ dev_add_option()

void dev_add_option ( struct device_info * dev,
const char * name,
const char * desc,
const char * key,
const char * opt_str,
bool is_boolean )

Definition at line 652 of file video_display.c.

652 {
653
654 int idx = 0;
655 while(*dev->options[idx].key)
656 idx++;
657
658 strncpy(dev->options[idx].display_name, name, sizeof(dev->options[idx].display_name) - 1);
659 strncpy(dev->options[idx].display_desc, desc, sizeof(dev->options[idx].display_desc) - 1);
660 strncpy(dev->options[idx].key, key, sizeof(dev->options[idx].key) - 1);
661 strncpy(dev->options[idx].opt_str, opt_str, sizeof(dev->options[idx].opt_str) - 1);
662 dev->options[idx].is_boolean = is_boolean;
663}
struct video_desc desc
const char * name
Definition settings.cpp:193
struct device_option options[64]
Definition types.h:398
char display_name[512]
Definition types.h:369
char key[512]
Definition types.h:376
char display_desc[512]
Definition types.h:370
char opt_str[512]
Definition types.h:377
bool is_boolean
Definition types.h:379
const char * opt_str
Definition cineform.cpp:127
const char * key
Definition cineform.cpp:125
const bool is_boolean

References desc, device_option::display_desc, device_option::display_name, device_option::is_boolean, is_boolean, device_option::key, key, name, device_option::opt_str, opt_str, and device_info::options.

Referenced by display_decklink_probe(), display_sdl2_probe(), vidcap_decklink_probe(), vidcap_dshow_probe_internal(), and vidcap_testcard_probe().