#include <libdirac_common/dirac_types.h>
#include <libdirac_decoder/decoder_types.h>
Go to the source code of this file.
Classes | |
struct | dirac_decoder_t |
Typedefs | |
typedef DecoderState | dirac_decoder_state_t |
Functions | |
DllExport dirac_decoder_t * | dirac_decoder_init (int verbose) |
DllExport void | dirac_decoder_close (dirac_decoder_t *decoder) |
DllExport dirac_decoder_state_t | dirac_parse (dirac_decoder_t *decoder) |
DllExport void | dirac_buffer (dirac_decoder_t *decoder, unsigned char *start, unsigned char *end) |
DllExport void | dirac_set_buf (dirac_decoder_t *decoder, unsigned char *buf[3], void *id) |
DllExport void | dirac_skip (dirac_decoder_t *decoder, int skip) |
A set of 'C' functions that define the public interface to the Dirac decoder. Refer to the the reference decoder source code, decoder/decmain.cpp for an example of how to use the "C" interface. The pseudocode below gives a brief description of the "C" interface usage.
#include <libdirac_decoder/dirac_parser.h>\n Initialise the decodern decoder_handle = dirac_decoder_init(); do { dirac_decoder_state_t state = dirac_parse (decoder); switch (state) { case STATE_BUFFER: read more data. Pass data to the decoder. dirac_buffer (decoder_handle, data_start, data_end) break; case STATE_SEQUENCE: handle start of sequence. The decoder returns the sequence parameters in the seq_params member of the decoder handle. Allocate space for the frame data buffers and pass this to the decoder. dirac_set_buf (decoder_handle, buf, NULL); break; case STATE_SEQUENCE_END: Deallocate frame data buffers break; case STATE_PICTURE_START: handle start of picture data The decoder sets the frame_params member in the decoder handle to the details of the next frame to be processed. break; case STATE_PICTURE_AVAIL: Handle picture data. The decoder sets the fbuf member in the decoder handle to the frame decoded. break; case STATE_INVALID: Unrecoverable error. Stop all processing break; } } while (data available && decoder state != STATE_INVALID Free the decoder resources dirac_decoder_close(decoder_handle)
Definition in file dirac_parser.h.
|
Copy data into internal buffer
Definition at line 79 of file dirac_parser.cpp. References dirac_decoder_t::parser, and dirac::DiracParser::SetBuffer(). |
|
Release the decoder resources
Definition at line 64 of file dirac_parser.cpp. References dirac_decoder_t::fbuf, and dirac_decoder_t::parser. |
|
Decoder Init Initialise the decoder.
Definition at line 49 of file dirac_parser.cpp. References dirac_framebuf_t::buf, dirac_decoder_t::fbuf, dirac_framebuf_t::id, and dirac_decoder_t::parser. |
|
Parses the data in the input buffer. This function returns the following values.
Definition at line 209 of file dirac_parser.cpp. References dirac_decoder_t::frame_avail, dirac::Frame::GetFparams(), dirac::DiracParser::GetNextFrame(), dirac::DiracParser::GetNextFrameParams(), dirac::DiracParser::Parse(), dirac_decoder_t::parser, and dirac_decoder_t::state. |
|
Set the output buffer into which the decoder copies the decoded data
Definition at line 259 of file dirac_parser.cpp. References dirac_framebuf_t::buf, dirac_decoder_t::fbuf, and dirac_framebuf_t::id. |
|
Skip the next frame to be decoded
Definition at line 249 of file dirac_parser.cpp. References dirac_decoder_t::parser, and dirac::DiracParser::SetSkip(). |