NVIDIA DRIVE OS Linux API Reference

5.1.0.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Surface Handling API

Detailed Description

Defines and manages image and video surface objects.

NvMedia Surfaces are video RAM surfaces storing YUV, RGBA or RAW data. They can store one or more surfaces depending on the surface types.

Data Structures

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

Macros

#define NVMEDIA_SURFACE_VERSION_MAJOR   1
 Major Version number. More...
 
#define NVMEDIA_SURFACE_VERSION_MINOR   9
 Minor Version number. More...
 
#define NVM_SURF_ATTR_SURF_TYPE_YUV   0x00000001
 NVM_SURF_ATTR_SURF_TYPE flags. More...
 
#define NVM_SURF_ATTR_SURF_TYPE_RGBA   0x00000002
 RGBA surface type flag. More...
 
#define NVM_SURF_ATTR_SURF_TYPE_RAW   0x00000003
 RAW surface type flag. More...
 
#define NVM_SURF_ATTR_LAYOUT_BL   0x00000001
 NVM_SURF_ATTR_LAYOUT flags. More...
 
#define NVM_SURF_ATTR_LAYOUT_PL   0x00000002
 Pitch Linear (PL) surface layout flag. More...
 
#define NVM_SURF_ATTR_DATA_TYPE_UINT   0x00000001
 NVM_SURF_ATTR_DATA_TYPE flags. More...
 
#define NVM_SURF_ATTR_DATA_TYPE_INT   0x00000002
 Integer surface data type flag. More...
 
#define NVM_SURF_ATTR_DATA_TYPE_FLOAT   0x00000003
 Float surface data type flag. More...
 
#define NVM_SURF_ATTR_DATA_TYPE_FLOATISP   0x00000004
 FloatISP surface data type flag. More...
 
#define NVM_SURF_ATTR_MEMORY_PLANAR   0x00000001
 NVM_SURF_ATTR_MEMORY flags. More...
 
#define NVM_SURF_ATTR_MEMORY_SEMI_PLANAR   0x00000002
 Semi-Planar surface memory type flag. More...
 
#define NVM_SURF_ATTR_MEMORY_PACKED   0x00000003
 Packed surface memory type flag. More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_420   0x00000001
 NVM_SURF_ATTR_SUB_SAMPLING_TYPE flags for YUV surface types "R" indicates a transpose. More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422   0x00000002
 4:2:2 sub-sampling type flag More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_444   0x00000003
 4:4:4 sub-sampling type flag More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422R   0x00000004
 4:2:2 transposed sub-sampling type flag More...
 
#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE   0x00000000
 sub-sampling type not applicable flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_8   0x00000001
 NVM_SURF_ATTR_BITS_PER_COMPONENT flags If a layout is not specified, it is a uniform layout across components. More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_10   0x00000002
 10-bit per component flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_12   0x00000003
 12-bit per component flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_14   0x00000004
 14-bit per component flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_16   0x00000005
 16-bit per component flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_32   0x00000006
 32-bit per component flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_16_8_8   0x00000007
 16:8:8 bits per component layout flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_10_8_8   0x00000008
 10:8:8 bits per component layout flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_2_10_10_10   0x00000009
 2:10:10:10 bits per component layout flag More...
 
#define NVM_SURF_ATTR_BITS_PER_COMPONENT_20   0x0000000A
 20-bit per component flag More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_LUMA   0x00000001
 NVM_SURF_ATTR_COMPONENT_ORDER flags for YUV surface type. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_YUV   0x00000002
 YUV component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_YVU   0x00000003
 YVU component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_YUYV   0x00000004
 YUYV component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_YVYU   0x00000005
 YVYU component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_VYUY   0x00000006
 VYUY component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_UYVY   0x00000007
 UYVY component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_XUYV   0x00000008
 XUYV component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_XYUV   0x00000009
 XYUV component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_VUYX   0x0000000A
 VUYX component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_ALPHA   0x00000011
 NVM_SURF_ATTR_PIXEL_ORDER flags for RGBA surface type. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RGBA   0x00000012
 RGBA component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_ARGB   0x00000013
 ARGB component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_BGRA   0x00000014
 BGRA component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RG   0x00000015
 RG component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RGGB   0x00000021
 NVM_SURF_ATTR_PIXEL_ORDER flags for RAW surface type. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_BGGR   0x00000022
 BGGR component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_GRBG   0x00000023
 GRBG component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_GBRG   0x00000024
 GBRG component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RCCB   0x00000025
 RCCB component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_BCCR   0x00000026
 BCCR component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CRBC   0x00000027
 CRBC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CBRC   0x00000028
 CBRC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_RCCC   0x00000029
 RCCC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CCCR   0x0000002A
 CCCR component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CRCC   0x0000002B
 CRCC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CCRC   0x0000002C
 CCRC component order flag. More...
 
#define NVM_SURF_ATTR_COMPONENT_ORDER_CCCC   0x0000002D
 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_CPU_ACCESS_UNCACHED   0x00000001
 NVM_SURF_ATTR_CPU_ACCESS flags. More...
 
#define NVM_SURF_ATTR_CPU_ACCESS_CACHED   0x00000002
 Cached (mapped) access type flag. More...
 
#define NVM_SURF_ATTR_CPU_ACCESS_UNMAPPED   0x00000003
 Unmapped access type flag. More...
 
#define NVM_SURF_ATTR_ALLOC_ISOCHRONOUS   0x00000001
 NVM_SURF_ATTR_ALLOC_TYPE flags. More...
 
#define NVM_SURF_ATTR_ALLOC_SECURED   0x00000002
 Secured buffer allocation flag. More...
 
#define NVM_SURF_ATTR_SCAN_PROGRESSIVE   0x00000001
 NVM_SURF_ATTR_SCAN_TYPE flags. More...
 
#define NVM_SURF_ATTR_SCAN_INTERLACED   0x00000002
 Interlaced surface scan type flag. More...
 
#define NVM_SURF_ATTR_COLOR_STD_SRGB   0x00000001
 NVM_SURF_ATTR_COLOR_STD_TYPE flags. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC601_SR   0x00000002
 YCbCr Rec.601 (Studio Range) Color Std flag Range [Y:16-235 CbCr:16-240]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC601_ER   0x00000003
 YCbCr Rec.601 (Extended Range) Color Std flag Range [YCbCr:0-255]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC709_SR   0x00000004
 YCbCr Rec.709 (Studio Range) Color Std flag Range [Y:16-235 CbCr:16-240]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC709_ER   0x00000005
 YCbCr Rec.709 (Extended Range) Color Std flag Range [YCbCr:0-255]. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC2020_RGB   0x00000006
 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   0x00000007
 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   0x00000008
 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   0x00000009
 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   0x0000000A
 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   0x0000000B
 Sensor RGBA Color Std flag This color std flag is used to represent demosaiced and white-balanced sensor bayer data in linear space. More...
 
#define NVM_SURF_ATTR_COLOR_STD_REC2020PQ_ER   0x0000000C
 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_Video_420   1000
 Video surface for 4:2:0 format video decoders. More...
 
#define NvMediaSurfaceType_Video_420_10bit   1001
 
#define NvMediaSurfaceType_Video_420_12bit   1002
 
#define NvMediaSurfaceType_Video_422   1003
 Video surface for 4:2:2 format video decoders. More...
 
#define NvMediaSurfaceType_Video_422_10bit   1004
 
#define NvMediaSurfaceType_Video_422_12bit   1005
 
#define NvMediaSurfaceType_Video_444   1006
 Video surface for 4:4:4 format video decoders. More...
 
#define NvMediaSurfaceType_Video_444_10bit   1007
 
#define NvMediaSurfaceType_Video_444_12bit   1008
 
#define NvMediaSurfaceType_VideoCapture_422   1009
 Video capture surface for 4:2:2 format. More...
 
#define NvMediaSurfaceType_VideoCapture_YUYV_422   1010
 Video capture surface for YUYV format. More...
 
#define NvMediaSurfaceType_R8G8B8A8   1011
 R8G8B8A8 surface type. More...
 
#define NvMediaSurfaceType_R8G8B8A8_BottomOrigin   1012
 R8G8B8A8 surface type used for video rendering. More...
 
#define NvMediaSurfaceType_Image_Monochrome   1013
 Monochrome image. More...
 
#define NvMediaSurfaceType_Image_YUV_420   1014
 4:2:0 format image. More...
 
#define NvMediaSurfaceType_Image_YUV_422   1015
 4:2:2 format image. More...
 
#define NvMediaSurfaceType_Image_YUV_444   1016
 4:4:4 format image. More...
 
#define NvMediaSurfaceType_Image_YUYV_422   1017
 4:2:2 format packed image with YUYV component order. More...
 
#define NvMediaSurfaceType_Image_RGBA   1018
 RGBA image type. More...
 
#define NvMediaSurfaceType_Image_RAW   1019
 RAW image type. More...
 
#define NvMediaSurfaceType_Image_V16Y16U16X16   1020
 4:4:4:4 format packed image with VYUX component order. More...
 
#define NvMediaSurfaceType_Image_Y16   1021
 16-bit Y data image. More...
 
#define NvMediaSurfaceType_Image_X2U10Y10V10   1022
 4:4:4:4 format packed image with XUYV component order. More...
 
#define NvMediaSurfaceType_Image_Y10U8V8_420   1023
 4:2:0 semi-planar YUV More...
 
#define NvMediaSurfaceType_Image_Y10   1024
 10-bit Y data image. More...
 
#define NvMediaSurfaceType_A8   1025
 A8 alpha surface. More...
 
#define NvMediaSurfaceType_Unsupported   99999
 Unsupported types. 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 = 0,
  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,
  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 (NvMediaSurfFormatAttr *attrs, unsigned int numAttrs)
 Gets the NvMedia surface format type for the input surface format attributes. More...
 
NvMediaStatus NvMediaSurfaceFormatGetAttrs (NvMediaSurfaceType type, NvMediaSurfFormatAttr *attrs, unsigned int numAttrs)
 Gets NvMedia surface format attributes for the input surface type. More...
 
NvMediaStatus NvMediaSurfaceGetVersion (NvMediaVersion *version)
 Returns the version information for the NvMediaSurface component. More...
 

Macro Definition Documentation

#define NVM_SURF_ATTR_ALLOC_ISOCHRONOUS   0x00000001

NVM_SURF_ATTR_ALLOC_TYPE flags.

Isochronous buffer allocation flag

Definition at line 380 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_ALLOC_SECURED   0x00000002

Secured buffer allocation flag.

Definition at line 382 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_10   0x00000002

10-bit per component flag

Definition at line 124 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_12   0x00000003

12-bit per component flag

Definition at line 126 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_14   0x00000004

14-bit per component flag

Definition at line 128 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_16   0x00000005

16-bit per component flag

Definition at line 130 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_20   0x0000000A

20-bit per component flag

Definition at line 141 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_32   0x00000006

32-bit per component flag

Definition at line 132 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_8   0x00000001

NVM_SURF_ATTR_BITS_PER_COMPONENT flags If a layout is not specified, it is a uniform layout across components.

8-bit per component flag

Definition at line 122 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_10_8_8   0x00000008

10:8:8 bits per component layout flag

Definition at line 137 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_16_8_8   0x00000007

16:8:8 bits per component layout flag

Definition at line 135 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_BITS_PER_COMPONENT_LAYOUT_2_10_10_10   0x00000009

2:10:10:10 bits per component layout flag

Definition at line 139 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_REC2020_ER   0x00000008

YCbCr Rec.2020 (Extended Range) Color Std flag Range [YCbCr:0-1023 (10-bit), 0-4095 (12-bit), 0-65535(16-bit)].

Definition at line 430 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_REC2020_RGB   0x00000006

RGB Rec.2020 Color Std flag Range [RGB:0-1023 (10-bit), 0-4095 (12-bit), 0-65535(16-bit)].

Definition at line 418 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_REC2020_SR   0x00000007

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)].

Definition at line 424 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_REC2020PQ_ER   0x0000000C

YCbCr Rec.2020PQ (Extended Range) Color Std flag Range [YCbCr:0-65535 (16-bit)].

Definition at line 455 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_REC601_ER   0x00000003

YCbCr Rec.601 (Extended Range) Color Std flag Range [YCbCr:0-255].

Definition at line 404 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_REC601_SR   0x00000002

YCbCr Rec.601 (Studio Range) Color Std flag Range [Y:16-235 CbCr:16-240].

Definition at line 400 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_REC709_ER   0x00000005

YCbCr Rec.709 (Extended Range) Color Std flag Range [YCbCr:0-255].

Definition at line 412 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_REC709_SR   0x00000004

YCbCr Rec.709 (Studio Range) Color Std flag Range [Y:16-235 CbCr:16-240].

Definition at line 408 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_SENSOR_RGBA   0x0000000B

Sensor RGBA Color Std flag This color std flag is used to represent demosaiced and white-balanced sensor bayer data in linear space.

Range [RGBA: 0.0 -1.0 (16-bit float)]

Definition at line 450 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_SRGB   0x00000001

NVM_SURF_ATTR_COLOR_STD_TYPE flags.

sRGB Color Std flag Range [RGB:0-255]

Definition at line 396 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_YcCbcCrc_ER   0x0000000A

YcCbcCrc Rec.2020 (Extended Range) Color Std flag Range [YCbCr:0-1023 (10-bit), 0-4095 (12-bit), 0-65535(16-bit)].

Definition at line 442 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COLOR_STD_YcCbcCrc_SR   0x00000009

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)].

Definition at line 436 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_ALPHA   0x00000011

NVM_SURF_ATTR_PIXEL_ORDER flags for RGBA surface type.

Alpha component order flag

Definition at line 167 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_ARGB   0x00000013

ARGB component order flag.

Definition at line 171 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_BCCR   0x00000026

BCCR component order flag.

Definition at line 190 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_BGGR   0x00000022

BGGR component order flag.

Definition at line 181 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_BGRA   0x00000014

BGRA component order flag.

Definition at line 173 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_CBRC   0x00000028

CBRC component order flag.

Definition at line 194 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_CCCC   0x0000002D

CCCC component order flag.

Definition at line 206 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_CCCR   0x0000002A

CCCR component order flag.

Definition at line 199 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_CCRC   0x0000002C

CCRC component order flag.

Definition at line 203 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_CRBC   0x00000027

CRBC component order flag.

Definition at line 192 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_CRCC   0x0000002B

CRCC component order flag.

Definition at line 201 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_GBRG   0x00000024

GBRG component order flag.

Definition at line 185 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_GRBG   0x00000023

GRBG component order flag.

Definition at line 183 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_LUMA   0x00000001

NVM_SURF_ATTR_COMPONENT_ORDER flags for YUV surface type.

Luma component order flag

Definition at line 145 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_RCCB   0x00000025

RCCB component order flag.

Definition at line 188 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_RCCC   0x00000029

RCCC component order flag.

Definition at line 197 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_RG   0x00000015

RG component order flag.

Definition at line 175 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_RGBA   0x00000012

RGBA component order flag.

Definition at line 169 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_RGGB   0x00000021

NVM_SURF_ATTR_PIXEL_ORDER flags for RAW surface type.

RGGB component order flag

Definition at line 179 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_UYVY   0x00000007

UYVY component order flag.

Definition at line 157 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_VUYX   0x0000000A

VUYX component order flag.

Definition at line 163 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_VYUY   0x00000006

VYUY component order flag.

Definition at line 155 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_XUYV   0x00000008

XUYV component order flag.

Definition at line 159 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_XYUV   0x00000009

XYUV component order flag.

Definition at line 161 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_YUV   0x00000002

YUV component order flag.

Definition at line 147 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_YUYV   0x00000004

YUYV component order flag.

Definition at line 151 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_YVU   0x00000003

YVU component order flag.

Definition at line 149 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_COMPONENT_ORDER_YVYU   0x00000005

YVYU component order flag.

Definition at line 153 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_CPU_ACCESS_CACHED   0x00000002

Cached (mapped) access type flag.

Definition at line 373 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_CPU_ACCESS_UNCACHED   0x00000001

NVM_SURF_ATTR_CPU_ACCESS flags.

Uncached (mapped) access type flag

Definition at line 371 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_CPU_ACCESS_UNMAPPED   0x00000003

Unmapped access type flag.

Definition at line 375 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_DATA_TYPE_FLOAT   0x00000003

Float surface data type flag.

Definition at line 92 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_DATA_TYPE_FLOATISP   0x00000004

FloatISP surface data type flag.

Definition at line 94 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_DATA_TYPE_INT   0x00000002

Integer surface data type flag.

Definition at line 90 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_DATA_TYPE_UINT   0x00000001

NVM_SURF_ATTR_DATA_TYPE flags.

Unsigned Integer surface data type flag

Definition at line 88 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_LAYOUT_BL   0x00000001

NVM_SURF_ATTR_LAYOUT flags.

Block Linear (BL) surface layout flag

Definition at line 82 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_LAYOUT_PL   0x00000002

Pitch Linear (PL) surface layout flag.

Definition at line 84 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_MEMORY_PACKED   0x00000003

Packed surface memory type flag.

Definition at line 102 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_MEMORY_PLANAR   0x00000001

NVM_SURF_ATTR_MEMORY flags.

Planar surface memory type flag

Definition at line 98 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_MEMORY_SEMI_PLANAR   0x00000002

Semi-Planar surface memory type flag.

Definition at line 100 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SCAN_INTERLACED   0x00000002

Interlaced surface scan type flag.

Definition at line 389 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SCAN_PROGRESSIVE   0x00000001

NVM_SURF_ATTR_SCAN_TYPE flags.

Progressive surface scan type flag

Definition at line 387 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_420   0x00000001

NVM_SURF_ATTR_SUB_SAMPLING_TYPE flags for YUV surface types "R" indicates a transpose.

4:2:0 sub-sampling type flag

Definition at line 108 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422   0x00000002

4:2:2 sub-sampling type flag

Definition at line 110 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_422R   0x00000004

4:2:2 transposed sub-sampling type flag

Definition at line 114 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_444   0x00000003

4:4:4 sub-sampling type flag

Definition at line 112 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE   0x00000000

sub-sampling type not applicable flag

Definition at line 116 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SURF_TYPE_RAW   0x00000003

RAW surface type flag.

Definition at line 78 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SURF_TYPE_RGBA   0x00000002

RGBA surface type flag.

Definition at line 76 of file nvmedia_surface.h.

#define NVM_SURF_ATTR_SURF_TYPE_YUV   0x00000001

NVM_SURF_ATTR_SURF_TYPE flags.

YUV surface type flag

Definition at line 74 of file nvmedia_surface.h.

#define NVM_SURF_FMT_DEFINE_ATTR (   x)
Value:
{ \
.value = 0, \
}, \
{ \
.value = 0, \
}, \
{ \
.value = 0, \
}, \
{ \
.value = 0, \
}, \
{ \
.value = 0, \
}, \
{ \
.value = 0, \
}, \
{ \
.value = 0, \
}, \
}; \
! Surface type flags.
NvMediaSurfFormatAttrType type
Surface Format Attribute Type.
! Surface layout type flags.
! Bits per component flags.
Holds NvMedia Surface format attributes.
! Surface sub sampling type flags.
! Pixel order flags.
! Surface memory type flags.
! Surface data type flags.

A helper macro to define surface format attributes.

Definition at line 221 of file nvmedia_surface.h.

#define NVM_SURF_FMT_SET_ATTR_RAW (   attr,
  order,
  datatype,
  bpc,
  layout 
)
Value:
{ \
attr[0].type = NVM_SURF_ATTR_SURF_TYPE; \
attr[0].value = NVM_SURF_ATTR_SURF_TYPE_RAW; \
\
attr[1].type = NVM_SURF_ATTR_LAYOUT; \
attr[1].value = NVM_SURF_ATTR_LAYOUT_##layout; \
\
attr[2].type = NVM_SURF_ATTR_DATA_TYPE; \
attr[2].value = NVM_SURF_ATTR_DATA_TYPE_##datatype; \
\
attr[3].type = NVM_SURF_ATTR_MEMORY; \
attr[3].value = NVM_SURF_ATTR_MEMORY_PACKED; \
\
attr[4].value = 0; \
\
attr[5].value = NVM_SURF_ATTR_BITS_PER_COMPONENT_##bpc; \
\
attr[6].value = NVM_SURF_ATTR_COMPONENT_ORDER_##order; \
}
! Surface type flags.
#define NVM_SURF_ATTR_SURF_TYPE_RAW
RAW surface type flag.
#define NVM_SURF_ATTR_MEMORY_PACKED
Packed surface memory type flag.
! Surface layout type flags.
! Bits per component flags.
! Surface sub sampling type flags.
! Pixel order flags.
! Surface memory type flags.
! Surface data type flags.

A helper macro to set RAW surface format attributes.

Before setting the values, use NVM_SURF_FMT_SET_ATTR_RAW to define attr.

Definition at line 315 of file nvmedia_surface.h.

#define NVM_SURF_FMT_SET_ATTR_RGBA (   attr,
  order,
  datatype,
  bpc,
  layout 
)
Value:
{ \
attr[0].type = NVM_SURF_ATTR_SURF_TYPE; \
attr[0].value = NVM_SURF_ATTR_SURF_TYPE_RGBA; \
\
attr[1].type = NVM_SURF_ATTR_LAYOUT; \
attr[1].value = NVM_SURF_ATTR_LAYOUT_##layout; \
\
attr[2].type = NVM_SURF_ATTR_DATA_TYPE; \
attr[2].value = NVM_SURF_ATTR_DATA_TYPE_##datatype; \
\
attr[3].type = NVM_SURF_ATTR_MEMORY; \
attr[3].value = NVM_SURF_ATTR_MEMORY_PACKED; \
\
attr[4].value = 0; \
\
attr[5].value = NVM_SURF_ATTR_BITS_PER_COMPONENT_##bpc; \
\
attr[6].value = NVM_SURF_ATTR_COMPONENT_ORDER_##order; \
}
! Surface type flags.
#define NVM_SURF_ATTR_MEMORY_PACKED
Packed surface memory type flag.
! Surface layout type flags.
! Bits per component flags.
! Surface sub sampling type flags.
! Pixel order flags.
! Surface memory type flags.
! Surface data type flags.
#define NVM_SURF_ATTR_SURF_TYPE_RGBA
RGBA surface type flag.

A helper macro to set RGBA surface format attributes.

attr paramater must be defined before setting the values using NVM_SURF_FMT_SET_ATTR_RGBA

Definition at line 287 of file nvmedia_surface.h.

#define NVM_SURF_FMT_SET_ATTR_YUV (   attr,
  order,
  samplingtype,
  memory,
  datatype,
  bpc,
  layout 
)
Value:
{ \
attr[0].type = NVM_SURF_ATTR_SURF_TYPE; \
attr[0].value = NVM_SURF_ATTR_SURF_TYPE_YUV; \
\
attr[1].type = NVM_SURF_ATTR_LAYOUT; \
attr[1].value = NVM_SURF_ATTR_LAYOUT_##layout; \
\
attr[2].type = NVM_SURF_ATTR_DATA_TYPE; \
attr[2].value = NVM_SURF_ATTR_DATA_TYPE_##datatype; \
\
attr[3].type = NVM_SURF_ATTR_MEMORY; \
attr[3].value = NVM_SURF_ATTR_MEMORY_##memory; \
\
attr[4].value = NVM_SURF_ATTR_SUB_SAMPLING_TYPE_##samplingtype; \
\
attr[5].value = NVM_SURF_ATTR_BITS_PER_COMPONENT_##bpc; \
\
attr[6].value = NVM_SURF_ATTR_COMPONENT_ORDER_##order; \
}
! Surface type flags.
! Surface layout type flags.
#define NVM_SURF_ATTR_SURF_TYPE_YUV
NVM_SURF_ATTR_SURF_TYPE flags.
! Bits per component flags.
! Surface sub sampling type flags.
! Pixel order flags.
! Surface memory type flags.
! Surface data type flags.

A helper macro to set YUV surface format attributes.

attr paramater must be defined before setting the values using NVM_SURF_FMT_SET_ATTR_YUV For NVM_SURF_ATTR_COMPONENT_ORDER_XUYV and NVM_SURF_ATTR_COMPONENT_ORDER_LUMA, set sampling type to be NVM_SURF_ATTR_SUB_SAMPLING_TYPE_NONE

Definition at line 259 of file nvmedia_surface.h.

#define NVMEDIA_SURFACE_VERSION_MAJOR   1

Major Version number.

Definition at line 46 of file nvmedia_surface.h.

#define NVMEDIA_SURFACE_VERSION_MINOR   9

Minor Version number.

Definition at line 48 of file nvmedia_surface.h.

#define NvMediaSurfaceType   uint32_t

Defines the set of NvMedia surface types.

Definition at line 470 of file nvmedia_surface.h.

#define NvMediaSurfaceType_A8   1025

A8 alpha surface.

Definition at line 525 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_Monochrome   1013

Monochrome image.

Definition at line 501 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_RAW   1019

RAW image type.

Definition at line 513 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_RGBA   1018

RGBA image type.

Definition at line 511 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_V16Y16U16X16   1020

4:4:4:4 format packed image with VYUX component order.

Definition at line 515 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_X2U10Y10V10   1022

4:4:4:4 format packed image with XUYV component order.

Definition at line 519 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_Y10   1024

10-bit Y data image.

Definition at line 523 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_Y10U8V8_420   1023

4:2:0 semi-planar YUV

Definition at line 521 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_Y16   1021

16-bit Y data image.

Definition at line 517 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_YUV_420   1014

4:2:0 format image.

Definition at line 503 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_YUV_422   1015

4:2:2 format image.

Definition at line 505 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_YUV_444   1016

4:4:4 format image.

Definition at line 507 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Image_YUYV_422   1017

4:2:2 format packed image with YUYV component order.

Definition at line 509 of file nvmedia_surface.h.

#define NvMediaSurfaceType_R8G8B8A8   1011

R8G8B8A8 surface type.

Definition at line 495 of file nvmedia_surface.h.

#define NvMediaSurfaceType_R8G8B8A8_BottomOrigin   1012

R8G8B8A8 surface type used for video rendering.

Surfaces that are interacting with EGL Stream functions must be in this format.

Definition at line 499 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Unsupported   99999

Unsupported types.

Definition at line 527 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_420   1000

Video surface for 4:2:0 format video decoders.

The actual physical surface format is selected based on the chip architecture.

Definition at line 475 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_420_10bit   1001

Definition at line 476 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_420_12bit   1002

Definition at line 477 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_422   1003

Video surface for 4:2:2 format video decoders.

The actual physical surface format is selected based on the chip architecture.

Definition at line 481 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_422_10bit   1004

Definition at line 482 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_422_12bit   1005

Definition at line 483 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_444   1006

Video surface for 4:4:4 format video decoders.

The actual physical surface format is selected based on the chip architecture.

Definition at line 487 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_444_10bit   1007

Definition at line 488 of file nvmedia_surface.h.

#define NvMediaSurfaceType_Video_444_12bit   1008

Definition at line 489 of file nvmedia_surface.h.

#define NvMediaSurfaceType_VideoCapture_422   1009

Video capture surface for 4:2:2 format.

Definition at line 491 of file nvmedia_surface.h.

#define NvMediaSurfaceType_VideoCapture_YUYV_422   1010

Video capture surface for YUYV format.

Definition at line 493 of file nvmedia_surface.h.

#define NvMediaSurfaceType_YV12   NvMediaSurfaceType_Video_420

Obsolete 4:2:0 video surface type.

Definition at line 530 of file nvmedia_surface.h.

#define NvMediaSurfaceType_YV16   NvMediaSurfaceType_Video_422

Obsolete 4:2:2 video surface type.

Definition at line 532 of file nvmedia_surface.h.

#define NvMediaSurfaceType_YV16x2   NvMediaSurfaceType_VideoCapture_422

Obsolete 4:2:2 video capture surface type.

Definition at line 536 of file nvmedia_surface.h.

#define NvMediaSurfaceType_YV24   NvMediaSurfaceType_Video_444

Obsolete 4:4:4 video surface type.

Definition at line 534 of file nvmedia_surface.h.

Enumeration Type Documentation

Defines NvMedia Surface Allocation attribute types.

Enumerator
NVM_SURF_ATTR_WIDTH 

! Surface width

NVM_SURF_ATTR_HEIGHT 

! Surface height (excluding embedded data lines)

NVM_SURF_ATTR_EMB_LINES_TOP 

! Embedded lines top

NVM_SURF_ATTR_EMB_LINES_BOTTOM 

! Embedded lines bottom

NVM_SURF_ATTR_CPU_ACCESS 

! CPU access to surface flags (default: uncached)

NVM_SURF_ATTR_ALLOC_TYPE 

! Allocation type, isochronous or secured (default: none)

NVM_SURF_ATTR_PEER_VM_ID 

! Peer VM ID in case of shared buffers

NVM_SURF_ATTR_SCAN_TYPE 

! Surface scan type (default: Progressive)

NVM_SURF_ATTR_COLOR_STD_TYPE 

! Color Standard type (default: YCbCr Rec.601 (Extended Range) for YUV surface types, sRGB for RGB surface types)

NVM_SURF_ALLOC_ATTR_MAX 

! Maximum number of surface allocation attributes

Definition at line 342 of file nvmedia_surface.h.

Defines NvMedia Surface format attribute types.

Enumerator
NVM_SURF_ATTR_SURF_TYPE 

! Surface type flags.

NVM_SURF_ATTR_LAYOUT 

! Surface layout type flags.

NVM_SURF_ATTR_DATA_TYPE 

! Surface data type flags.

NVM_SURF_ATTR_MEMORY 

! Surface memory type flags.

NVM_SURF_ATTR_SUB_SAMPLING_TYPE 

! Surface sub sampling type flags.

NVM_SURF_ATTR_BITS_PER_COMPONENT 

! Bits per component flags.

NVM_SURF_ATTR_COMPONENT_ORDER 

! Pixel order flags.

NVM_SURF_FMT_ATTR_MAX 

! Maximum number of surface format attributes.

Definition at line 53 of file nvmedia_surface.h.

Function Documentation

NvMediaStatus NvMediaSurfaceFormatGetAttrs ( NvMediaSurfaceType  type,
NvMediaSurfFormatAttr attrs,
unsigned int  numAttrs 
)

Gets NvMedia surface format attributes for the input surface type.

Parameters
[in]typeNvMediaSurfacetype of the surface.
[in]attrsA pointer to array of NvMediaSurfFormatAttr. The attribute value is returned for the input attribute type NvMediaSurfFormatAttrType for each array element.
[in]numAttrsNumber of attributes in the array.
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_ERROR
NVMEDIA_STATUS_NOT_SUPPORTED
NvMediaSurfaceType NvMediaSurfaceFormatGetType ( NvMediaSurfFormatAttr attrs,
unsigned int  numAttrs 
)

Gets the NvMedia surface format type for the input surface format attributes.

Parameters
[in]attrsAn array of surface format attributes.
[in]numAttrsNumber of attributes in the array.
Returns
NvMediaSurfaceType for the input attributes (or) NvMediaSurfaceType_Unsupported if unsuccessful.
NvMediaStatus NvMediaSurfaceGetVersion ( NvMediaVersion version)

Returns the version information for the NvMediaSurface component.

Parameters
[in]versionA pointer to a NvMediaVersion structure to be filled by the NvMediaSurface component.
Return values
NvMediaStatusThe status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER if the pointer is invalid.