NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Defines A API for the Encoder.

Typedefs

typedef struct dwCodecEncoderObject * dwEncoderHandle_t
 Handle representing an encoder. More...
 

Functions

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 42 of file Encoder.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