NVIDIA DRIVE OS Linux SDK API Reference

5.2.0 Release
For Test and Development only
nvmedia_surface.h File Reference

Detailed Description

NVIDIA Media Interface: Surface Handling

Description: This file contains the NvMedia Surface Handling API.

Definition in file nvmedia_surface.h.

Go to the source code of this file.

Data Structures

struct  NvMediaSurfFormatAttr
 Holds NvMedia Surface format attributes. More...
 
struct  NvMediaSurfAllocAttr
 Holds NvMedia Surface allocation attributes. More...
 

Macros

#define NVMEDIA_SURFACE_VERSION_MAJOR   (1u)
 Major Version number. More...
 
#define NVMEDIA_SURFACE_VERSION_MINOR   (14u)
 Minor Version number. More...
 
#define NVM_SURF_ATTR_SURF_TYPE_YUV   (0x00000001u)
 NVM_SURF_ATTR_SURF_TYPE flags. More...
 
#define NVM_SURF_ATTR_SURF_TYPE_RGBA   (0x00000002u)
 RGBA surface type flag. More...
 
#define NVM_SURF_ATTR_SURF_TYPE_RAW   (0x00000003u)
 RAW surface type flag. More...
 
#define NVM_SURF_ATTR_LAYOUT_BL   (0x00000001u)
 NVM_SURF_ATTR_LAYOUT flags. More...
 
#define NVM_SURF_ATTR_LAYOUT_PL   (0x00000002u)
 Pitch Linear (PL) surface layout flag. More...
 
#define NVM_SURF_ATTR_DATA_TYPE_UINT   (0x00000001u)
 NVM_SURF_ATTR_DATA_TYPE flags. More...
 
#define NVM_SURF_ATTR_DATA_TYPE_INT   (0x00000002u)
 Integer surface data type flag. More...
 
#define NVM_SURF_ATTR_DATA_TYPE_FLOAT   (0x00000003u)
 Float surface data type flag. More...
 
#define NVM_SURF_ATTR_DATA_TYPE_FLOATISP   (0x00000004u)
 FloatISP surface data type flag. More...
 
#define NVM_SURF_ATTR_MEMORY_PLANAR   (0x00000001u)
 NVM_SURF_ATTR_MEMORY flags. More...
 
#define NVM_SURF_ATTR_MEMORY_SEMI_PLANAR   (0x00000002u)
 Semi-Planar surface memory type flag. More...
 
#define NVM_SURF_ATTR_MEMORY_PACKED   (0x00000003u)
 Packed surface memory type flag. More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_420   (0x00000001u)
 NVM_SURF_ATTR_SUB_SAMPLING_TYPE flags for YUV surface types "R" indicates a transpose. More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422   (0x00000002u)
 4:2:2 sub-sampling type flag. More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_444   (0x00000003u)
 4:4:4 sub-sampling type flag. More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422R   (0x00000004u)
 4:2:2 transposed sub-sampling type flag. More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE   (0x00000000u)
 sub-sampling type not applicable flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_8   (0x00000001u)
 NVM_SURF_ATTR_BITS_PER_COMPONENT flags. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_10   (0x00000002u)
 10-bit per component flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_12   (0x00000003u)
 12-bit per component flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_14   (0x00000004u)
 14-bit per component flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_16   (0x00000005u)
 16-bit per component flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_32   (0x00000006u)
 32-bit per component flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_16_8_8   (0x00000007u)
 16:8:8 bits per component layout flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_10_8_8   (0x00000008u)
 10:8:8 bits per component layout flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_2_10_10_10   (0x00000009u)
 2:10:10:10 bits per component layout flag. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_20   (0x0000000Au)
 20-bit per component flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_LUMA   (0x00000001u)
 NVM_SURF_ATTR_COMPONENT_ORDER flags for YUV surface type. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_YUV   (0x00000002u)
 YUV component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_YVU   (0x00000003u)
 YVU component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_YUYV   (0x00000004u)
 YUYV component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_YVYU   (0x00000005u)
 YVYU component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_VYUY   (0x00000006u)
 VYUY component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_UYVY   (0x00000007u)
 UYVY component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_XUYV   (0x00000008u)
 XUYV component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_XYUV   (0x00000009u)
 XYUV component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_VUYX   (0x0000000Au)
 VUYX component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_ALPHA   (0x00000011u)
 NVM_SURF_ATTR_PIXEL_ORDER flags for RGBA surface type. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RGBA   (0x00000012u)
 RGBA component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_ARGB   (0x00000013u)
 ARGB component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_BGRA   (0x00000014u)
 BGRA component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RG   (0x00000015u)
 RG component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RGGB   (0x00000021u)
 NVM_SURF_ATTR_PIXEL_ORDER flags for RAW surface type. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_BGGR   (0x00000022u)
 BGGR component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_GRBG   (0x00000023u)
 GRBG component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_GBRG   (0x00000024u)
 GBRG component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RCCB   (0x00000025u)
 RCCB component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_BCCR   (0x00000026u)
 BCCR component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CRBC   (0x00000027u)
 CRBC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CBRC   (0x00000028u)
 CBRC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RCCC   (0x00000029u)
 RCCC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CCCR   (0x0000002Au)
 CCCR component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CRCC   (0x0000002Bu)
 CRCC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CCRC   (0x0000002Cu)
 CCRC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CCCC   (0x0000002Du)
 CCCC component order flag. More...
 
#define NVM_SURF_FMT_DEFINE_ATTR(x)
 A helper macro to define surface format attributes. More...
 
#define NVM_SURF_FMT_SET_ATTR_YUV(attr, order, samplingtype, memory, datatype, bpc, layout)
 A helper macro to set YUV surface format attributes. More...
 
#define NVM_SURF_FMT_SET_ATTR_RGBA(attr, order, datatype, bpc, layout)
 A helper macro to set RGBA surface format attributes. More...
 
#define NVM_SURF_FMT_SET_ATTR_RAW(attr, order, datatype, bpc, layout)
 A helper macro to set RAW surface format attributes. More...
 
#define NVM_SURF_ATTR_MIN_WIDTH   (16U)
 NVM_SURF_ATTR_WIDTH flags. More...
 
#define NVM_SURF_ATTR_MAX_WIDTH   (16384U)
 Maximum width of NvMedia Surface . More...
 
#define NVM_SURF_ATTR_MIN_HEIGHT   (16U)
 NVM_SURF_ATTR_HEIGHT flags. More...
 
#define NVM_SURF_ATTR_MAX_HEIGHT   (16384U)
 Maximum height of NvMedia Surface . More...
 
#define NVM_SURF_ATTR_MIN_EMB_LINES_TOP   (0U)
 NVM_SURF_ATTR_EMB_LINES_TOP flags. More...
 
#define NVM_SURF_ATTR_MAX_EMB_LINES_TOP   (128U)
 Maximum Top Embedded Data Lines. More...
 
#define NVM_SURF_ATTR_MIN_EMB_LINES_BOTTOM   (0U)
 NVM_SURF_ATTR_EMB_LINES_BOTTOM flags. More...
 
#define NVM_SURF_ATTR_MAX_EMB_LINES_BOTTOM   (128U)
 Maximum Bottom Embedded Data Lines. More...
 
#define NVM_SURF_ATTR_CPU_ACCESS_UNCACHED   (0x00000001u)
 NVM_SURF_ATTR_CPU_ACCESS flags. More...
 
#define NVM_SURF_ATTR_CPU_ACCESS_CACHED   (0x00000002u)
 Cached (mapped) access type flag. More...
 
#define NVM_SURF_ATTR_CPU_ACCESS_UNMAPPED   (0x00000003u)
 Unmapped access type flag. More...
 
#define NVM_SURF_ATTR_ALLOC_DEFAULT   (0x00000000u)
 NVM_SURF_ATTR_ALLOC_TYPE flags. More...
 
#define NVM_SURF_ATTR_ALLOC_ISOCHRONOUS   (0x00000001u)
 Isochronous buffer allocation flag. More...
 
#define NVM_SURF_ATTR_ALLOC_SECURED   (0x00000002u)
 Secured buffer allocation flag. More...
 
#define NVM_SURF_ATTR_ALLOC_DEFAULT   (0x00000000u)
 NVM_SURF_ATTR_ALLOC_TYPE flags. More...
 
#define NVM_SURF_ATTR_SCAN_PROGRESSIVE   (0x00000001u)
 Progressive surface scan type flag. More...
 
#define NVM_SURF_ATTR_SCAN_INTERLACED   (0x00000002u)
 Interlaced surface scan type flag. More...
 
#define NVM_SURF_ATTR_COLOR_STD_SRGB   (0x00000001u)
 NVM_SURF_ATTR_COLOR_STD_TYPE flags. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC601_SR   (0x00000002u)
 YCbCr Rec.601 (Studio Range) Color Std flag Range [Y:16-235 CbCr:16-240]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC601_ER   (0x00000003u)
 YCbCr Rec.601 (Extended Range) Color Std flag Range [YCbCr:0-255]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC709_SR   (0x00000004u)
 YCbCr Rec.709 (Studio Range) Color Std flag Range [Y:16-235 CbCr:16-240]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC709_ER   (0x00000005u)
 YCbCr Rec.709 (Extended Range) Color Std flag Range [YCbCr:0-255]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC2020_RGB   (0x00000006u)
 RGB Rec.2020 Color Std flag Range [RGB:0-1023 (10-bit), 0-4095 (12-bit), 0-65535(16-bit)]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC2020_SR   (0x00000007u)
 YCbCr Rec.2020 (Studio Range) Color Std flag Range [Y:64-940 CbCr:64-960 (10-bit), Y:256-3760 CbCr:256-3840 (12-bit), Y:1024-60160 CbCr:1024-61440(16-bit)]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC2020_ER   (0x00000008u)
 YCbCr Rec.2020 (Extended Range) Color Std flag Range [YCbCr:0-1023 (10-bit), 0-4095 (12-bit), 0-65535(16-bit)]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_YcCbcCrc_SR   (0x00000009u)
 YcCbcCrc Rec.2020 (Studio Range) Color Std flag Range [Y:64-940 CbCr:64-960 (10-bit), Y:256-3760 CbCr:256-3840 (12-bit), Y:1024-60160 CbCr:1024-61440(16-bit)]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_YcCbcCrc_ER   (0x0000000Au)
 YcCbcCrc Rec.2020 (Extended Range) Color Std flag Range [YCbCr:0-1023 (10-bit), 0-4095 (12-bit), 0-65535(16-bit)]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_SENSOR_RGBA   (0x0000000Bu)
 Sensor RGBA Color Std flag. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC2020PQ_ER   (0x0000000Cu)
 YCbCr Rec.2020PQ (Extended Range) Color Std flag Range [YCbCr:0-65535 (16-bit)]. More...
 
#define NvMediaSurfaceType   uint32_t
 Defines the set of NvMedia surface types. More...
 
#define NvMediaSurfaceType_Unsupported   (99999u)
 Unsupported types. More...
 
#define NvMediaSurfaceType_Video_420   (1000u)
 Obsolete Video surface for 4:2:0 format video decoders. More...
 
#define NvMediaSurfaceType_Video_420_10bit   (1001u)
 
#define NvMediaSurfaceType_Video_420_12bit   (1002u)
 
#define NvMediaSurfaceType_Video_422   (1003u)
 Obsolete Video surface for 4:2:2 format video decoders. More...
 
#define NvMediaSurfaceType_Video_422_10bit   (1004u)
 
#define NvMediaSurfaceType_Video_422_12bit   (1005u)
 
#define NvMediaSurfaceType_Video_444   (1006u)
 Obsolete Video surface for 4:4:4 format video decoders. More...
 
#define NvMediaSurfaceType_Video_444_10bit   (1007u)
 
#define NvMediaSurfaceType_Video_444_12bit   (1008u)
 
#define NvMediaSurfaceType_VideoCapture_422   (1009u)
 Obsolete Video capture surface for 4:2:2 format. More...
 
#define NvMediaSurfaceType_VideoCapture_YUYV_422   (1010u)
 Obsolete Video capture surface for YUYV format. More...
 
#define NvMediaSurfaceType_R8G8B8A8   (1011u)
 Obsolete R8G8B8A8 surface type. More...
 
#define NvMediaSurfaceType_R8G8B8A8_BottomOrigin   (1012u)
 Obsolete R8G8B8A8 surface type used for video rendering. More...
 
#define NvMediaSurfaceType_Image_Monochrome   (1013u)
 Obsolete Monochrome image. More...
 
#define NvMediaSurfaceType_Image_YUV_420   (1014u)
 Obsolete 4:2:0 format image. More...
 
#define NvMediaSurfaceType_Image_YUV_422   (1015u)
 Obsolete 4:2:2 format image. More...
 
#define NvMediaSurfaceType_Image_YUV_444   (1016u)
 Obsolete 4:4:4 format image. More...
 
#define NvMediaSurfaceType_Image_YUYV_422   (1017u)
 Obsolete 4:2:2 format packed image with YUYV component order. More...
 
#define NvMediaSurfaceType_Image_RGBA   (1018u)
 Obsolete RGBA image type. More...
 
#define NvMediaSurfaceType_Image_RAW   (1019u)
 Obsolete RAW image type. More...
 
#define NvMediaSurfaceType_Image_V16Y16U16X16   (1020u)
 Obsolete 4:4:4:4 format packed image with VYUX component order. More...
 
#define NvMediaSurfaceType_Image_Y16   (1021u)
 Obsolete 16-bit Y data image. More...
 
#define NvMediaSurfaceType_Image_X2U10Y10V10   (1022u)
 Obsolete 4:4:4:4 format packed image with XUYV component order. More...
 
#define NvMediaSurfaceType_Image_Y10U8V8_420   (1023u)
 Obsolete 4:2:0 semi-planar YUV. More...
 
#define NvMediaSurfaceType_Image_Y10   (1024u)
 Obsolete 10-bit Y data image. More...
 
#define NvMediaSurfaceType_A8   (1025u)
 Obsolete A8 alpha surface. More...
 
#define NvMediaSurfaceType_YV12   NvMediaSurfaceType_Video_420
 Obsolete 4:2:0 video surface type. More...
 
#define NvMediaSurfaceType_YV16   NvMediaSurfaceType_Video_422
 Obsolete 4:2:2 video surface type. More...
 
#define NvMediaSurfaceType_YV24   NvMediaSurfaceType_Video_444
 Obsolete 4:4:4 video surface type. More...
 
#define NvMediaSurfaceType_YV16x2   NvMediaSurfaceType_VideoCapture_422
 Obsolete 4:2:2 video capture surface type. More...
 

Enumerations

enum  NvMediaSurfFormatAttrType {
  NVM_SURF_ATTR_SURF_TYPE = 0u,
  NVM_SURF_ATTR_LAYOUT,
  NVM_SURF_ATTR_DATA_TYPE,
  NVM_SURF_ATTR_MEMORY,
  NVM_SURF_ATTR_SUB_SAMPLING_TYPE,
  NVM_SURF_ATTR_BITS_PER_COMPONENT,
  NVM_SURF_ATTR_COMPONENT_ORDER,
  NVM_SURF_FMT_ATTR_MAX
}
 Defines NvMedia Surface format attribute types. More...
 
enum  NvMediaSurfAllocAttrType {
  NVM_SURF_ATTR_WIDTH = 0u,
  NVM_SURF_ATTR_HEIGHT,
  NVM_SURF_ATTR_EMB_LINES_TOP,
  NVM_SURF_ATTR_EMB_LINES_BOTTOM,
  NVM_SURF_ATTR_CPU_ACCESS,
  NVM_SURF_ATTR_ALLOC_TYPE,
  NVM_SURF_ATTR_PEER_VM_ID,
  NVM_SURF_ATTR_SCAN_TYPE,
  NVM_SURF_ATTR_COLOR_STD_TYPE,
  NVM_SURF_ALLOC_ATTR_MAX
}
 Defines NvMedia Surface allocation attribute types. More...
 

Functions

NvMediaSurfaceType NvMediaSurfaceFormatGetType (const NvMediaSurfFormatAttr *attrs, uint32_t numAttrs)
 Gets NvMediaSurfaceType for the input NvMediaSurfFormatAttr. More...
 
NvMediaStatus NvMediaSurfaceFormatGetAttrs (NvMediaSurfaceType type, NvMediaSurfFormatAttr *attrs, uint32_t numAttrs)
 Gets NvMediaSurfFormatAttr for the input surface type. More...
 
NvMediaStatus NvMediaSurfaceGetVersion (NvMediaVersion *version)
 Gets the surface version information for the NvMediaSurface component. More...