img_write()

Encode a frame to an output stream on the filesystem

Synopsis:

#include <img/img.h>

int img_write( img_lib_t                    ilib,
               io_stream_t*                 output,
               const img_encode_callouts_t* callouts,
               img_t*                       img
               img_codec_t*                 codec );

Arguments:

ilib
A handle for the image library, returned by img_lib_attach().
output
An io_stream_t to use for the output.
callouts
A pointer to an img_encode_callouts_t structure that provides system callouts for the encoder. If you specify NULL for this value, the library supplies a set of default callouts.
img
The address of an img_t structure describing the frame to be encoded.
codec
The codec to use for the encoding. You must use one of img_codec_list_byext() or img_codec_list_bymime() to get the codec.

Library:

libimg

Use the -l img option to qcc to link against this library.

Description:

This function encodes a frame to an io_stream_t output stream on the filesystem.

Returns:

IMG_ERR_OK
Success
IMG_ERR_FILE
Error accessing path (errno is set).
IMG_ERR_MEM
Memory-allocation failure.
IMG_ERR_FORMAT
No appropriate codec could be found that handles the extension included in the provided filename. The codec you require could be missing or corrupt.
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
Encode was interrupted by application.

Classification:

Image library

Safety:  
Interrupt handler No
Signal handler No
Thread No