NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release

Detailed Description

Defines the video encoder types.

Defines the encoder types.

Typedefs

typedef struct dwCodecEncoderVideoObject * dwEncoderVideoHandle_t
 Handle representing a video encoder. More...
 
typedef struct dwCodecEncoderObject * dwEncoderHandle_t
 Handle representing an encoder. More...
 

Functions

dwStatus dwEncoderVideo_appendAllocationAttributes (dwImageProperties *const imgProps, dwEncoderVideoHandle_t encoder)
 Append the image allocation attributes required for images to be compatible with this Encoder instance to the provided dwImageProperties. More...
 
dwStatus dwEncoder_initialize (dwEncoderHandle_t *encoder, dwCodecHeaderHandle_t config, dwEncoderConfig const *encoderConfig, dwContextHandle_t context)
 This function initializes the encoder. More...
 
dwStatus dwEncoder_release (dwEncoderHandle_t encoder)
 This function releases the encoder. More...
 
dwStatus dwEncoder_flush (dwEncoderHandle_t encoder)
 This function consumes all data from the internal data buffer. More...
 
dwStatus dwEncoder_encode (void const *data, size_t dataSize, dwMediaType dataType, dwEncoderHandle_t encoder)
 This function enqueues a codec packet. More...
 
dwStatus dwEncoder_drainPacket (dwCodecPacket *packet, dwEncoderHandle_t encoder)
 This function drains previously queued encode requests. More...
 
dwStatus dwEncoder_returnPacket (dwCodecPacket *packet, dwEncoderHandle_t encoder)
 This function returns the codec packet. More...
 

Typedef Documentation

◆ dwEncoderHandle_t

typedef struct dwCodecEncoderObject* dwEncoderHandle_t

Handle representing an encoder.

Definition at line 41 of file Encoder.h.

◆ dwEncoderVideoHandle_t

typedef struct dwCodecEncoderVideoObject* dwEncoderVideoHandle_t

Handle representing a video encoder.

Definition at line 39 of file EncoderVideo.h.

Function Documentation

◆ dwEncoder_drainPacket()

dwStatus dwEncoder_drainPacket ( dwCodecPacket packet,
dwEncoderHandle_t  encoder 
)

This function drains previously queued encode requests.

Sometimes the encoder doesn't give a packet until few frames(say predictive encoding) in which case the client needs to push more packets before calling drain.

Parameters
[out]packetPointer to the codec packet.
[in]encoderHandle to the encoder.
Returns
DW_SUCCESS - When a fully realized output object is available
DW_NOT_READY - If there's nothing to be drained.

◆ dwEncoder_encode()

dwStatus dwEncoder_encode ( void const *  data,
size_t  dataSize,
dwMediaType  dataType,
dwEncoderHandle_t  encoder 
)

This function enqueues a codec packet.

Output objects are available via dwEncoder_drainPacket.

Parameters
[in]dataFrame to enqueue to the encoder.
[in]dataSizeSize of the data to encode.
[in]dataTypeType of the data to encode.
[in]encoderHandle to the encoder.
Returns
DW_SUCCESS - If the output objects(s) are available via drainPacket()
DW_NOT_AVAILABLE - If the codec requires more data.
DW_NOT_READY - If too many objects have been fed in without calling drainPacket().
DW_FAILURE - In case of an internal failure

◆ dwEncoder_flush()

dwStatus dwEncoder_flush ( dwEncoderHandle_t  encoder)

This function consumes all data from the internal data buffer.

Parameters
[in]encoderHandle to the encoder.
Returns
DW_SUCCESS - If the call is successful.
DW_INVALID_ARGUMENT - If handle is nullptr.

◆ dwEncoder_initialize()

dwStatus dwEncoder_initialize ( dwEncoderHandle_t encoder,
dwCodecHeaderHandle_t  config,
dwEncoderConfig const *  encoderConfig,
dwContextHandle_t  context 
)

This function initializes the encoder.

Parameters
[out]encoderHandle to the encoder.
[in]configHandle to the codecHeader.
[in]encoderConfigPointer to the encoder config.
[in]contextContext handle.
Returns
DW_SUCCESS - If the call is successful.
DW_INVALID_ARGUMENT - If the handle is NULL or invalid.

◆ dwEncoder_release()

dwStatus dwEncoder_release ( dwEncoderHandle_t  encoder)

This function releases the encoder.

Parameters
[in]encoderHandle to the encoder.
Returns
DW_SUCCESS - If the call is successful.
DW_INVALID_ARGUMENT - If handle is nullptr.

◆ dwEncoder_returnPacket()

dwStatus dwEncoder_returnPacket ( dwCodecPacket packet,
dwEncoderHandle_t  encoder 
)

This function returns the codec packet.

Parameters
[in]packetPointer to the codec packet.
[in]encoderHandle to the encoder.
Returns
DW_SUCCESS - If the call is successful.
DW_INVALID_ARGUMENT - If the encoder handle is NULL or invalid

◆ dwEncoderVideo_appendAllocationAttributes()

dwStatus dwEncoderVideo_appendAllocationAttributes ( dwImageProperties *const  imgProps,
dwEncoderVideoHandle_t  encoder 
)

Append the image allocation attributes required for images to be compatible with this Encoder instance to the provided dwImageProperties.

All images passed to this Encoder instance must be created with the allocation attributes returned by this function.

Parameters
[in,out]imgPropsImage properties
[in]encoderHandle representing a encoder.
Note
The given imgProps should be compatible with that returned by dwSensorCamra_getImageProperties API.
The imgProps are read and used to generate the allocation attributes needed by the driver. The allocation attributes are stored back into imgProps.meta.allocAttrs. Applications do not need to free or alter the imgProps.meta.allocAttrs in any way. The imgProps.meta.allocAttrs are only used by DriveWorks as needed when the given imgProps are used to allocate dwImages. If the application alters the imgProps after calling this API, the imgProps.meta.allocAttrs may no longer be applicable to the imgProps and calls related to allocating images will fail.
if imgProps.meta.allocAttrs does not have allocated Memory, this would be allocated by DW and will be owned by DW context until context is destroyed and should be used wisely as it the space is limited.
Returns
DW_FAILURE - if underlying imageAttributes for Encoder is not initialized.
DW_SUCCESS