pub unsafe extern "C" fn aom_codec_set_cx_data_buf(
    ctx: *mut aom_codec_ctx_t,
    buf: *const aom_fixed_buf_t,
    pad_before: c_uint,
    pad_after: c_uint
) -> aom_codec_err_t
Expand description

Set compressed data output buffer

Sets the buffer that the codec should output the compressed data into. This call effectively sets the buffer pointer returned in the next AOM_CODEC_CX_FRAME_PKT packet. Subsequent packets will be appended into this buffer. The buffer is preserved across frames, so applications must periodically call this function after flushing the accumulated compressed data to disk or to the network to reset the pointer to the buffer’s head.

pad_before bytes will be skipped before writing the compressed data, and pad_after bytes will be appended to the packet. The size of the packet will be the sum of the size of the actual compressed data, pad_before, and pad_after. The padding bytes will be preserved (not overwritten).

Note that calling this function does not guarantee that the returned compressed data will be placed into the specified buffer. In the event that the encoded data will not fit into the buffer provided, the returned packet \ref MAY point to an internal buffer, as it would if this call were never used. In this event, the output packet will NOT have any padding, and the application must free space and copy it to the proper place. This is of particular note in configurations that may output multiple packets for a single encoded frame (e.g., lagged encoding) or if the application does not reset the buffer periodically.

Applications may restore the default behavior of the codec providing the compressed data buffer by calling this function with a NULL buffer.

Applications \ref MUSTNOT call this function during iteration of aom_codec_get_cx_data().

\param[in] ctx Pointer to this instance’s context \param[in] buf Buffer to store compressed data into \param[in] pad_before Bytes to skip before writing compressed data \param[in] pad_after Bytes to skip after writing compressed data

\retval #AOM_CODEC_OK The buffer was set successfully. \retval #AOM_CODEC_INVALID_PARAM A parameter was NULL, the image format is unsupported, etc.