ZegoLiveRoom
video_format.h
Go to the documentation of this file.
1#ifndef ZEGOVideoFormat_h
2#define ZEGOVideoFormat_h
3
4#include <stdint.h>
5
6namespace AVE
7{
9 {
25 };
26
27 // copy from libavutil/pixfmt
38
50 };
51
79 };
80
103 };
104
113 };
114 struct VUI {
115 VUI() {
116 color_range = 0;
117 matrix_coeffs = 2;
119 color_primaries = 2;
120 }
121
122 /* indicates the black level and luma and chroma range */
123 int32_t color_range;
124
125 /* Matrix coefficients used to derive the luma and chroma signals from
126 * the red, blue and green primaries. The default is 2 */
128
129 /* Transfer characteristics indicates the opto-electronic transfer
130 * characteristic of the source picture. The default is 2 */
132
133 /* Color primaries holds the chromacity coordinates of the source
134 * primaries. The default is 2 */
136 };
137
138
140 {
142 {
143 width = 0;
144 height = 0;
145 strides[0] = strides[1] = strides[2] = strides[3] = 0;
146 rotation = 0;
148 }
149
151 {
152 this->width = width;
153 this->height = height;
154 strides[0] = strides[1] = strides[2] = strides[3] = 0;
155 rotation = 0;
156 this->pixel_format = pixel_format;
157 }
158
159 bool operator==(const VideoDataFormat& other)
160 {
161 return (width == other.width && height == other.height &&
162 strides[0] == other.strides[0] && strides[1] == other.strides[1] &&
163 strides[2] == other.strides[2] && strides[3] == other.strides[3] &&
164 rotation == other.rotation && pixel_format == other.pixel_format);
165 }
166
167 bool operator!=(const VideoDataFormat& other)
168 {
169 return !(*this == other);
170 }
171
172 int width;
174 int strides[4];
177 };
178
180 {
182 planes[0] = planes[1] = planes[2] = planes[3] = 0;
183 lens[0] = lens[1] = lens[2] = lens[3] = 0;
184 }
186 unsigned char* planes[4];
187 unsigned int lens[4];
188 };
189
190}
191#endif /* ZEGOVideoFormat_h */
Definition: audio_capture.h:4
ColorSpace
Definition: video_format.h:85
@ COL_SPC_CHROMA_DERIVED_CL
Chromaticity-derived constant luminance system.
Definition: video_format.h:100
@ COL_SPC_ICTCP
ITU-R BT.2100-0, ICtCp.
Definition: video_format.h:101
@ COL_SPC_FCC
FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: video_format.h:90
@ COL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
Definition: video_format.h:96
@ COL_SPC_RESERVED
Definition: video_format.h:89
@ COL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: video_format.h:92
@ COL_SPC_UNSPECIFIED
Definition: video_format.h:88
@ COL_SPC_CHROMA_DERIVED_NCL
Chromaticity-derived non-constant luminance system.
Definition: video_format.h:99
@ COL_SPC_SMPTE2085
SMPTE 2085, Y'D'zD'x.
Definition: video_format.h:98
@ COL_SPC_YCOCG
Definition: video_format.h:95
@ COL_SPC_NB
Not part of ABI.
Definition: video_format.h:102
@ COL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
Definition: video_format.h:91
@ COL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
Definition: video_format.h:97
@ COL_SPC_YCGCO
Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16.
Definition: video_format.h:94
@ COL_SPC_SMPTE240M
functionally identical to above
Definition: video_format.h:93
@ COL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
Definition: video_format.h:86
@ COL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: video_format.h:87
ColorPrimaries
Definition: video_format.h:32
@ COL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: video_format.h:39
@ COL_PRI_RESERVED0
Definition: video_format.h:33
@ COL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
Definition: video_format.h:34
@ COL_PRI_BT2020
ITU-R BT2020.
Definition: video_format.h:43
@ COL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: video_format.h:40
@ COL_PRI_UNSPECIFIED
Definition: video_format.h:35
@ COL_PRI_JEDEC_P22
JEDEC P22 phosphors.
Definition: video_format.h:48
@ COL_PRI_FILM
colour filters using Illuminant C
Definition: video_format.h:42
@ COL_PRI_NB
Not part of ABI.
Definition: video_format.h:49
@ COL_PRI_BT470M
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: video_format.h:37
@ COL_PRI_SMPTEST428_1
Definition: video_format.h:45
@ COL_PRI_SMPTE428
SMPTE ST 428-1 (CIE 1931 XYZ)
Definition: video_format.h:44
@ COL_PRI_SMPTE240M
functionally identical to above
Definition: video_format.h:41
@ COL_PRI_SMPTE431
SMPTE ST 431-2 (2011) / DCI P3.
Definition: video_format.h:46
@ COL_PRI_RESERVED
Definition: video_format.h:36
@ COL_PRI_SMPTE432
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
Definition: video_format.h:47
ColorTransferCharacteristic
Definition: video_format.h:56
@ COL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
Definition: video_format.h:70
@ COL_TRC_RESERVED0
Definition: video_format.h:57
@ COL_TRC_SMPTE428
SMPTE ST 428-1.
Definition: video_format.h:75
@ COL_TRC_SMPTE240M
Definition: video_format.h:64
@ COL_TRC_LOG
"Logarithmic transfer characteristic (100:1 range)"
Definition: video_format.h:66
@ COL_TRC_IEC61966_2_4
IEC 61966-2-4.
Definition: video_format.h:68
@ COL_TRC_GAMMA28
also ITU-R BT470BG
Definition: video_format.h:62
@ COL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
Definition: video_format.h:77
@ COL_TRC_SMPTEST428_1
Definition: video_format.h:76
@ COL_TRC_LINEAR
"Linear transfer characteristics"
Definition: video_format.h:65
@ COL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
Definition: video_format.h:72
@ COL_TRC_BT2020_10
ITU-R BT2020 for 10-bit system.
Definition: video_format.h:71
@ COL_TRC_BT1361_ECG
ITU-R BT1361 Extended Colour Gamut.
Definition: video_format.h:69
@ COL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
Definition: video_format.h:63
@ COL_TRC_SMPTEST2084
Definition: video_format.h:74
@ COL_TRC_LOG_SQRT
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: video_format.h:67
@ COL_TRC_BT709
also ITU-R BT1361
Definition: video_format.h:58
@ COL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
Definition: video_format.h:73
@ COL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
Definition: video_format.h:61
@ COL_TRC_UNSPECIFIED
Definition: video_format.h:59
@ COL_TRC_RESERVED
Definition: video_format.h:60
@ COL_TRC_NB
Not part of ABI.
Definition: video_format.h:78
VideoPixelFormat
Definition: video_format.h:9
@ PIXEL_FORMAT_AVC_ANNEXB
Definition: video_format.h:20
@ PIXEL_FORMAT_BGRA32
Definition: video_format.h:14
@ PIXEL_FORMAT_UYVY
Definition: video_format.h:22
@ PIXEL_FORMAT_I420
Definition: video_format.h:11
@ PIXEL_FORMAT_BGR24
Definition: video_format.h:23
@ PIXEL_FORMAT_NV21
Definition: video_format.h:13
@ PIXEL_FORMAT_RGBA32
Definition: video_format.h:15
@ PIXEL_FORMAT_RGB24
Definition: video_format.h:24
@ PIXEL_FORMAT_YUY2
Definition: video_format.h:21
@ PIXEL_FORMAT_ARGB32
Definition: video_format.h:16
@ PIXEL_FORMAT_ABGR32
Definition: video_format.h:17
@ PIXEL_FORMAT_NV12
Definition: video_format.h:12
@ PIXEL_FORMAT_UNKNOWN
Definition: video_format.h:10
@ PIXEL_FORMAT_AVC_AVCC
Definition: video_format.h:19
@ PIXEL_FORMAT_I422
Definition: video_format.h:18
ColorRange
Definition: video_format.h:108
@ COL_RANGE_JPEG
the normal 2^n-1 "JPEG" YUV ranges
Definition: video_format.h:111
@ COL_RANGE_UNSPECIFIED
Definition: video_format.h:109
@ COL_RANGE_MPEG
the normal 219*2^(n-8) "MPEG" YUV ranges
Definition: video_format.h:110
@ COL_RANGE_NB
Not part of ABI.
Definition: video_format.h:112
Definition: video_format.h:114
int32_t matrix_coeffs
Definition: video_format.h:127
int32_t color_range
Definition: video_format.h:123
int32_t color_primaries
Definition: video_format.h:135
int32_t transfer_characteristics
Definition: video_format.h:131
VUI()
Definition: video_format.h:115
Definition: video_format.h:140
VideoDataFormat(int width, int height, VideoPixelFormat pixel_format)
Definition: video_format.h:150
VideoPixelFormat pixel_format
Definition: video_format.h:176
int width
Definition: video_format.h:172
int strides[4]
Definition: video_format.h:174
int rotation
Definition: video_format.h:175
int height
Definition: video_format.h:173
VideoDataFormat()
Definition: video_format.h:141
bool operator==(const VideoDataFormat &other)
Definition: video_format.h:159
bool operator!=(const VideoDataFormat &other)
Definition: video_format.h:167
Definition: video_format.h:180
VideoFrameWithFormat()
Definition: video_format.h:181
VideoDataFormat format
Definition: video_format.h:185
unsigned int lens[4]
Definition: video_format.h:187
unsigned char * planes[4]
Definition: video_format.h:186