DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Frame Capture Interface

Detailed Description

Defines FrameCapture module for performing capture of currently bound GL frame buffer.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwFrameCaptureParams
 Initialization parameters for the frame capture module. More...
 

Typedefs

typedef struct dwFrameCaptureObject * dwFrameCaptureHandle_t
 Handle to a Frame Capture module object. More...
 

Enumerations

enum  dwFrameCaptureMode {
  DW_FRAMECAPTURE_MODE_SCREENCAP = 1 << 0,
  DW_FRAMECAPTURE_MODE_SERIALIZE = 1 << 1
}
 Enables FrameCapture functionalities. These can be set as a logical OR between the two modes. Choosing a mode means that the resources needed by that feature will be allocated. More...
 

Functions

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrame (const dwImageHandle_t img, dwFrameCaptureHandle_t framecapture)
 Append a dwImageHandle frame to the capture and it's serialized. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameAsync (const dwImageHandle_t img, dwFrameCaptureHandle_t framecapture)
 Asynchronously append a dwImageHandle frame to the capture and it's serialized. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameCUDA (const dwImageCUDA *img, dwFrameCaptureHandle_t framecapture)
 Append a dwImageCUDA frame to the capture and it's serialized. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameCUDAAsync (const dwImageCUDA *img, dwFrameCaptureHandle_t framecapture)
 Asynchronously append a dwImageCUDA frame to the capture and it's serialized. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameGL (const dwImageGL *img, dwFrameCaptureHandle_t framecapture)
 Append a dwImageGL frame to the capture and it's serialized. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameGLAsync (const dwImageGL *img, dwFrameCaptureHandle_t framecapture)
 Asynchronously append a dwImageGL frame to the capture and it's serialized. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameNvMedia (const dwImageNvMedia *img, dwFrameCaptureHandle_t framecapture)
 Append a dwImageNvMedia frame to the capture and it's serialized. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameNvMediaAsync (const dwImageNvMedia *img, dwFrameCaptureHandle_t framecapture)
 Asynchronously append a dwImageNvMedia frame to the capture and it's serialized. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_initialize (dwFrameCaptureHandle_t *obj, const dwFrameCaptureParams *params, dwSALHandle_t sal, dwContextHandle_t ctx)
 Create a new frame capture module. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_release (dwFrameCaptureHandle_t framecapture)
 Releases the frame capture module. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_screenCapture (const dwImageGL **imageGL, const dwRect roi, dwFrameCaptureHandle_t framecapture)
 It grabs what is currently rendered on the current frame buffer and returns a dwImageGL out of it For example, it permits to serialize additional information, such as bounding boxes, labels, etc., that are rendered on top of the current GL frame. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_screenCaptureCustom (dwImageGL *imageGL, const dwRect roi, dwFrameCaptureHandle_t framecapture)
 It grabs what is currently rendered on the current frame buffer and blits onto the input dwImageGL. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_start (dwFrameCaptureHandle_t framecapture)
 Starts frame capture. More...
 
DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_stop (dwFrameCaptureHandle_t framecapture)
 Stops frame capture. More...
 

Data Structure Documentation

◆ dwFrameCaptureParams

struct dwFrameCaptureParams
Data Fields
bool captureCustom The frameCaptured image is returned as a dwImageGL.

By default (false) the resources for the dwImageGL are allocated automatically and the image received through the call dwFrameCapture_screenCapture. If true, then no resource will be allocated and the dwImageGL will have to be allocated by with dwImage_createGL()/dwImage_getGL and the frameCapture will return the image through dwFrameCapture_screenCaptureCustom()

uint32_t height Height of the GL window / image.
uint32_t mode Logic OR of the dwFrameCaptureMode. Can be either or all. Useful for not allocating useless resources.
dwSerializerParams params SensorSerializer parameters, see SensorSerializer.h.
bool serializeGL Boolean, if true it serializes DW_IMAGE_GL only, otherwise all other serializations (CUDA/CPU on X86, CUDA/NVMEDIA on Drive)
uint32_t width Width of the GL window / image.

Typedef Documentation

◆ dwFrameCaptureHandle_t

typedef struct dwFrameCaptureObject* dwFrameCaptureHandle_t

Handle to a Frame Capture module object.

Definition at line 63 of file FrameCapture.h.

Enumeration Type Documentation

◆ dwFrameCaptureMode

Enables FrameCapture functionalities. These can be set as a logical OR between the two modes. Choosing a mode means that the resources needed by that feature will be allocated.

Enumerator
DW_FRAMECAPTURE_MODE_SCREENCAP 

Screencapture mode allocates GL resources that enable the capture of the current rendering Window via dwFrameCapture_screenCapture. Will not work if no GL context exists.

DW_FRAMECAPTURE_MODE_SERIALIZE 

Serialize enables the creation of the serializer which allows the calls to dwFrameCapture_appendFrameX. The specific resources will depend on the properties passed to the FrameCapture but they will be at least the dwSensorSerializer and usually one ImageStreamer.

Definition at line 66 of file FrameCapture.h.

Function Documentation

◆ dwFrameCapture_appendFrame()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrame ( const dwImageHandle_t  img,
dwFrameCaptureHandle_t  framecapture 
)

Append a dwImageHandle frame to the capture and it's serialized.

Parameters
[in]imgdwImageHandle to serialize
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_appendFrameAsync()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameAsync ( const dwImageHandle_t  img,
dwFrameCaptureHandle_t  framecapture 
)

Asynchronously append a dwImageHandle frame to the capture and it's serialized.

Parameters
[in]imgdwImageHandle to serialize
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_appendFrameCUDA()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameCUDA ( const dwImageCUDA img,
dwFrameCaptureHandle_t  framecapture 
)

Append a dwImageCUDA frame to the capture and it's serialized.

Parameters
[in]imgdwImageCUDA to serialize
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_appendFrameCUDAAsync()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameCUDAAsync ( const dwImageCUDA img,
dwFrameCaptureHandle_t  framecapture 
)

Asynchronously append a dwImageCUDA frame to the capture and it's serialized.

Parameters
[in]imgdwImageCUDA to serialize
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_appendFrameGL()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameGL ( const dwImageGL img,
dwFrameCaptureHandle_t  framecapture 
)

Append a dwImageGL frame to the capture and it's serialized.

Parameters
[in]imgdwImageGL to serialize
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_appendFrameGLAsync()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameGLAsync ( const dwImageGL img,
dwFrameCaptureHandle_t  framecapture 
)

Asynchronously append a dwImageGL frame to the capture and it's serialized.

Parameters
[in]imgdwImageGL to serialize
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_appendFrameNvMedia()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameNvMedia ( const dwImageNvMedia img,
dwFrameCaptureHandle_t  framecapture 
)

Append a dwImageNvMedia frame to the capture and it's serialized.

Parameters
[in]imgdwImageNvMedia to serialize
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_appendFrameNvMediaAsync()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_appendFrameNvMediaAsync ( const dwImageNvMedia img,
dwFrameCaptureHandle_t  framecapture 
)

Asynchronously append a dwImageNvMedia frame to the capture and it's serialized.

Parameters
[in]imgdwImageNvMedia to serialize
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_initialize()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_initialize ( dwFrameCaptureHandle_t obj,
const dwFrameCaptureParams params,
dwSALHandle_t  sal,
dwContextHandle_t  ctx 
)

Create a new frame capture module.

Parameters
[out]objHandle to the frame capture module being initialized.
[in]paramsFrame capture initialization parameters.
[in]salHandle to current SAL interface
[in]ctxHandle to the current driveworks context.
Returns
DW_INVALID_ARGUMENT - if given arguments are invalid
DW_SUCCESS

◆ dwFrameCapture_release()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_release ( dwFrameCaptureHandle_t  framecapture)

Releases the frame capture module.

Parameters
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_screenCapture()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_screenCapture ( const dwImageGL **  imageGL,
const dwRect  roi,
dwFrameCaptureHandle_t  framecapture 
)

It grabs what is currently rendered on the current frame buffer and returns a dwImageGL out of it For example, it permits to serialize additional information, such as bounding boxes, labels, etc., that are rendered on top of the current GL frame.

It is independent from the original source of the GL frame, i.e. video or camera, and platform, i.e. Linux or Drive platforms.

Parameters
[out]imageGLa pointer to a dwImageGL pointer containing the captured window
[in]roiRegion of interest to be captured
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_screenCaptureCustom()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_screenCaptureCustom ( dwImageGL imageGL,
const dwRect  roi,
dwFrameCaptureHandle_t  framecapture 
)

It grabs what is currently rendered on the current frame buffer and blits onto the input dwImageGL.

Parameters
[out]imageGLa pointer to a previously allocated dwImageGL
[in]roiRegion of interest to be captured
[in]framecaptureHandle to the frame capture module being released.
Returns
DW_INVALID_HANDLE - if given handle is invalid
DW_SUCCESS

◆ dwFrameCapture_start()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_start ( dwFrameCaptureHandle_t  framecapture)

Starts frame capture.

This method creates a new thread and begins the serialization loop.

Parameters
[in]framecaptureSpecifies the frame capture handle.
Returns
DW_NOT_AVAILABLE - serialization is not available at this moment.
DW_INVALID_HANDLE - if given handle is not valid.
DW_SUCCESS

◆ dwFrameCapture_stop()

DW_VIZ_API_PUBLIC dwStatus dwFrameCapture_stop ( dwFrameCaptureHandle_t  framecapture)

Stops frame capture.

This method stops the thread and the serialization loop.

Parameters
[in]framecaptureSpecifies the sensor serializer handle.
Returns
DW_NOT_AVAILABLE - serialization is not available at this moment.
DW_INVALID_HANDLE - if given handle is not valid.
DW_SUCCESS