Defines the video encoder types.
Defines the encoder types.
◆ dwEncoderHandle_t
Handle representing an encoder.
Definition at line 41 of file Encoder.h.
◆ dwEncoderVideoHandle_t
Handle representing a video encoder.
Definition at line 39 of file EncoderVideo.h.
◆ dwEncoder_drainPacket()
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] | packet | Pointer to the codec packet. |
[in] | encoder | Handle 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()
This function enqueues a codec packet.
Output objects are available via dwEncoder_drainPacket.
- Parameters
-
[in] | data | Frame to enqueue to the encoder. |
[in] | dataSize | Size of the data to encode. |
[in] | dataType | Type of the data to encode. |
[in] | encoder | Handle 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()
This function consumes all data from the internal data buffer.
- Parameters
-
[in] | encoder | Handle to the encoder. |
- Returns
- DW_SUCCESS - If the call is successful.
DW_INVALID_ARGUMENT - If handle
is nullptr.
◆ dwEncoder_initialize()
This function initializes the encoder.
- Parameters
-
[out] | encoder | Handle to the encoder. |
[in] | config | Handle to the codecHeader. |
[in] | encoderConfig | Pointer to the encoder config. |
[in] | context | Context handle. |
- Returns
- DW_SUCCESS - If the call is successful.
DW_INVALID_ARGUMENT - If the handle is NULL or invalid.
◆ dwEncoder_release()
This function releases the encoder.
- Parameters
-
[in] | encoder | Handle to the encoder. |
- Returns
- DW_SUCCESS - If the call is successful.
DW_INVALID_ARGUMENT - If handle
is nullptr.
◆ dwEncoder_returnPacket()
This function returns the codec packet.
- Parameters
-
[in] | packet | Pointer to the codec packet. |
[in] | encoder | Handle to the encoder. |
- Returns
- DW_SUCCESS - If the call is successful.
DW_INVALID_ARGUMENT - If the encoder handle is NULL or invalid
◆ dwEncoderVideo_appendAllocationAttributes()
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] | imgProps | Image properties |
[in] | encoder | Handle 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