NVIDIA DRIVE OS Linux SDK API Reference

5.1.15.2 Release
For Test and Development only

Detailed Description

Captures uncompressed video data, writing the results to a NvMediaVideoSurface.

A specific NvMedia implementation may support capturing multiple types of uncompressed video data. However, NvMediaVideoCapture objects are able to capture a specific type of uncompressed video data. This type must be specified during creation.

Data Structures

struct  NvMediaVideoCaptureSettings
 Video capture settings for CSI format. More...
 
struct  NvMediaVideoCapture
 Video capture object created by NvMediaVideoCaptureCreate. More...
 

Macros

#define NVMEDIA_VCP_VERSION_MAJOR   1
 Major Version number. More...
 
#define NVMEDIA_VCP_VERSION_MINOR   5
 Minor Version number. More...
 
#define NVMEDIA_VIDEO_CAPTURE_TIMEOUT_INFINITE
 Infinite time-out for NvMediaVideoCaptureGetFrameEx. More...
 
#define NVMEDIA_MAX_VCP_FRAME_BUFFERS
 Maximum number of capture buffers. More...
 

Enumerations

enum  NvMediaVideoCaptureInterfaceType {
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_A,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_B,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_AB,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_C,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_D,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_CD,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_E,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_F,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_EF,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_G,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_H,
  NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_GH
}
 Determines the video capture interface type for CSI interface. More...
 
enum  NvMediaVideoCaptureInputFormatType {
  NVMEDIA_VIDEO_CAPTURE_INPUT_FORMAT_TYPE_YUV422,
  NVMEDIA_VIDEO_CAPTURE_INPUT_FORMAT_TYPE_YUV444,
  NVMEDIA_VIDEO_CAPTURE_INPUT_FORMAT_TYPE_RGB888
}
 Determines the video capture input format type. More...
 

Functions

NvMediaStatus NvMediaVideoCaptureGetVersion (NvMediaVersion *version)
 Get the version information for the NvMedia VCP library. More...
 
NvMediaVideoCaptureNvMediaVideoCaptureCreate (NvMediaVideoCaptureSettings *settings)
 Creates a capture object used to capture various formats of analog or digital video input. More...
 
void NvMediaVideoCaptureDestroy (NvMediaVideoCapture *capture)
 Destroyx a video capture created by NvMediaVideoCaptureCreate. More...
 
void NvMediaVideoCaptureStop (NvMediaVideoCapture *capture)
 Stops a video capture. More...
 
NvMediaStatus NvMediaVideoCaptureGetFrameEx (NvMediaVideoCapture *capture, uint32_t millisecondTimeout, NvMediaVideoSurface **surface)
 Gets a captured frame with frame status. More...
 
NvMediaStatus NvMediaVideoCaptureFeedFrame (NvMediaVideoCapture *capture, NvMediaVideoSurface *surface, uint32_t millisecondTimeout)
 Adds a video frame to the video capture pool. More...
 
NvMediaStatus NvMediaVideoCaptureReleaseFrame (NvMediaVideoCapture *capture, NvMediaVideoSurface **surface)
 Gets a frame from the internal pool that user fed with NvMediaVideoCaptureFeedFrame after HW gives up to capture. More...
 
NvMediaStatus NvMediaVideoCaptureGetExtraLines (NvMediaVideoCapture *capture, NvMediaVideoSurface *surface, void *extraBuf, NvMediaRect *srcRect)
 Return extra lines data stored in a captured surface. More...
 

Macro Definition Documentation

◆ NVMEDIA_MAX_VCP_FRAME_BUFFERS

#define NVMEDIA_MAX_VCP_FRAME_BUFFERS

Maximum number of capture buffers.

Definition at line 56 of file nvmedia_vcp.h.

◆ NVMEDIA_VCP_VERSION_MAJOR

#define NVMEDIA_VCP_VERSION_MAJOR   1

Major Version number.

Definition at line 42 of file nvmedia_vcp.h.

◆ NVMEDIA_VCP_VERSION_MINOR

#define NVMEDIA_VCP_VERSION_MINOR   5

Minor Version number.

Definition at line 44 of file nvmedia_vcp.h.

◆ NVMEDIA_VIDEO_CAPTURE_TIMEOUT_INFINITE

#define NVMEDIA_VIDEO_CAPTURE_TIMEOUT_INFINITE

Infinite time-out for NvMediaVideoCaptureGetFrameEx.

Definition at line 50 of file nvmedia_vcp.h.

Enumeration Type Documentation

◆ NvMediaVideoCaptureInputFormatType

Determines the video capture input format type.

Enumerator
NVMEDIA_VIDEO_CAPTURE_INPUT_FORMAT_TYPE_YUV422 

Input format: YUV 4:2:2.

NVMEDIA_VIDEO_CAPTURE_INPUT_FORMAT_TYPE_YUV444 

Input format: YUV 4:4:4.

NVMEDIA_VIDEO_CAPTURE_INPUT_FORMAT_TYPE_RGB888 

Input format: RGBA.

Definition at line 91 of file nvmedia_vcp.h.

◆ NvMediaVideoCaptureInterfaceType

Determines the video capture interface type for CSI interface.

Enumerator
NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_A 

Interface: CSI, port: A.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_B 

Interface: CSI, port: B.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_AB 

Interface: CSI, port: AB.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_C 

Interface: CSI, port: C.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_D 

Interface: CSI, port: D.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_CD 

Interface: CSI, port: CD.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_E 

Interface: CSI, port: E.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_F 

Interface: CSI, port: F.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_EF 

Interface: CSI, port: EF.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_G 

Interface: CSI, port: G.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_H 

Interface: CSI, port: H.

NVMEDIA_VIDEO_CAPTURE_CSI_INTERFACE_TYPE_CSI_GH 

Interface: CSI, port: GH.

Definition at line 61 of file nvmedia_vcp.h.

Function Documentation

◆ NvMediaVideoCaptureCreate()

NvMediaVideoCapture* NvMediaVideoCaptureCreate ( NvMediaVideoCaptureSettings settings)

Creates a capture object used to capture various formats of analog or digital video input.

into a NvMediaVideoSurface. The supported surfaces must be obtained by /ref NvMediaSurfaceFormatGetType with:

◆ NvMediaVideoCaptureDestroy()

void NvMediaVideoCaptureDestroy ( NvMediaVideoCapture capture)

Destroyx a video capture created by NvMediaVideoCaptureCreate.

Parameters
[in]captureA pointer to the video capture to be destroyed.

◆ NvMediaVideoCaptureFeedFrame()

NvMediaStatus NvMediaVideoCaptureFeedFrame ( NvMediaVideoCapture capture,
NvMediaVideoSurface surface,
uint32_t  millisecondTimeout 
)

Adds a video frame to the video capture pool.

The pool size is determined by the maxBuffers parameter. See NvMediaVideoCaptureCreate.

Parameters
[in]captureThe video capture object to be used.
[in]surfaceThe surface to be added to the pool.
[in]millisecondTimeoutTime-out in milliseconds.
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_ERROR
NVMEDIA_STATUS_TIMED_OUT

◆ NvMediaVideoCaptureGetExtraLines()

NvMediaStatus NvMediaVideoCaptureGetExtraLines ( NvMediaVideoCapture capture,
NvMediaVideoSurface surface,
void *  extraBuf,
NvMediaRect srcRect 
)

Return extra lines data stored in a captured surface.

Currently only NVM_SURF_ATTR_SURF_TYPE_RGBA surface type is supported.

Parameters
[in]captureThe video capture to be used.
[in]surfaceSurface to get the extra lines from.
[in]extraBufThe buffer where the extra line data is stored.
[in]srcRectThe source rectangle extracted out as extra lines. If NULL, the extra lines (defined at the time of capture creation) from the source surface are extracted.
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER if any of the input parameter is NULL
NVMEDIA_STATUS_ERROR if the surface type is not supported

◆ NvMediaVideoCaptureGetFrameEx()

NvMediaStatus NvMediaVideoCaptureGetFrameEx ( NvMediaVideoCapture capture,
uint32_t  millisecondTimeout,
NvMediaVideoSurface **  surface 
)

Gets a captured frame with frame status.

This function blocks until a frame is available or until the timeout (in milliseconds) has been reached. To block without a timeout, specify NVMEDIA_VIDEO_CAPTURE_TIMEOUT_INFINITE for millisecondTimeout. The returned NvMediaVideoSurface must be passed back to the NvMediaVideoCapture object using NvMediaVideoCaptureReleaseFrame() after it has been processed. NvMediaVideoSurface gets NULL if surface capture object does not have sufficient buffers in the internal pool, meaning that too few NvMediaVideoSurface objects have been added to the capture object pool. When NvMediaVideoCaptureGetFrameEx() returns an NVMEDIA_STATUS_OK, that surface is idle and ready for immediate use.

Parameters
[in]captureA pointer to the video capture to be used.
[in]millisecondTimeoutTime-out, in milliseconds
[in,out]surfaceIndirect pointer to a surface that is ready for use.
Returns
NvMediaStatus The completion status of the operation.
NVMEDIA_STATUS_OK : surface has valid value, it is good to use.
NVMEDIA_STATUS_NONE_PENDING : surface is NULL, there is no fed frame, internel pool is empty.
NVMEDIA_STATUS_TIMED_OUT : surface is NULL, the frame is not ready for use.
NVMEDIA_STATUS_ERROR : surface is NULL, HW gives up to capture anymore. Please remove the frames from pool using NvMediaVideoCaptureStop.

◆ NvMediaVideoCaptureGetVersion()

NvMediaStatus NvMediaVideoCaptureGetVersion ( NvMediaVersion version)

Get the version information for the NvMedia VCP library.

Parameters
[in]versionA pointer to a NvMediaVersion structure to be filled by the function.
Returns
NvMediaStatus The status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER if the pointer is invalid.

◆ NvMediaVideoCaptureReleaseFrame()

NvMediaStatus NvMediaVideoCaptureReleaseFrame ( NvMediaVideoCapture capture,
NvMediaVideoSurface **  surface 
)

Gets a frame from the internal pool that user fed with NvMediaVideoCaptureFeedFrame after HW gives up to capture.

This function should be called until getting NVMEDIA_STATUS_ERROR.

Parameters
[in]captureThe video capture object to be used.
[in]surfaceThe frame was fed from user but HW gives up to capture.
Returns
NvMediaStatus The completion status of the operation.
NVMEDIA_STATUS_OK : returning the frame that user fed.
NVMEDIA_STATUS_ERROR : nothing to return.

◆ NvMediaVideoCaptureStop()

void NvMediaVideoCaptureStop ( NvMediaVideoCapture capture)

Stops a video capture.

Parameters
[in]captureThe video capture to be stopped.