|
NVIDIA DRIVE OS Linux SDK API Reference
|
5.2.0 Release For Test and Development only
|
Go to the documentation of this file.
16 #ifndef NVMEDIA_SURFACE_H
17 #define NVMEDIA_SURFACE_H
44 #define NVMEDIA_SURFACE_VERSION_MAJOR (1u)
46 #define NVMEDIA_SURFACE_VERSION_MINOR (14u)
90 #define NVM_SURF_ATTR_SURF_TYPE_YUV (0x00000001u)
92 #define NVM_SURF_ATTR_SURF_TYPE_RGBA (0x00000002u)
94 #define NVM_SURF_ATTR_SURF_TYPE_RAW (0x00000003u)
98 #define NVM_SURF_ATTR_LAYOUT_BL (0x00000001u)
100 #define NVM_SURF_ATTR_LAYOUT_PL (0x00000002u)
104 #define NVM_SURF_ATTR_DATA_TYPE_UINT (0x00000001u)
106 #define NVM_SURF_ATTR_DATA_TYPE_INT (0x00000002u)
108 #define NVM_SURF_ATTR_DATA_TYPE_FLOAT (0x00000003u)
110 #define NVM_SURF_ATTR_DATA_TYPE_FLOATISP (0x00000004u)
114 #define NVM_SURF_ATTR_MEMORY_PLANAR (0x00000001u)
116 #define NVM_SURF_ATTR_MEMORY_SEMI_PLANAR (0x00000002u)
118 #define NVM_SURF_ATTR_MEMORY_PACKED (0x00000003u)
124 #define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_420 (0x00000001u)
126 #define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422 (0x00000002u)
128 #define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_444 (0x00000003u)
130 #define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422R (0x00000004u)
132 #define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE (0x00000000u)
138 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_8 (0x00000001u)
140 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_10 (0x00000002u)
142 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_12 (0x00000003u)
144 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_14 (0x00000004u)
146 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_16 (0x00000005u)
148 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_32 (0x00000006u)
151 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_16_8_8 (0x00000007u)
153 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_10_8_8 (0x00000008u)
155 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_2_10_10_10 (0x00000009u)
157 #define NVM_SURF_ATTR_BITS_PER_COMPONENT_20 (0x0000000Au)
161 #define NVM_SURF_ATTR_COMPONENT_ORDER_LUMA (0x00000001u)
163 #define NVM_SURF_ATTR_COMPONENT_ORDER_YUV (0x00000002u)
165 #define NVM_SURF_ATTR_COMPONENT_ORDER_YVU (0x00000003u)
167 #define NVM_SURF_ATTR_COMPONENT_ORDER_YUYV (0x00000004u)
169 #define NVM_SURF_ATTR_COMPONENT_ORDER_YVYU (0x00000005u)
171 #define NVM_SURF_ATTR_COMPONENT_ORDER_VYUY (0x00000006u)
173 #define NVM_SURF_ATTR_COMPONENT_ORDER_UYVY (0x00000007u)
175 #define NVM_SURF_ATTR_COMPONENT_ORDER_XUYV (0x00000008u)
177 #define NVM_SURF_ATTR_COMPONENT_ORDER_XYUV (0x00000009u)
179 #define NVM_SURF_ATTR_COMPONENT_ORDER_VUYX (0x0000000Au)
183 #define NVM_SURF_ATTR_COMPONENT_ORDER_ALPHA (0x00000011u)
185 #define NVM_SURF_ATTR_COMPONENT_ORDER_RGBA (0x00000012u)
187 #define NVM_SURF_ATTR_COMPONENT_ORDER_ARGB (0x00000013u)
189 #define NVM_SURF_ATTR_COMPONENT_ORDER_BGRA (0x00000014u)
191 #define NVM_SURF_ATTR_COMPONENT_ORDER_RG (0x00000015u)
195 #define NVM_SURF_ATTR_COMPONENT_ORDER_RGGB (0x00000021u)
197 #define NVM_SURF_ATTR_COMPONENT_ORDER_BGGR (0x00000022u)
199 #define NVM_SURF_ATTR_COMPONENT_ORDER_GRBG (0x00000023u)
201 #define NVM_SURF_ATTR_COMPONENT_ORDER_GBRG (0x00000024u)
204 #define NVM_SURF_ATTR_COMPONENT_ORDER_RCCB (0x00000025u)
206 #define NVM_SURF_ATTR_COMPONENT_ORDER_BCCR (0x00000026u)
208 #define NVM_SURF_ATTR_COMPONENT_ORDER_CRBC (0x00000027u)
210 #define NVM_SURF_ATTR_COMPONENT_ORDER_CBRC (0x00000028u)
213 #define NVM_SURF_ATTR_COMPONENT_ORDER_RCCC (0x00000029u)
215 #define NVM_SURF_ATTR_COMPONENT_ORDER_CCCR (0x0000002Au)
217 #define NVM_SURF_ATTR_COMPONENT_ORDER_CRCC (0x0000002Bu)
219 #define NVM_SURF_ATTR_COMPONENT_ORDER_CCRC (0x0000002Cu)
222 #define NVM_SURF_ATTR_COMPONENT_ORDER_CCCC (0x0000002Du)
237 #define NVM_SURF_FMT_DEFINE_ATTR(x) \
238 NvMediaSurfFormatAttr x[] = { \
240 .type = NVM_SURF_ATTR_SURF_TYPE, \
244 .type = NVM_SURF_ATTR_LAYOUT, \
248 .type = NVM_SURF_ATTR_DATA_TYPE, \
252 .type = NVM_SURF_ATTR_MEMORY, \
256 .type = NVM_SURF_ATTR_SUB_SAMPLING_TYPE, \
260 .type = NVM_SURF_ATTR_BITS_PER_COMPONENT, \
264 .type = NVM_SURF_ATTR_COMPONENT_ORDER, \
277 #define NVM_SURF_FMT_SET_ATTR_YUV(attr, order, samplingtype, memory, datatype, bpc, layout) \
279 attr[0].type = NVM_SURF_ATTR_SURF_TYPE; \
280 attr[0].value = NVM_SURF_ATTR_SURF_TYPE_YUV; \
282 attr[1].type = NVM_SURF_ATTR_LAYOUT; \
283 attr[1].value = NVM_SURF_ATTR_LAYOUT_##layout; \
285 attr[2].type = NVM_SURF_ATTR_DATA_TYPE; \
286 attr[2].value = NVM_SURF_ATTR_DATA_TYPE_##datatype; \
288 attr[3].type = NVM_SURF_ATTR_MEMORY; \
289 attr[3].value = NVM_SURF_ATTR_MEMORY_##memory; \
291 attr[4].type = NVM_SURF_ATTR_SUB_SAMPLING_TYPE; \
292 attr[4].value = NVM_SURF_ATTR_SUB_SAMPLING_TYPE_##samplingtype; \
294 attr[5].type = NVM_SURF_ATTR_BITS_PER_COMPONENT; \
295 attr[5].value = NVM_SURF_ATTR_BITS_PER_COMPONENT_##bpc; \
297 attr[6].type = NVM_SURF_ATTR_COMPONENT_ORDER; \
298 attr[6].value = NVM_SURF_ATTR_COMPONENT_ORDER_##order; \
306 #define NVM_SURF_FMT_SET_ATTR_RGBA(attr, order, datatype, bpc, layout) \
308 attr[0].type = NVM_SURF_ATTR_SURF_TYPE; \
309 attr[0].value = NVM_SURF_ATTR_SURF_TYPE_RGBA; \
311 attr[1].type = NVM_SURF_ATTR_LAYOUT; \
312 attr[1].value = NVM_SURF_ATTR_LAYOUT_##layout; \
314 attr[2].type = NVM_SURF_ATTR_DATA_TYPE; \
315 attr[2].value = NVM_SURF_ATTR_DATA_TYPE_##datatype; \
317 attr[3].type = NVM_SURF_ATTR_MEMORY; \
318 attr[3].value = NVM_SURF_ATTR_MEMORY_PACKED; \
320 attr[4].type = NVM_SURF_ATTR_SUB_SAMPLING_TYPE; \
321 attr[4].value = NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE; \
323 attr[5].type = NVM_SURF_ATTR_BITS_PER_COMPONENT; \
324 attr[5].value = NVM_SURF_ATTR_BITS_PER_COMPONENT_##bpc; \
326 attr[6].type = NVM_SURF_ATTR_COMPONENT_ORDER; \
327 attr[6].value = NVM_SURF_ATTR_COMPONENT_ORDER_##order; \
334 #define NVM_SURF_FMT_SET_ATTR_RAW(attr, order, datatype, bpc, layout) \
336 attr[0].type = NVM_SURF_ATTR_SURF_TYPE; \
337 attr[0].value = NVM_SURF_ATTR_SURF_TYPE_RAW; \
339 attr[1].type = NVM_SURF_ATTR_LAYOUT; \
340 attr[1].value = NVM_SURF_ATTR_LAYOUT_##layout; \
342 attr[2].type = NVM_SURF_ATTR_DATA_TYPE; \
343 attr[2].value = NVM_SURF_ATTR_DATA_TYPE_##datatype; \
345 attr[3].type = NVM_SURF_ATTR_MEMORY; \
346 attr[3].value = NVM_SURF_ATTR_MEMORY_PACKED; \
348 attr[4].type = NVM_SURF_ATTR_SUB_SAMPLING_TYPE; \
349 attr[4].value = NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE; \
351 attr[5].type = NVM_SURF_ATTR_BITS_PER_COMPONENT; \
352 attr[5].value = NVM_SURF_ATTR_BITS_PER_COMPONENT_##bpc; \
354 attr[6].type = NVM_SURF_ATTR_COMPONENT_ORDER; \
355 attr[6].value = NVM_SURF_ATTR_COMPONENT_ORDER_##order; \
413 #define NVM_SURF_ATTR_MIN_WIDTH (16U)
415 #define NVM_SURF_ATTR_MAX_WIDTH (16384U)
420 #define NVM_SURF_ATTR_MIN_HEIGHT (16U)
422 #define NVM_SURF_ATTR_MAX_HEIGHT (16384U)
427 #define NVM_SURF_ATTR_MIN_EMB_LINES_TOP (0U)
429 #define NVM_SURF_ATTR_MAX_EMB_LINES_TOP (128U)
434 #define NVM_SURF_ATTR_MIN_EMB_LINES_BOTTOM (0U)
436 #define NVM_SURF_ATTR_MAX_EMB_LINES_BOTTOM (128U)
441 #define NVM_SURF_ATTR_CPU_ACCESS_UNCACHED (0x00000001u)
443 #define NVM_SURF_ATTR_CPU_ACCESS_CACHED (0x00000002u)
445 #define NVM_SURF_ATTR_CPU_ACCESS_UNMAPPED (0x00000003u)
450 #define NVM_SURF_ATTR_ALLOC_DEFAULT (0x00000000u)
452 #define NVM_SURF_ATTR_ALLOC_ISOCHRONOUS (0x00000001u)
454 #define NVM_SURF_ATTR_ALLOC_SECURED (0x00000002u)
459 #define NVM_SURF_ATTR_ALLOC_DEFAULT (0x00000000u)
461 #define NVM_SURF_ATTR_SCAN_PROGRESSIVE (0x00000001u)
463 #if !defined(NV_IS_SAFETY) || (!NV_IS_SAFETY)
468 #define NVM_SURF_ATTR_SCAN_INTERLACED (0x00000002u)
476 #define NVM_SURF_ATTR_COLOR_STD_SRGB (0x00000001u)
480 #define NVM_SURF_ATTR_COLOR_STD_REC601_SR (0x00000002u)
484 #define NVM_SURF_ATTR_COLOR_STD_REC601_ER (0x00000003u)
488 #define NVM_SURF_ATTR_COLOR_STD_REC709_SR (0x00000004u)
492 #define NVM_SURF_ATTR_COLOR_STD_REC709_ER (0x00000005u)
498 #define NVM_SURF_ATTR_COLOR_STD_REC2020_RGB (0x00000006u)
504 #define NVM_SURF_ATTR_COLOR_STD_REC2020_SR (0x00000007u)
510 #define NVM_SURF_ATTR_COLOR_STD_REC2020_ER (0x00000008u)
516 #define NVM_SURF_ATTR_COLOR_STD_YcCbcCrc_SR (0x00000009u)
522 #define NVM_SURF_ATTR_COLOR_STD_YcCbcCrc_ER (0x0000000Au)
530 #define NVM_SURF_ATTR_COLOR_STD_SENSOR_RGBA (0x0000000Bu)
535 #define NVM_SURF_ATTR_COLOR_STD_REC2020PQ_ER (0x0000000Cu)
550 #define NvMediaSurfaceType uint32_t
553 #define NvMediaSurfaceType_Unsupported (99999u)
555 #if (NV_IS_SAFETY == 0)
564 #define NvMediaSurfaceType_Video_420 (1000u)
565 #define NvMediaSurfaceType_Video_420_10bit (1001u)
566 #define NvMediaSurfaceType_Video_420_12bit (1002u)
570 #define NvMediaSurfaceType_Video_422 (1003u)
571 #define NvMediaSurfaceType_Video_422_10bit (1004u)
572 #define NvMediaSurfaceType_Video_422_12bit (1005u)
576 #define NvMediaSurfaceType_Video_444 (1006u)
577 #define NvMediaSurfaceType_Video_444_10bit (1007u)
578 #define NvMediaSurfaceType_Video_444_12bit (1008u)
580 #define NvMediaSurfaceType_VideoCapture_422 (1009u)
582 #define NvMediaSurfaceType_VideoCapture_YUYV_422 (1010u)
584 #define NvMediaSurfaceType_R8G8B8A8 (1011u)
588 #define NvMediaSurfaceType_R8G8B8A8_BottomOrigin (1012u)
590 #define NvMediaSurfaceType_Image_Monochrome (1013u)
592 #define NvMediaSurfaceType_Image_YUV_420 (1014u)
594 #define NvMediaSurfaceType_Image_YUV_422 (1015u)
596 #define NvMediaSurfaceType_Image_YUV_444 (1016u)
598 #define NvMediaSurfaceType_Image_YUYV_422 (1017u)
600 #define NvMediaSurfaceType_Image_RGBA (1018u)
602 #define NvMediaSurfaceType_Image_RAW (1019u)
604 #define NvMediaSurfaceType_Image_V16Y16U16X16 (1020u)
606 #define NvMediaSurfaceType_Image_Y16 (1021u)
608 #define NvMediaSurfaceType_Image_X2U10Y10V10 (1022u)
610 #define NvMediaSurfaceType_Image_Y10U8V8_420 (1023u)
612 #define NvMediaSurfaceType_Image_Y10 (1024u)
614 #define NvMediaSurfaceType_A8 (1025u)
617 #define NvMediaSurfaceType_YV12 NvMediaSurfaceType_Video_420
619 #define NvMediaSurfaceType_YV16 NvMediaSurfaceType_Video_422
621 #define NvMediaSurfaceType_YV24 NvMediaSurfaceType_Video_444
623 #define NvMediaSurfaceType_YV16x2 NvMediaSurfaceType_VideoCapture_422
@ NVM_SURF_ATTR_DATA_TYPE
Specifies the surface data type.
NvMediaSurfAllocAttrType
Defines NvMedia Surface allocation attribute types.
@ NVM_SURF_FMT_ATTR_MAX
Specifies the maximum number of surface format attributes.
@ NVM_SURF_ATTR_SURF_TYPE
Specifies the surface type.
@ NVM_SURF_ATTR_SCAN_TYPE
Specifies the surface scan type.
@ NVM_SURF_ATTR_WIDTH
Specifies the surface width.
@ NVM_SURF_ATTR_PEER_VM_ID
Specifies the peer VM ID in case of shared buffers.
@ NVM_SURF_ATTR_EMB_LINES_BOTTOM
Specifies the embedded lines bottom.
@ NVM_SURF_ALLOC_ATTR_MAX
Specifies the maximum number of surface allocation attributes.
@ NVM_SURF_ATTR_LAYOUT
Specifies the surface layout type.
NvMediaStatus NvMediaSurfaceFormatGetAttrs(NvMediaSurfaceType type, NvMediaSurfFormatAttr *attrs, uint32_t numAttrs)
Gets NvMediaSurfFormatAttr for the input surface type.
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
@ NVM_SURF_ATTR_HEIGHT
Specifies the surface height (excluding embedded data lines).
NvMediaSurfaceType NvMediaSurfaceFormatGetType(const NvMediaSurfFormatAttr *attrs, uint32_t numAttrs)
Gets NvMediaSurfaceType for the input NvMediaSurfFormatAttr.
NvMediaStatus NvMediaSurfaceGetVersion(NvMediaVersion *version)
Gets the surface version information for the NvMediaSurface component.
NvMediaSurfFormatAttrType
Defines NvMedia Surface format attribute types.
@ NVM_SURF_ATTR_ALLOC_TYPE
Specifies the allocation type.
NvMediaStatus
Defines all possible error codes.
@ NVM_SURF_ATTR_CPU_ACCESS
Specifies the CPU access to surface flags.
@ NVM_SURF_ATTR_COLOR_STD_TYPE
Specifies the color standard type.
@ NVM_SURF_ATTR_BITS_PER_COMPONENT
Specifies bits per component.
@ NVM_SURF_ATTR_COMPONENT_ORDER
Specifies the Pixel order.
@ NVM_SURF_ATTR_SUB_SAMPLING_TYPE
Specifies the surface sub sampling type.
@ NVM_SURF_ATTR_EMB_LINES_TOP
Specifies the embedded lines top.
@ NVM_SURF_ATTR_MEMORY
Specifies the surface memory type flags.