Jetson Linux API Reference

35.2.1 Release
nvbufsurface.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA Corporation is strictly prohibited.
9  */
10 
28 #ifndef NVBUFSURFACE_H_
29 #define NVBUFSURFACE_H_
30 
31 #include <stdint.h>
32 #include <stdbool.h>
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
46 #define STRUCTURE_PADDING 4
47 
49 #define NVBUF_MAX_PLANES 4
50 
55 #define NVBUFSURFACE_CHROMA_SUBSAMPLING_HORIZ_DEFAULT 0
56 #define NVBUFSURFACE_CHROMA_SUBSAMPLING_VERT_DEFAULT 1
57 
58 #define NVBUFSURFACE_CHROMA_SUBSAMPLING_PARAMS_DEFAULT \
59  { \
60  NVBUFSURFACE_CHROMA_SUBSAMPLING_HORIZ_DEFAULT, \
61  NVBUFSURFACE_CHROMA_SUBSAMPLING_VERT_DEFAULT \
62  }
63 
67 typedef enum
68 {
75 
82 typedef enum
83 {
99 
103 typedef enum
104 {
247 
250 
254 typedef enum
255 {
261 
265 typedef enum
266 {
284 
288 typedef enum
289 {
295 
300 {
311 
314 
319 {
321  uint32_t num_planes;
334 
337 
338 
343 {
345  uint8_t chromaLocHoriz;
346  uint8_t chromaLocVert;
348 
352 typedef struct NvBufSurfaceCreateParams {
354  uint32_t gpuId;
356  uint32_t width;
358  uint32_t height;
361  uint32_t size;
373 
387 
390 
394 typedef struct NvBufSurfaceMappedAddr {
398  void *eglImage;
399 
402 
406 typedef struct NvBufSurfaceParamsEx {
420 
423 
427 typedef struct NvBufSurfaceParams {
429  uint32_t width;
431  uint32_t height;
433  uint32_t pitch;
440  uint64_t bufferDesc;
442  uint32_t dataSize;
445  void * dataPtr;
453 
456 
460 typedef struct NvBufSurface {
462  uint32_t gpuId;
464  uint32_t batchSize;
467  uint32_t numFilled;
475 
477 } NvBufSurface;
478 
498 int NvBufSurfaceCreate (NvBufSurface **surf, uint32_t batchSize,
499  NvBufSurfaceCreateParams *params);
500 
517 int NvBufSurfaceAllocate (NvBufSurface **surf, uint32_t batchSize,
518  NvBufSurfaceAllocateParams *paramsext);
519 
528 
568 int NvBufSurfaceMap (NvBufSurface *surf, int index, int plane, NvBufSurfaceMemMapFlags type);
569 
581 int NvBufSurfaceUnMap (NvBufSurface *surf, int index, int plane);
582 
599 int NvBufSurfaceCopy (NvBufSurface *srcSurf, NvBufSurface *dstSurf);
600 
617 int NvBufSurface2Raw (NvBufSurface *Surf, unsigned int index, unsigned int plane, unsigned int outwidth, unsigned int outheight, unsigned char *ptr);
618 
635 int Raw2NvBufSurface (unsigned char *ptr, unsigned int index, unsigned int plane, unsigned int inwidth, unsigned int inheight, NvBufSurface *Surf);
636 
651 int NvBufSurfaceSyncForCpu (NvBufSurface *surf, int index, int plane);
652 
667 int NvBufSurfaceSyncForDevice (NvBufSurface *surf, int index, int plane);
668 
677 int NvBufSurfaceFromFd (int dmabuf_fd, void **buffer);
678 
694 int NvBufSurfaceMemSet (NvBufSurface *surf, int index, int plane, uint8_t value);
695 
722 int NvBufSurfaceMapEglImage (NvBufSurface *surf, int index);
723 
733 int NvBufSurfaceUnMapEglImage (NvBufSurface *surf, int index);
734 
737 #ifdef __cplusplus
738 }
739 #endif
740 #endif /* NVBUFSURFACE_H_ */
NvBufSurfaceParamsEx
struct NvBufSurfaceParamsEx NvBufSurfaceParamsEx
Hold the information(extended) of single buffer in the batch.
NVBUF_COLOR_FORMAT_NV12_10LE
@ NVBUF_COLOR_FORMAT_NV12_10LE
Specifies BT.601 colorspace - Y/CbCr 4:2:0 10-bit multi-planar.
Definition: nvbufsurface.h:164
NVBUF_COLOR_FORMAT_YUV420_709_ER
@ NVBUF_COLOR_FORMAT_YUV420_709_ER
Specifies BT.709 colorspace - YUV420 ER multi-planar.
Definition: nvbufsurface.h:170
NvBufSurfaceAllocateParams::_reserved
void * _reserved[STRUCTURE_PADDING]
Definition: nvbufsurface.h:388
NvBufSurfaceTag_VIDEO_DEC
@ NvBufSurfaceTag_VIDEO_DEC
tag for H264/H265/VP9 Video Decoder.
Definition: nvbufsurface.h:95
NVBUF_COLOR_FORMAT_NV12_709
@ NVBUF_COLOR_FORMAT_NV12_709
Specifies BT.709 colorspace - Y/CbCr 4:2:0 multi-planar.
Definition: nvbufsurface.h:172
NvBufSurfaceMappedAddr
struct NvBufSurfaceMappedAddr NvBufSurfaceMappedAddr
Hold the pointers of mapped buffer.
NvBufSurfaceCreateParams::colorFormat
NvBufSurfaceColorFormat colorFormat
Holds the color format of the buffer.
Definition: nvbufsurface.h:366
NVBUF_COLOR_FORMAT_YUV420_2020
@ NVBUF_COLOR_FORMAT_YUV420_2020
Specifies BT.2020 colorspace - YUV420 multi-planar.
Definition: nvbufsurface.h:176
NvBufSurfaceParamsEx::sizeofvaliddatainbytes
int32_t sizeofvaliddatainbytes
size of the valid data from the first to the last valid byte.
Definition: nvbufsurface.h:412
NvBufSurfaceChromaSubsamplingParams
Holds Chroma Subsampling parameters for NvBufSurface allocation.
Definition: nvbufsurface.h:342
NvBufSurfacePlaneParamsEx
Holds plane wise parameters(extended) of a buffer.
Definition: nvbufsurface.h:299
NvBufSurfaceCreateParams::height
uint32_t height
Holds the height of the buffer.
Definition: nvbufsurface.h:358
NVBUF_MEM_CUDA_PINNED
@ NVBUF_MEM_CUDA_PINNED
Specifies CUDA Host memory type.
Definition: nvbufsurface.h:272
NVBUF_COLOR_FORMAT_A32
@ NVBUF_COLOR_FORMAT_A32
Specifies Optical flow SAD calculation Buffer format.
Definition: nvbufsurface.h:242
NvBufSurfaceSyncForDevice
int NvBufSurfaceSyncForDevice(NvBufSurface *surf, int index, int plane)
Syncs the hardware memory cache for the device.
NvBufSurfaceTag_PROTECTED
@ NvBufSurfaceTag_PROTECTED
tag for VPR Buffers.
Definition: nvbufsurface.h:91
NvBufSurfacePlaneParamsEx::_reserved
void * _reserved[STRUCTURE_PADDING *NVBUF_MAX_PLANES]
Definition: nvbufsurface.h:312
NvBufSurfaceMap
int NvBufSurfaceMap(NvBufSurface *surf, int index, int plane, NvBufSurfaceMemMapFlags type)
Maps hardware batched buffers to the HOST or CPU address space.
NVBUF_COLOR_FORMAT_VYUY
@ NVBUF_COLOR_FORMAT_VYUY
Specifies BT.601 colorspace - YUV 4:2:2 planar.
Definition: nvbufsurface.h:130
NVBUF_DISPLAYSCANFORMAT_INTERLACED
@ NVBUF_DISPLAYSCANFORMAT_INTERLACED
Interlaced scan formats.
Definition: nvbufsurface.h:293
NvBufSurfacePlaneParamsEx::scanformat
NvBufSurfaceDisplayScanFormat scanformat[NVBUF_MAX_PLANES]
display scan format - progressive/interlaced.
Definition: nvbufsurface.h:302
NvBufSurfacePlaneParams::psize
uint32_t psize[NVBUF_MAX_PLANES]
Holds the sizes of planes in bytes.
Definition: nvbufsurface.h:331
NVBUF_COLOR_FORMAT_B8_G8_R8
@ NVBUF_COLOR_FORMAT_B8_G8_R8
Specifies BGR- unsigned 8 bit multiplanar plane.
Definition: nvbufsurface.h:192
NVBUF_COLOR_FORMAT_UYVY
@ NVBUF_COLOR_FORMAT_UYVY
Specifies BT.601 colorspace - YUV 4:2:2 planar.
Definition: nvbufsurface.h:126
NVBUF_COLOR_FORMAT_VYUY_ER
@ NVBUF_COLOR_FORMAT_VYUY_ER
Specifies BT.601 colorspace - YUV ER 4:2:2 planar.
Definition: nvbufsurface.h:132
NvBufSurfaceDisplayScanFormat
NvBufSurfaceDisplayScanFormat
Defines display scan formats for NvBufSurface video planes.
Definition: nvbufsurface.h:288
NvBufSurfaceTag_CAMERA
@ NvBufSurfaceTag_CAMERA
tag for Camera.
Definition: nvbufsurface.h:87
NVBUF_COLOR_FORMAT_GRAY8
@ NVBUF_COLOR_FORMAT_GRAY8
Specifies 8 bit GRAY scale - single plane.
Definition: nvbufsurface.h:108
NVBUF_COLOR_FORMAT_BGRA
@ NVBUF_COLOR_FORMAT_BGRA
Specifies BGRA-8-8-8-8 single plane.
Definition: nvbufsurface.h:146
NvBufSurface::surfaceList
NvBufSurfaceParams * surfaceList
Holds a pointer to an array of batched buffers.
Definition: nvbufsurface.h:474
NvBufSurfaceParamsEx::is_protected
bool is_protected
get buffer vpr information.
Definition: nvbufsurface.h:417
NvBufSurfacePlaneParams::width
uint32_t width[NVBUF_MAX_PLANES]
Holds the widths of planes.
Definition: nvbufsurface.h:323
NvBufSurfaceMemSet
int NvBufSurfaceMemSet(NvBufSurface *surf, int index, int plane, uint8_t value)
Fills each byte of the buffer(s) in an NvBufSurface with a provided value.
NVBUF_COLOR_FORMAT_NV12_12LE
@ NVBUF_COLOR_FORMAT_NV12_12LE
Specifies BT.601 colorspace - Y/CbCr 4:2:0 12-bit multi-planar.
Definition: nvbufsurface.h:166
NvBufSurfaceAllocateParams
struct NvBufSurfaceAllocateParams NvBufSurfaceAllocateParams
Hold extended parameters required to allocate NvBufSurface.
NVBUF_COLOR_FORMAT_NV16
@ NVBUF_COLOR_FORMAT_NV16
Specifies BT.601 colorspace - Y/CbCr 4:2:2 multi-planar.
Definition: nvbufsurface.h:206
NVBUF_COLOR_FORMAT_YUV420_ER
@ NVBUF_COLOR_FORMAT_YUV420_ER
Specifies BT.601 colorspace - YUV420 ER multi-planar.
Definition: nvbufsurface.h:114
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:460
NVBUF_COLOR_FORMAT_NV24_709_ER
@ NVBUF_COLOR_FORMAT_NV24_709_ER
Specifies BT.709_ER colorspace - Y/CbCr 4:4:4 multi-planar.
Definition: nvbufsurface.h:224
NvBufSurfacePlaneParamsEx::secondfieldoffset
uint32_t secondfieldoffset[NVBUF_MAX_PLANES]
offset of the second field for interlaced buffer.
Definition: nvbufsurface.h:304
NvBufSurfacePlaneParams::height
uint32_t height[NVBUF_MAX_PLANES]
Holds the heights of planes.
Definition: nvbufsurface.h:325
NvBufSurfaceTag_VIDEO_CONVERT
@ NvBufSurfaceTag_VIDEO_CONVERT
tag for Video Transform/Composite/Blend.
Definition: nvbufsurface.h:97
NVBUF_MEM_HANDLE
@ NVBUF_MEM_HANDLE
Specifies NVRM Handle type.
Definition: nvbufsurface.h:280
NvBufSurface
struct NvBufSurface NvBufSurface
Holds information about batched buffers.
NVBUF_COLOR_FORMAT_BGRx
@ NVBUF_COLOR_FORMAT_BGRx
Specifies BGRx-8-8-8-8 single plane.
Definition: nvbufsurface.h:154
NVBUF_COLOR_FORMAT_NV16_10LE
@ NVBUF_COLOR_FORMAT_NV16_10LE
Specifies BT.601 colorspace - Y/CbCr 4:2:2 10-bit semi-planar.
Definition: nvbufsurface.h:208
NVBUF_COLOR_FORMAT_NV16_709_ER
@ NVBUF_COLOR_FORMAT_NV16_709_ER
Specifies BT.709_ER colorspace - Y/CbCr 4:2:2 multi-planar.
Definition: nvbufsurface.h:222
NvBufSurfaceCreateParams::width
uint32_t width
Holds the width of the buffer.
Definition: nvbufsurface.h:356
NvBufSurfaceParams::dataPtr
void * dataPtr
Holds a pointer to allocated memory.
Definition: nvbufsurface.h:445
NvBufSurface::memType
NvBufSurfaceMemType memType
Holds type of memory for buffers in the batch.
Definition: nvbufsurface.h:472
NvBufSurfaceUnMapEglImage
int NvBufSurfaceUnMapEglImage(NvBufSurface *surf, int index)
Destroys the previously created EGLImage object(s).
NVBUF_MEM_CUDA_UNIFIED
@ NVBUF_MEM_CUDA_UNIFIED
Specifies CUDA Unified memory type.
Definition: nvbufsurface.h:276
NvBufSurfaceCreateParams::memType
NvBufSurfaceMemType memType
Holds the type of memory to be allocated.
Definition: nvbufsurface.h:371
NVBUF_COLOR_FORMAT_NV12_10LE_709_ER
@ NVBUF_COLOR_FORMAT_NV12_10LE_709_ER
Specifies BT.709 colorspace - Y/CbCr ER 4:2:0 10-bit multi-planar.
Definition: nvbufsurface.h:184
NvBufSurfaceAllocate
int NvBufSurfaceAllocate(NvBufSurface **surf, uint32_t batchSize, NvBufSurfaceAllocateParams *paramsext)
Allocate batch of buffers.
NVBUF_MEM_CUDA_DEVICE
@ NVBUF_MEM_CUDA_DEVICE
Specifies CUDA Device memory type.
Definition: nvbufsurface.h:274
NvBufSurfacePlaneParams::offset
uint32_t offset[NVBUF_MAX_PLANES]
Holds the offsets of planes in bytes.
Definition: nvbufsurface.h:329
NVBUF_COLOR_FORMAT_YVU420_ER
@ NVBUF_COLOR_FORMAT_YVU420_ER
Specifies BT.601 colorspace - YVU420 ER multi-planar.
Definition: nvbufsurface.h:116
NVBUF_COLOR_FORMAT_YUV420_709
@ NVBUF_COLOR_FORMAT_YUV420_709
Specifies BT.709 colorspace - YUV420 multi-planar.
Definition: nvbufsurface.h:168
NVBUF_COLOR_FORMAT_UYVP
@ NVBUF_COLOR_FORMAT_UYVP
Specifies BT.601 colorspace - 10 bit YUV 4:2:2 interleaved.
Definition: nvbufsurface.h:244
NVBUF_COLOR_FORMAT_xRGB
@ NVBUF_COLOR_FORMAT_xRGB
Specifies xRGB-8-8-8-8 single plane.
Definition: nvbufsurface.h:156
NVBUF_COLOR_FORMAT_NV24_709
@ NVBUF_COLOR_FORMAT_NV24_709
Specifies BT.709 colorspace - Y/CbCr 4:4:4 multi-planar.
Definition: nvbufsurface.h:220
NvBufSurfaceCreateParams::layout
NvBufSurfaceLayout layout
Holds the surface layout.
Definition: nvbufsurface.h:369
NVBUF_MAX_PLANES
#define NVBUF_MAX_PLANES
Defines the maximum number of planes.
Definition: nvbufsurface.h:49
NVBUF_LAYOUT_PITCH
@ NVBUF_LAYOUT_PITCH
Specifies pitch layout.
Definition: nvbufsurface.h:257
NvBufSurfaceAllocateParams::displayscanformat
NvBufSurfaceDisplayScanFormat displayscanformat
Display scan format.
Definition: nvbufsurface.h:382
NvBufSurfaceParamsEx::planeParamsex
NvBufSurfacePlaneParamsEx planeParamsex
plane wise extended info
Definition: nvbufsurface.h:419
NVBUF_MEM_DEFAULT
@ NVBUF_MEM_DEFAULT
Specifies the default memory type, i.e.
Definition: nvbufsurface.h:270
NVBUF_COLOR_FORMAT_YUYV_ER
@ NVBUF_COLOR_FORMAT_YUYV_ER
Specifies BT.601 colorspace - YUV ER 4:2:2 planar.
Definition: nvbufsurface.h:136
NVBUF_MEM_SYSTEM
@ NVBUF_MEM_SYSTEM
Specifies memory allocated by malloc().
Definition: nvbufsurface.h:282
NvBufSurfacePlaneParams::_reserved
void * _reserved[STRUCTURE_PADDING *NVBUF_MAX_PLANES]
Definition: nvbufsurface.h:335
NvBufSurfaceDestroy
int NvBufSurfaceDestroy(NvBufSurface *surf)
Free the batched buffers previously allocated through NvBufSurfaceCreate.
NVBUF_COLOR_FORMAT_NV21_12LE
@ NVBUF_COLOR_FORMAT_NV21_12LE
Specifies BT.601 colorspace - Y/CrCb 4:2:0 12-bit multi-planar.
Definition: nvbufsurface.h:202
NvBufSurfaceParams::colorFormat
NvBufSurfaceColorFormat colorFormat
Holds the color format of the buffer.
Definition: nvbufsurface.h:435
NVBUF_COLOR_FORMAT_NV24
@ NVBUF_COLOR_FORMAT_NV24
Specifies BT.601 colorspace - Y/CbCr 4:4:4 multi-planar.
Definition: nvbufsurface.h:210
NvBufSurfacePlaneParams
struct NvBufSurfacePlaneParams NvBufSurfacePlaneParams
Holds plane wise parameters of a buffer.
NVBUF_COLOR_FORMAT_ARGB
@ NVBUF_COLOR_FORMAT_ARGB
Specifies ARGB-8-8-8-8 single plane.
Definition: nvbufsurface.h:148
NVBUF_COLOR_FORMAT_YVYU
@ NVBUF_COLOR_FORMAT_YVYU
Specifies BT.601 colorspace - YUV 4:2:2 planar.
Definition: nvbufsurface.h:138
NVBUF_COLOR_FORMAT_NV12_10LE_ER
@ NVBUF_COLOR_FORMAT_NV12_10LE_ER
Specifies BT.601 colorspace - Y/CbCr ER 4:2:0 10-bit multi-planar.
Definition: nvbufsurface.h:180
NVBUF_COLOR_FORMAT_NV12_2020
@ NVBUF_COLOR_FORMAT_NV12_2020
Specifies BT.2020 colorspace - Y/CbCr 4:2:0 multi-planar.
Definition: nvbufsurface.h:178
NVBUF_COLOR_FORMAT_xBGR
@ NVBUF_COLOR_FORMAT_xBGR
Specifies xBGR-8-8-8-8 single plane.
Definition: nvbufsurface.h:158
NVBUF_COLOR_FORMAT_YUYV
@ NVBUF_COLOR_FORMAT_YUYV
Specifies BT.601 colorspace - YUV 4:2:2 planar.
Definition: nvbufsurface.h:134
NVBUF_COLOR_FORMAT_NV16_709
@ NVBUF_COLOR_FORMAT_NV16_709
Specifies BT.709 colorspace - Y/CbCr 4:2:2 multi-planar.
Definition: nvbufsurface.h:218
NVBUF_COLOR_FORMAT_B32F_G32F_R32F
@ NVBUF_COLOR_FORMAT_B32F_G32F_R32F
Specifies BGR-32bit Floating point multiplanar plane.
Definition: nvbufsurface.h:196
NvBufSurfaceParams::bufferDesc
uint64_t bufferDesc
Holds a DMABUF FD.
Definition: nvbufsurface.h:440
NvBufSurface::isContiguous
bool isContiguous
Holds an "is contiguous" flag.
Definition: nvbufsurface.h:470
STRUCTURE_PADDING
#define STRUCTURE_PADDING
Defines the default padding length for reserved fields of structures.
Definition: nvbufsurface.h:46
NvBufSurfaceParams::paramex
NvBufSurfaceParamsEx * paramex
pointers of extended parameters of single buffer in the batch.
Definition: nvbufsurface.h:452
NvBufSurfaceParams::layout
NvBufSurfaceLayout layout
Holds BL or PL.
Definition: nvbufsurface.h:437
NvBufSurfaceParams
struct NvBufSurfaceParams NvBufSurfaceParams
Hold the information of single buffer in the batch.
NvBufSurfaceParams
Hold the information of single buffer in the batch.
Definition: nvbufsurface.h:427
NvBufSurfaceParamsEx
Hold the information(extended) of single buffer in the batch.
Definition: nvbufsurface.h:406
NvBufSurface2Raw
int NvBufSurface2Raw(NvBufSurface *Surf, unsigned int index, unsigned int plane, unsigned int outwidth, unsigned int outheight, unsigned char *ptr)
Copies the NvBufSurface plane memory content to a raw buffer plane for a specific batched buffer.
NVBUF_COLOR_FORMAT_NV21
@ NVBUF_COLOR_FORMAT_NV21
Specifies BT.601 colorspace - Y/CbCr 4:2:0 multi-planar.
Definition: nvbufsurface.h:122
NvBufSurfaceAllocateParams::chromaSubsampling
NvBufSurfaceChromaSubsamplingParams chromaSubsampling
Chroma Subsampling parameters.
Definition: nvbufsurface.h:384
NVBUF_COLOR_FORMAT_BGRA_10_10_10_2_709
@ NVBUF_COLOR_FORMAT_BGRA_10_10_10_2_709
Specifies Non-linear RGB BT.709 colorspace - BGRA-10-10-10-2 planar.
Definition: nvbufsurface.h:238
NvBufSurfaceMappedAddr
Hold the pointers of mapped buffer.
Definition: nvbufsurface.h:394
NvBufSurfaceMappedAddr::addr
void * addr[NVBUF_MAX_PLANES]
Holds planewise pointers to a CPU mapped buffer.
Definition: nvbufsurface.h:396
NVBUF_COLOR_FORMAT_SIGNED_R16G16
@ NVBUF_COLOR_FORMAT_SIGNED_R16G16
Specifies color format for packed 2 signed shorts
Definition: nvbufsurface.h:188
NVBUF_COLOR_FORMAT_RGBA_10_10_10_2_2020
@ NVBUF_COLOR_FORMAT_RGBA_10_10_10_2_2020
Specifies Non-linear RGB BT.2020 colorspace - RGBA-10-10-10-2 planar.
Definition: nvbufsurface.h:236
NVBUF_COLOR_FORMAT_INVALID
@ NVBUF_COLOR_FORMAT_INVALID
Specifies an invalid color format.
Definition: nvbufsurface.h:106
NVBUF_COLOR_FORMAT_RGB
@ NVBUF_COLOR_FORMAT_RGB
Specifies RGB-8-8-8 single plane.
Definition: nvbufsurface.h:160
NVBUF_COLOR_FORMAT_RGBA_10_10_10_2_709
@ NVBUF_COLOR_FORMAT_RGBA_10_10_10_2_709
Specifies Non-linear RGB BT.709 colorspace - RGBA-10-10-10-2 planar.
Definition: nvbufsurface.h:234
NvBufSurfaceParams::mappedAddr
NvBufSurfaceMappedAddr mappedAddr
Holds pointers to mapped buffers.
Definition: nvbufsurface.h:450
NVBUF_COLOR_FORMAT_R8_G8_B8
@ NVBUF_COLOR_FORMAT_R8_G8_B8
Specifies RGB- unsigned 8 bit multiplanar plane.
Definition: nvbufsurface.h:190
NvBufSurfaceParams::pitch
uint32_t pitch
Holds the pitch of the buffer.
Definition: nvbufsurface.h:433
NvBufSurface::numFilled
uint32_t numFilled
Holds the number valid and filled buffers.
Definition: nvbufsurface.h:467
NvBufSurfaceParamsEx::chromaSubsampling
NvBufSurfaceChromaSubsamplingParams chromaSubsampling
chroma subsampling parameters.
Definition: nvbufsurface.h:415
NvBufSurfaceFromFd
int NvBufSurfaceFromFd(int dmabuf_fd, void **buffer)
Gets the NvBufSurface from the DMABUF FD.
NvBufSurfaceUnMap
int NvBufSurfaceUnMap(NvBufSurface *surf, int index, int plane)
Unmaps previously mapped buffer(s).
NVBUF_DISPLAYSCANFORMAT_PROGRESSIVE
@ NVBUF_DISPLAYSCANFORMAT_PROGRESSIVE
Progessive scan formats.
Definition: nvbufsurface.h:291
NVBUF_COLOR_FORMAT_UYVY_ER
@ NVBUF_COLOR_FORMAT_UYVY_ER
Specifies BT.601 colorspace - YUV ER 4:2:2 planar.
Definition: nvbufsurface.h:128
NVBUF_COLOR_FORMAT_NV24_10LE_709
@ NVBUF_COLOR_FORMAT_NV24_10LE_709
Specifies BT.709 colorspace - Y/CbCr 10 bit 4:4:4 multi-planar.
Definition: nvbufsurface.h:226
NVBUF_MAP_READ_WRITE
@ NVBUF_MAP_READ_WRITE
Specifies NvBufSurface mapping type "read/write.".
Definition: nvbufsurface.h:72
NvBufSurfaceTag
NvBufSurfaceTag
Defines tags that identify the components requesting a memory allocation.
Definition: nvbufsurface.h:82
NVBUF_COLOR_FORMAT_LAST
@ NVBUF_COLOR_FORMAT_LAST
Definition: nvbufsurface.h:248
NvBufSurfaceMemType
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: nvbufsurface.h:265
NvBufSurfaceAllocateParams
Hold extended parameters required to allocate NvBufSurface.
Definition: nvbufsurface.h:378
NvBufSurfacePlaneParamsEx
struct NvBufSurfacePlaneParamsEx NvBufSurfacePlaneParamsEx
Holds plane wise parameters(extended) of a buffer.
NVBUF_COLOR_FORMAT_YVU420
@ NVBUF_COLOR_FORMAT_YVU420
Specifies BT.601 colorspace - YUV420 multi-planar.
Definition: nvbufsurface.h:112
NvBufSurfaceParams::planeParams
NvBufSurfacePlaneParams planeParams
Holds planewise information (width, height, pitch, offset, etc.).
Definition: nvbufsurface.h:447
NVBUF_COLOR_FORMAT_UYVP_ER
@ NVBUF_COLOR_FORMAT_UYVP_ER
Specifies BT.601 colorspace - 10 bit YUV ER 4:2:2 interleaved.
Definition: nvbufsurface.h:246
NVBUF_COLOR_FORMAT_YVYU_ER
@ NVBUF_COLOR_FORMAT_YVYU_ER
Specifies BT.601 colorspace - YUV ER 4:2:2 planar.
Definition: nvbufsurface.h:140
NvBufSurfaceParams::height
uint32_t height
Holds the height of the buffer.
Definition: nvbufsurface.h:431
NVBUF_COLOR_FORMAT_NV21_10LE
@ NVBUF_COLOR_FORMAT_NV21_10LE
Specifies BT.601 colorspace - Y/CrCb 4:2:0 10-bit multi-planar.
Definition: nvbufsurface.h:200
NvBufSurfaceAllocateParams::memtag
NvBufSurfaceTag memtag
components tag to be used for memory allocation
Definition: nvbufsurface.h:386
NvBufSurfaceCopy
int NvBufSurfaceCopy(NvBufSurface *srcSurf, NvBufSurface *dstSurf)
Copies the content of source batched buffer(s) to destination batched buffer(s).
NvBufSurfaceLayout
NvBufSurfaceLayout
Specifies layout formats for NvBufSurface video planes.
Definition: nvbufsurface.h:254
Raw2NvBufSurface
int Raw2NvBufSurface(unsigned char *ptr, unsigned int index, unsigned int plane, unsigned int inwidth, unsigned int inheight, NvBufSurface *Surf)
Copies the raw buffer plane memory content to the NvBufSurface plane memory of a specific batched buf...
NvBufSurfacePlaneParams::num_planes
uint32_t num_planes
Holds the number of planes.
Definition: nvbufsurface.h:321
NvBufSurfacePlaneParamsEx::blockheightlog2
uint32_t blockheightlog2[NVBUF_MAX_PLANES]
block height of the planes for blockLinear layout buffer.
Definition: nvbufsurface.h:306
NvBufSurfaceSyncForCpu
int NvBufSurfaceSyncForCpu(NvBufSurface *surf, int index, int plane)
Syncs the HW memory cache for the CPU.
NvBufSurfaceParamsEx::startofvaliddata
int32_t startofvaliddata
offset in bytes from the start of the buffer to the first valid byte.
Definition: nvbufsurface.h:409
NvBufSurfaceChromaSubsamplingParams::chromaLocVert
uint8_t chromaLocVert
Definition: nvbufsurface.h:346
NvBufSurfaceCreateParams::size
uint32_t size
Holds the amount of memory to be allocated.
Definition: nvbufsurface.h:361
NVBUF_COLOR_FORMAT_YUV422
@ NVBUF_COLOR_FORMAT_YUV422
Specifies BT.601 colorspace - YUV422 multi-planar.
Definition: nvbufsurface.h:198
NVBUF_COLOR_FORMAT_NV21_ER
@ NVBUF_COLOR_FORMAT_NV21_ER
Specifies BT.601 colorspace - Y/CbCr ER 4:2:0 multi-planar.
Definition: nvbufsurface.h:124
NVBUF_COLOR_FORMAT_NV12_ER
@ NVBUF_COLOR_FORMAT_NV12_ER
Specifies BT.601 colorspace - Y/CbCr ER 4:2:0 multi-planar.
Definition: nvbufsurface.h:120
NvBufSurfaceParams::dataSize
uint32_t dataSize
Holds the amount of allocated memory.
Definition: nvbufsurface.h:442
NvBufSurface::gpuId
uint32_t gpuId
Holds a GPU ID.
Definition: nvbufsurface.h:462
NvBufSurfaceCreateParams
struct NvBufSurfaceCreateParams NvBufSurfaceCreateParams
Holds parameters required to allocate an NvBufSurface.
NVBUF_MAP_READ
@ NVBUF_MAP_READ
Specifies NvBufSurface mapping type "read.".
Definition: nvbufsurface.h:69
NVBUF_LAYOUT_BLOCK_LINEAR
@ NVBUF_LAYOUT_BLOCK_LINEAR
Specifies block linear layout.
Definition: nvbufsurface.h:259
NvBufSurface::batchSize
uint32_t batchSize
Holds the batch size.
Definition: nvbufsurface.h:464
NvBufSurfacePlaneParamsEx::physicaladdress
uint32_t physicaladdress[NVBUF_MAX_PLANES]
physical address of allocated planes.
Definition: nvbufsurface.h:308
NVBUF_COLOR_FORMAT_NV24_ER
@ NVBUF_COLOR_FORMAT_NV24_ER
Specifies BT.601_ER colorspace - Y/CbCr 4:4:4 multi-planar.
Definition: nvbufsurface.h:216
NvBufSurfacePlaneParams::pitch
uint32_t pitch[NVBUF_MAX_PLANES]
Holds the pitches of planes in bytes.
Definition: nvbufsurface.h:327
NVBUF_COLOR_FORMAT_YUV444
@ NVBUF_COLOR_FORMAT_YUV444
Specifies BT.601 colorspace - YUV444 multi-planar.
Definition: nvbufsurface.h:142
NVBUF_COLOR_FORMAT_NV24_10LE
@ NVBUF_COLOR_FORMAT_NV24_10LE
Specifies BT.601 colorspace - Y/CrCb 4:4:4 10-bit multi-planar.
Definition: nvbufsurface.h:212
NvBufSurfaceParamsEx::_reserved
void * _reserved[STRUCTURE_PADDING]
Definition: nvbufsurface.h:421
NvBufSurfaceCreateParams::isContiguous
bool isContiguous
Holds a "contiguous memory" flag.
Definition: nvbufsurface.h:364
NvBufSurfaceMappedAddr::eglImage
void * eglImage
Holds a pointer to a mapped EGLImage.
Definition: nvbufsurface.h:398
NVBUF_COLOR_FORMAT_ABGR
@ NVBUF_COLOR_FORMAT_ABGR
Specifies ABGR-8-8-8-8 single plane.
Definition: nvbufsurface.h:150
NVBUF_COLOR_FORMAT_NV12_10LE_709
@ NVBUF_COLOR_FORMAT_NV12_10LE_709
Specifies BT.709 colorspace - Y/CbCr 4:2:0 10-bit multi-planar.
Definition: nvbufsurface.h:182
NVBUF_MAP_WRITE
@ NVBUF_MAP_WRITE
Specifies NvBufSurface mapping type "write.".
Definition: nvbufsurface.h:70
NvBufSurfacePlaneParams
Holds plane wise parameters of a buffer.
Definition: nvbufsurface.h:318
NVBUF_COLOR_FORMAT_NV16_ER
@ NVBUF_COLOR_FORMAT_NV16_ER
Specifies BT.601_ER colorspace - Y/CbCr 4:2:2 multi-planar.
Definition: nvbufsurface.h:214
NvBufSurfaceParams::_reserved
void * _reserved[STRUCTURE_PADDING - 1]
Definition: nvbufsurface.h:454
NVBUF_COLOR_FORMAT_NV12
@ NVBUF_COLOR_FORMAT_NV12
Specifies BT.601 colorspace - Y/CbCr 4:2:0 multi-planar.
Definition: nvbufsurface.h:118
NvBufSurfaceTag_VIDEO_ENC
@ NvBufSurfaceTag_VIDEO_ENC
tag for H264/H265 Video Encoder.
Definition: nvbufsurface.h:93
NvBufSurfaceCreate
int NvBufSurfaceCreate(NvBufSurface **surf, uint32_t batchSize, NvBufSurfaceCreateParams *params)
Allocates a batch of buffers.
NVBUF_COLOR_FORMAT_NV12_12LE_2020
@ NVBUF_COLOR_FORMAT_NV12_12LE_2020
Specifies BT.2020 colorspace - Y/CbCr 4:2:0 12-bit multi-planar.
Definition: nvbufsurface.h:204
NvBufSurfaceMappedAddr::_reserved
void * _reserved[STRUCTURE_PADDING]
Definition: nvbufsurface.h:400
NVBUF_COLOR_FORMAT_BGR
@ NVBUF_COLOR_FORMAT_BGR
Specifies BGR-8-8-8 single plane.
Definition: nvbufsurface.h:162
NvBufSurfaceTag_JPEG
@ NvBufSurfaceTag_JPEG
tag for Jpeg Encoder/Decoder.
Definition: nvbufsurface.h:89
NvBufSurfaceChromaSubsamplingParams
struct NvBufSurfaceChromaSubsamplingParams NvBufSurfaceChromaSubsamplingParams
Holds Chroma Subsampling parameters for NvBufSurface allocation.
NVBUF_MEM_SURFACE_ARRAY
@ NVBUF_MEM_SURFACE_ARRAY
Specifies NVRM Surface Array type.
Definition: nvbufsurface.h:278
NVBUF_COLOR_FORMAT_NV12_10LE_2020
@ NVBUF_COLOR_FORMAT_NV12_10LE_2020
Specifies BT.2020 colorspace - Y/CbCr 4:2:0 10-bit multi-planar.
Definition: nvbufsurface.h:186
NvBufSurfaceMapEglImage
int NvBufSurfaceMapEglImage(NvBufSurface *surf, int index)
Creates an EGLImage from the memory of one or more NvBufSurface buffers.
NVBUF_COLOR_FORMAT_RGBA
@ NVBUF_COLOR_FORMAT_RGBA
Specifies RGBA-8-8-8-8 single plane.
Definition: nvbufsurface.h:144
NvBufSurfacePlaneParamsEx::flags
uint64_t flags[NVBUF_MAX_PLANES]
flags associated with planes
Definition: nvbufsurface.h:310
NVBUF_COLOR_FORMAT_BGRA_10_10_10_2_2020
@ NVBUF_COLOR_FORMAT_BGRA_10_10_10_2_2020
Specifies Non-linear RGB BT.2020 colorspace - BGRA-10-10-10-2 planar.
Definition: nvbufsurface.h:240
NvBufSurfaceAllocateParams::params
NvBufSurfaceCreateParams params
Hold legacy NvBufSurface creation parameters.
Definition: nvbufsurface.h:380
NvBufSurfacePlaneParams::bytesPerPix
uint32_t bytesPerPix[NVBUF_MAX_PLANES]
Holds the number of bytes occupied by a pixel in each plane.
Definition: nvbufsurface.h:333
NvBufSurfaceCreateParams
Holds parameters required to allocate an NvBufSurface.
Definition: nvbufsurface.h:352
NvBufSurfaceParams::width
uint32_t width
Holds the width of the buffer.
Definition: nvbufsurface.h:429
NvBufSurfaceMemMapFlags
NvBufSurfaceMemMapFlags
Defines mapping types of NvBufSurface.
Definition: nvbufsurface.h:67
NVBUF_COLOR_FORMAT_NV24_10LE_2020
@ NVBUF_COLOR_FORMAT_NV24_10LE_2020
Specifies BT.2020 colorspace - Y/CbCr 10 bit 4:4:4 multi-planar.
Definition: nvbufsurface.h:230
NvBufSurfaceCreateParams::gpuId
uint32_t gpuId
Holds the GPU ID.
Definition: nvbufsurface.h:354
NVBUF_COLOR_FORMAT_NV12_709_ER
@ NVBUF_COLOR_FORMAT_NV12_709_ER
Specifies BT.709 colorspace - Y/CbCr ER 4:2:0 multi-planar.
Definition: nvbufsurface.h:174
NVBUF_COLOR_FORMAT_YUV420
@ NVBUF_COLOR_FORMAT_YUV420
Specifies BT.601 colorspace - YUV420 multi-planar.
Definition: nvbufsurface.h:110
NvBufSurface::_reserved
void * _reserved[STRUCTURE_PADDING]
Definition: nvbufsurface.h:476
NvBufSurfaceColorFormat
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
Definition: nvbufsurface.h:103
NvBufSurfaceChromaSubsamplingParams::chromaLocHoriz
uint8_t chromaLocHoriz
location settings
Definition: nvbufsurface.h:345
NvBufSurfaceTag_NONE
@ NvBufSurfaceTag_NONE
tag None.
Definition: nvbufsurface.h:85
NVBUF_COLOR_FORMAT_R32F_G32F_B32F
@ NVBUF_COLOR_FORMAT_R32F_G32F_B32F
Specifies RGB-32bit Floating point multiplanar plane.
Definition: nvbufsurface.h:194
NVBUF_COLOR_FORMAT_NV24_12LE_2020
@ NVBUF_COLOR_FORMAT_NV24_12LE_2020
Specifies BT.2020 colorspace - Y/CbCr 12 bit 4:4:4 multi-planar.
Definition: nvbufsurface.h:232
NVBUF_COLOR_FORMAT_RGBx
@ NVBUF_COLOR_FORMAT_RGBx
Specifies RGBx-8-8-8-8 single plane.
Definition: nvbufsurface.h:152
NVBUF_COLOR_FORMAT_NV24_10LE_709_ER
@ NVBUF_COLOR_FORMAT_NV24_10LE_709_ER
Specifies BT.709 ER colorspace - Y/CbCr 10 bit 4:4:4 multi-planar.
Definition: nvbufsurface.h:228