img_encode_frame()

Encode a frame

Synopsis:

#include <img.h>

int img_encode_frame(
        img_codec_t                   codec,
        io_stream_t*                  output,
        const img_encode_callouts_t*  callouts,
        img_t*                        img,
        uintptr_t*                    encode_data );

Arguments:

codec
The handle of the codec to use to encode the frame.
output
The output destination.
callouts
A pointer to an img_encode_callouts_t structure that provides system callouts for the encoder. If you pass NULL for this value, the library uses a set of default callouts. See the description of img_encode_callouts_t for more details.
img
The address of an img_t structure describing the frame to be encoded.
encode_data
The address of the uintptr_t that was used for img_encode_begin().

Library:

img

Description:

This function encodes a frame. You need to call img_encode_begin() first to prepare for the encode, and img_encode_finish() to release any resources allocated for the encode.

Returns:

IMG_ERR_OK
Success. The complete frame was encoded.
IMG_ERR_MEM
Memory-allocation failure.
IMG_ERR_NOSUPPORT
Input data format not supported; the codec and application could not agree on an output format.
IMG_ERR_TRUNC
Error writing data; file was truncated.
IMG_ERR_INTR
Encoding was interrupted by the application.
IMG_ERR_DLL
Error accessing the codec DLL; check errno and/or try running your application with DL_DEBUG=1.

Classification:

Image library

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

img_encode_callouts_t, img_t, img_encode_begin(), img_encode_finish(), io_open()