Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
16c981d4
Commit
16c981d4
authored
Oct 08, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_api: document all function parameters
parent
81e56705
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
24 deletions
+70
-24
decoder_api.h
src/decoder_api.h
+70
-24
No files found.
src/decoder_api.h
View file @
16c981d4
...
@@ -17,15 +17,16 @@
...
@@ -17,15 +17,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
*/
#ifndef MPD_DECODER_API_H
/*! \file
#define MPD_DECODER_API_H
* \brief The MPD Decoder API
*
/*
* This is the public API which is used by decoder plugins to
* This is the public API which is used by decoder plugins to
* communicate with the mpd core.
* communicate with the mpd core.
*
*/
*/
#ifndef MPD_DECODER_API_H
#define MPD_DECODER_API_H
#include "decoder_command.h"
#include "decoder_command.h"
#include "decoder_plugin.h"
#include "decoder_plugin.h"
#include "input_stream.h"
#include "input_stream.h"
...
@@ -36,56 +37,97 @@
...
@@ -36,56 +37,97 @@
#include <stdbool.h>
#include <stdbool.h>
/**
/**
* Notify the player thread that it has finished initialization and
* Notify the player thread that it has finished initialization and
* that it has read the song's meta data.
* that it has read the song's meta data.
*
* @param decoder the decoder object
* @param audio_format the audio format which is going to be sent to
* decoder_data()
* @param seekable true if the song is seekable
* @param total_time the total number of seconds in this song; -1 if unknown
*/
*/
void
decoder_initialized
(
struct
decoder
*
decoder
,
void
decoder_initialized
(
struct
decoder
*
decoder
,
const
struct
audio_format
*
audio_format
,
const
struct
audio_format
*
audio_format
,
bool
seekable
,
float
total_time
);
bool
seekable
,
float
total_time
);
/**
/**
* Returns the URI of the current song in UTF-8 encoding.
* 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
*
@param decoder the decoder object
*
caller.
*
@return an allocated string which must be freed with g_free()
*/
*/
char
*
decoder_get_uri
(
struct
decoder
*
decoder
);
char
*
decoder_get_uri
(
struct
decoder
*
decoder
);
enum
decoder_command
decoder_get_command
(
struct
decoder
*
decoder
);
/**
* Determines the pending decoder command.
*
* @param decoder the decoder object
* @return the current command, or DECODE_COMMAND_NONE if there is no
* command pending
*/
enum
decoder_command
decoder_get_command
(
struct
decoder
*
decoder
);
/**
/**
* Called by the decoder when it has performed the requested command
* Called by the decoder when it has performed the requested command
* (dc->command). This function resets dc->command and wakes up the
* (dc->command). This function resets dc->command and wakes up the
* player thread.
* player thread.
*
* @param decoder the decoder object
*/
*/
void
decoder_command_finished
(
struct
decoder
*
decoder
);
void
decoder_command_finished
(
struct
decoder
*
decoder
);
double
decoder_seek_where
(
struct
decoder
*
decoder
);
/**
* Call this when you have received the DECODE_COMMAND_SEEK command.
*
* @param decoder the decoder object
* @return the destination position for the week
*/
double
decoder_seek_where
(
struct
decoder
*
decoder
);
void
decoder_seek_error
(
struct
decoder
*
decoder
);
/**
* Call this right before decoder_command_finished() when seeking has
* failed.
*
* @param decoder the decoder object
*/
void
decoder_seek_error
(
struct
decoder
*
decoder
);
/**
/**
* Blocking read from the input stream. Returns the number of bytes
* Blocking read from the input stream.
* read, or 0 if one of the following occurs: end of file; error;
*
* command (like SEEK or STOP).
* @param decoder the decoder object
* @param is the input stream to read from
* @param buffer the destination buffer
* @param length the maximum number of bytes to read
* @return the number of bytes read, or 0 if one of the following
* occurs: end of file; error; command (like SEEK or STOP).
*/
*/
size_t
decoder_read
(
struct
decoder
*
decoder
,
size_t
struct
input_stream
*
inStream
,
decoder_read
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
void
*
buffer
,
size_t
length
);
void
*
buffer
,
size_t
length
);
/**
/**
* This function is called by the decoder plugin when it has
* This function is called by the decoder plugin when it has
* successfully decoded block of input data.
* successfully decoded block of input data.
*
*
* We send inStream for buffering the inputStream while waiting to
* @param decoder the decoder object
* send the next chunk
* @param is an input stream which is buffering while we are waiting
* for the player
* @param data the source buffer
* @param length the number of bytes in the buffer
* @return the current command, or DECODE_COMMAND_NONE if there is no
* command pending
*/
*/
enum
decoder_command
enum
decoder_command
decoder_data
(
struct
decoder
*
decoder
,
decoder_data
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
struct
input_stream
*
inStream
,
const
void
*
data
,
size_t
length
,
const
void
*
data
,
size_t
datalen
,
float
data_time
,
uint16_t
bitRate
,
float
data_time
,
uint16_t
bitRate
,
struct
replay_gain_info
*
replay_gain_info
);
struct
replay_gain_info
*
replay_gain_info
);
...
@@ -93,8 +135,12 @@ decoder_data(struct decoder *decoder,
...
@@ -93,8 +135,12 @@ decoder_data(struct decoder *decoder,
* This function is called by the decoder plugin when it has
* This function is called by the decoder plugin when it has
* successfully decoded a tag.
* successfully decoded a tag.
*
*
* @param decoder the decoder object
* @param is an input stream which is buffering while we are waiting
* @param is an input stream which is buffering while we are waiting
* for the player
* for the player
* @param tag the tag to send
* @return the current command, or DECODE_COMMAND_NONE if there is no
* command pending
*/
*/
enum
decoder_command
enum
decoder_command
decoder_tag
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
decoder_tag
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment