daala  0.0-1696-g7278368
Experimental Daala video codec API reference.
 All Data Structures Files Functions Variables Typedefs Macros Groups
Modules
Functions for Decoding

Modules

 Configuration keys for the decoder ctl interface.
 Decoder CTL settings.

Functions for decoding

You must link to libdaalaadec if you use any of the functions in this section.

int daala_decode_header_in (daala_info *info, daala_comment *dc, daala_setup_info **ds, const daala_packet *dp)
 Parses the header packets from an Ogg Daala stream.
daala_dec_ctxdaala_decode_create (const daala_info *info, const daala_setup_info *setup)
 Allocates a decoder instance.
void daala_setup_free (daala_setup_info *setup)
 Releases all storage used for the decoder setup information.
int daala_decode_ctl (daala_dec_ctx *dec, int req, void *buf, size_t buf_sz)
 Decoder control function.
void daala_decode_free (daala_dec_ctx *dec)
 Frees an allocated decoder instance.
int daala_decode_packet_in (daala_dec_ctx *dec, const daala_packet *dp)
 Retrieves decoded video data frames.
int daala_decode_img_out (daala_dec_ctx *dec, daala_image *img)
 Outputs the next available decoded image frame.

Detailed Description

Function Documentation

int daala_decode_header_in ( daala_info info,
daala_comment dc,
daala_setup_info **  ds,
const daala_packet dp 
)

Parses the header packets from an Ogg Daala stream.

To use this function:

  • Initialize a daala_info structure using daala_info_init().
  • Initialize a daala_comment structure using daala_comment_init().
  • Initialize a daala_setup_info pointer to NULL.
  • Call this function three times, passing in pointers to the same daala_info, daala_comment, and daala_setup_info pointer each time, and the three successive header packets.
    Parameters
    infoThe daala_info structure to fill in. This must have been previously initialized with daala_info_init(). The application may begin using the contents of this structure after the first header is decoded, though it must continue to be passed in unmodified on all subsequent calls.
    dcThe daala_comment structure to fill in. This must have been previously initialized with daala_comment_init(). The application may immediately begin using the contents of this structure after the second header is decoded, though it must continue to be passed in on all subsequent calls. Users should free the returned data with daala_comment_clear().
    dsA pointer to a daala_setup_info pointer to fill in. The contents of this pointer must be initialized to NULL on the first call, and the returned value must continue to be passed in on all subsequent calls.
    dpThe current header packet to process.
    Returns
    A positive value indicates that a Daala header was successfully processed and indicates the remaining number of headers to be read.
    Return values
    0The last header was processed and the next packet will contain video.
    OD_EFAULTOne of info, dc, or ds was NULL, or there was a memory allocation failure.
    OD_EBADHEADERop was NULL, the packet was not the next header packet in the expected sequence, or the format fo the header data was invalid.
    OD_EVERSIONThe packet data was a Daala header, but for a bitstream version not decodable with this version of libdaaladec.
    OD_ENOTFORMATThe packet was not a Daala header.
daala_dec_ctx* daala_decode_create ( const daala_info info,
const daala_setup_info setup 
)

Allocates a decoder instance.

Parameters
infoA daala_info struct filled via daala_decode_header_in().
setupA daala_setup_info handle returned via daala_decode_header_in().
Returns
The initialized daala_dec_ctx handle.
Return values
NULLIf the decoding parameters were invalid.
void daala_setup_free ( daala_setup_info setup)

Releases all storage used for the decoder setup information.

This should be called after you no longer want to create any decoders for a stream whose headers you have parsed with daala_decode_header_in().

Parameters
setupThe setup information to free. This can safely be NULL.
int daala_decode_ctl ( daala_dec_ctx dec,
int  req,
void *  buf,
size_t  buf_sz 
)

Decoder control function.

This is used to provide advanced control of the decoding process.

Parameters
decA daala_dec_ctx handle.
reqThe control code to process. See the list of available control codes for details.
bufThe parameters for this control code.
buf_szThe size of the parameter buffer.
void daala_decode_free ( daala_dec_ctx dec)

Frees an allocated decoder instance.

Parameters
decA daala_dec_ctx handle.
int daala_decode_packet_in ( daala_dec_ctx dec,
const daala_packet dp 
)

Retrieves decoded video data frames.

Parameters
decA daala_dec_ctx handle.
int daala_decode_img_out ( daala_dec_ctx dec,
daala_image img 
)

Outputs the next available decoded image frame.

Parameters
imgA buffer to receive the decoded image data.
dpAn incoming Daala packet.
Returns
A positive value 1 means an output image was available and was placed in img.
Return values
1An decoded image was available and was placed in img.
0No image was available, so the contents of img were left unchanged.
OD_EFAULTOne of dec or img was NULL.