#include "decoder_command.h"
#include <stdbool.h>
#include <stddef.h>
#include "input_stream.h"
#include <stdint.h>
#include <string.h>
#include "audio_format.h"
#include <glib.h>
Go to the source code of this file.
Functions | |
void | decoder_initialized (struct decoder *decoder, const struct audio_format *audio_format, bool seekable, float total_time) |
Notify the player thread that it has finished initialization and that it has read the song's meta data. | |
char * | decoder_get_uri (struct decoder *decoder) |
Returns the URI of the current song in UTF-8 encoding. | |
enum decoder_command | decoder_get_command (struct decoder *decoder) |
void | decoder_command_finished (struct decoder *decoder) |
Called by the decoder when it has performed the requested command (dc->command). | |
double | decoder_seek_where (struct decoder *decoder) |
void | decoder_seek_error (struct decoder *decoder) |
size_t | decoder_read (struct decoder *decoder, struct input_stream *inStream, void *buffer, size_t length) |
Blocking read from the input stream. | |
enum decoder_command | decoder_data (struct decoder *decoder, struct input_stream *inStream, const void *data, size_t datalen, float data_time, uint16_t bitRate, struct replay_gain_info *replay_gain_info) |
This function is called by the decoder plugin when it has successfully decoded block of input data. | |
enum decoder_command | decoder_tag (struct decoder *decoder, struct input_stream *is, const struct tag *tag) |
This function is called by the decoder plugin when it has successfully decoded a tag. |
void decoder_command_finished | ( | struct decoder * | decoder | ) |
Called by the decoder when it has performed the requested command (dc->command).
This function resets dc->command and wakes up the player thread.
enum decoder_command decoder_data | ( | struct decoder * | decoder, | |
struct input_stream * | inStream, | |||
const void * | data, | |||
size_t | datalen, | |||
float | data_time, | |||
uint16_t | bitRate, | |||
struct replay_gain_info * | replay_gain_info | |||
) |
This function is called by the decoder plugin when it has successfully decoded block of input data.
We send inStream for buffering the inputStream while waiting to send the next chunk
enum decoder_command decoder_get_command | ( | struct decoder * | decoder | ) |
char* decoder_get_uri | ( | struct decoder * | decoder | ) |
Returns the URI of the current song in UTF-8 encoding.
The return value is allocated on the heap, and must be freed by the caller.
void decoder_initialized | ( | struct decoder * | decoder, | |
const struct audio_format * | audio_format, | |||
bool | seekable, | |||
float | total_time | |||
) |
Notify the player thread that it has finished initialization and that it has read the song's meta data.
size_t decoder_read | ( | struct decoder * | decoder, | |
struct input_stream * | inStream, | |||
void * | buffer, | |||
size_t | length | |||
) |
Blocking read from the input stream.
Returns the number of bytes read, or 0 if one of the following occurs: end of file; error; command (like SEEK or STOP).
void decoder_seek_error | ( | struct decoder * | decoder | ) |
double decoder_seek_where | ( | struct decoder * | decoder | ) |
enum decoder_command decoder_tag | ( | struct decoder * | decoder, | |
struct input_stream * | is, | |||
const struct tag * | tag | |||
) |
This function is called by the decoder plugin when it has successfully decoded a tag.
is | an input stream which is buffering while we are waiting for the player |