img_decode_frame()

Decode a frame

Synopsis:

#include <img.h>

int img_decode_frame(
        img_codec_t                   codec,
        io_stream_t*                  input,
        const img_decode_callouts_t*  callouts,
        img_t*                        img,
        uintptr_t*                    decode_data );

Arguments:

codec
The handle of the codec to use to decode the frame.
input
The input source.
callouts
A pointer to an img_decode_callouts_t structure that provides system callouts for the decoder. If you pass NULL for this value, a set of default callouts is used. See the description of img_decode_callouts_t for more details.
img
The address of an img_t structure to fill with information regarding the decoded frame.
decode_data
The address of the uintptr_t that was used for img_decode_begin().

Library:

img

Description:

This function decodes a frame. You need to call img_decode_begin() first to prepare for the decode, and img_decode_finish() to release any resources allocated for the decode.

Returns:

IMG_ERR_OK
Success. The complete frame was decoded.
IMG_ERR_MEM
Memory-allocation failure.
IMG_ERR_NOSUPPORT
Output data format not supported; the codec and application could not agree on an output format.
IMG_ERR_NODATA
No frame data was present. This return code indicates the end of a multi-frame data source.
IMG_ERR_CORRUPT
Invalid data was encountered in the stream, preventing the decode from proceeding. Some of the frame may be intact.
IMG_ERR_TRUNC
Premature end of data encountered. Some of the frame may be intact.
IMG_ERR_INTR
Decoding 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_decode_callouts_t,
img_t, img_decode_begin(), img_decode_finish(), io_open()