Defines A API for the Encoder.
◆ dwEncoderHandle_t
Handle representing an encoder.
Definition at line 42 of file Encoder.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