#include "mad.h"
Go to the source code of this file.
Variables | |
enum mad_flow(* | input_callback )(void *user_data, struct mad_stream *stream) |
The purpose of this callback is to (re)fill the stream buffer which is to be decoded. | |
enum mad_flow(* | header_callback )(void *user_data, struct mad_header const *header) |
The function called after MPEG headers have been decoded . | |
enum mad_flow(* | filter_callback )(void *user_data, struct mad_stream const *stream, struct mad_frame *) |
The filter callback function is called after decoding a frame, but before synthesis. | |
enum mad_flow(* | output_callback )(void *user_data, struct mad_header const *header, struct mad_pcm *pcm) |
The purpose of this callback is to output (or play) the decoded PCM audio. | |
enum mad_flow(* | error_callback )(void *user_data, struct mad_stream *stream, struct mad_frame *frame) |
The error callback function is called whenever a decoding error occurs. | |
enum mad_flow(* | message_callback )(void *user_data, void *message, unsigned int *size) |
The message callback function is only used with MAD_DECODER_MODE_ASYNC, and is called whenever the parent process sends a message via mad_decoder_message(). |
Definition in file callbacks.h.
enum mad_flow(* error_callback)(void *user_data, struct mad_stream *stream, struct mad_frame *frame) |
The error callback function is called whenever a decoding error occurs.
The error is indicated by stream->error; the list of possible MAD_ERROR_* errors can be found in the stream.h header file.
user_data | This can hold whatever you want -- for example, song title, length, number of frames | |
stream | the mad input stream the error occured in. | |
frame | the mad frame the error occured in. |
Referenced by run_sync().
enum mad_flow(* filter_callback)(void *user_data, struct mad_stream const *stream, struct mad_frame *) |
The filter callback function is called after decoding a frame, but before synthesis.
Here it is possible to modify the frame's subband samples, for example to perform a uniform attenuation/amplification, or to do other special processing in the frequency domain.
user_data | This can hold whatever you want | |
stream | the mad input stream currently processed. | |
frame | the MPEG frame just decoded. |
enum mad_flow(* header_callback)(void *user_data, struct mad_header const *header) |
The function called after MPEG headers have been decoded .
user_data | This can hold whatever you want -- for example, song title, length, number of frames | |
header | the mad header just read. |
enum mad_flow(* input_callback)(void *user_data, struct mad_stream *stream) |
The purpose of this callback is to (re)fill the stream buffer which is to be decoded.
user_data | This can hold whatever you want | |
stream | the mad input stream you need to fill. |
enum mad_flow(* message_callback)(void *user_data, void *message, unsigned int *size) |
The message callback function is only used with MAD_DECODER_MODE_ASYNC, and is called whenever the parent process sends a message via mad_decoder_message().
This callback can generate a reply by overwriting the message buffer that is passed to it. (The size of the reply must be the same or smaller than the message.)
user_data | This can hold whatever you want | |
message | the message to send | |
size | of the message |
enum mad_flow(* output_callback)(void *user_data, struct mad_header const *header, struct mad_pcm *pcm) |
The purpose of this callback is to output (or play) the decoded PCM audio.
It is called after each frame of MPEG audio data has been completely decoded.
user_data | This can hold whatever you want | |
header | the stream header | |
pcm | the audio data to output. |