aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-01-04song: allocate the result of song_get_url()Max Kellermann1-1/+7
2008-11-11decoder: return void from decode() methodsMax Kellermann1-2/+2
The stream_decode() and file_decode() methods returned a boolean, indicating whether they were able to decode the song. This is redundant, since we already know that: if decoder_initialized() has been called (and dc.state==DECODE), the plugin succeeded. Change both methods to return void.
2008-11-11replay_gain: no CamelCaseMax Kellermann1-1/+1
Renamed functions and variables.
2008-11-11replay_gain: renamed sources to replay_gain.c, replay_gain.hMax Kellermann1-1/+1
No CamelCase file names.
2008-11-10decoder: removed plugin method try_decode()Max Kellermann1-6/+0
Instead of having a seprate try_decode() method, let the stream_decode() and file_decode() methods decide whether they are able to decode the song.
2008-11-09decoder: updated API documentationMax Kellermann1-2/+6
Updated documentation on the stream_decode() and file_decode() return values.
2008-11-04decoder: removed stream_typesMax Kellermann1-8/+0
Instead of checking the stream_types bit set, we can simply check whether the methods stream_decode() and file_decode() are implemented.
2008-11-02decoder_api: added decoder_tag()Max Kellermann1-0/+11
Provide an API for submitting additional tags from the stream.
2008-11-02decoder_api: pass "seekable" flag to decoder_initialized()Max Kellermann1-2/+2
Don't pass the "seekable" flag with every decoder_data() invocation. Since that flag won't change within the file, it is enough to pass it to decoder_initialized() once per file.
2008-11-01decoder: manage decoder list in a static arrayMax Kellermann1-4/+0
Currently, there is no way to dynamically load decoder plugins, thus we don't need a dynamic list to manage them.
2008-10-31decoder_api: pass constant path pointersMax Kellermann1-2/+2
2008-10-31added prefix to header macrosMax Kellermann1-2/+2
"LOG_H" is a macro which is also used by ffmpeg/log.h. This is ffmpeg's fault, because short macros should be reserved for applications, but since it's always a good idea to choose prefixed macro names, even for applications, we are going to do that in MPD.
2008-10-30decoder: use bool for return values and flagsMax Kellermann1-4/+4
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-29decoder: automatically flush the output buffer after decoder exitsMax Kellermann1-2/+0
A decoder_flush() invocation was missing in the FLAC plugin, resulting in casual assertion failures due to a wrong assumption about the last chunk's audio format. It's much easier to remove that decoder_flush() function and make the decoder thread call ob_flush().
2008-10-29decoder_api: removed decoder_clear()Max Kellermann1-2/+0
Call ob_clear() in decoder_command_finished() instead of implementing that call in every decoder plugin.
2008-10-26input_stream: renamed sources, no CamelCaseMax Kellermann1-1/+1
Renamed inputStream.c and inputStream_file.c.
2008-10-17input: declare struct input_streamMax Kellermann1-6/+7
Provide a struct type which can be forward-declared. The typedef InputStream is deprecated now.
2008-10-08use the "bool" data type instead of "int"Max Kellermann1-3/+4
"bool" should be used in C99 programs for boolean values.
2008-09-29decoder: renamed plugin methodsMax Kellermann1-35/+40
Why have a "_func" prefix on all method names? Also don't typedef the methods, there is no advantage in that.
2008-09-29switch to C99 types, part IIMax Kellermann1-1/+1
Do full C99 integer type conversion in all modules which were not touched by Eric's merged patch.
2008-09-07audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann1-1/+2
Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
2008-08-29tag: moved code to tag_id3.cMax Kellermann1-0/+1
The ID3 code uses only the public tag API, but is otherwise unrelated. Move it to a separate source file.
2008-08-29tag: renamed MpdTag and MpdTagItem to struct tag, struct mpd_tag_itemMax Kellermann1-1/+1
Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
2008-08-26moved enum decoder_command to decoder_api.hMax Kellermann1-1/+8
The decoder plugins need this type, so export it in the public API. This allows is to remove "decode.h" from "decoder_api.h", uncluttering the API namespace some more.
2008-08-26moved variable "dc" to decode.hMax Kellermann1-0/+1
Now that "dc" is available here, we don't have to pass it to decoder_is_idle() and decoder_is_starting() anymore.
2008-08-26added decoder_read()Max Kellermann1-0/+9
On our way to stabilize the decoder API, we will one day remove the input stream functions. The most basic function, read() will be provided by decoder_api.h with this patch. It already contains a loop (still with manual polling), error/eof handling and decoder command checks. This kind of code used to be duplicated in all decoder plugins.
2008-08-26added decoder_plugin_register()Max Kellermann1-0/+4
With the functions decoder_plugin_register() and decoder_plugin_unregister(), decoder plugins can register a "secondary" plugin, like the flac input plugin does this for "oggflac".
2008-08-26no camel case in struct decoder_pluginMax Kellermann1-8/+8
2008-08-26renamed the InputPlugin function typesMax Kellermann1-14/+13
Continuing the effort to rename InputPlugin to decoder_plugin...
2008-08-26renamed InputPlugin to struct decoder_pluginMax Kellermann1-2/+2
"decoder plugin" is a better name than "input plugin", since the plugin does not actually do the input - InputStream does. Also don't use typedef, so we can forward-declare it if required.
2008-08-26eliminate OUTPUT_BUFFER_DC_STOP, OUTPUT_BUFFER_DC_SEEKMax Kellermann1-5/+4
(Ab)use the decoder_command enumeration, which has nearly the same values and the same meaning.
2008-08-26added decoder_get_url()Max Kellermann1-0/+2
The wavpack decoder plugin implements a hack, and it needs the song URL for that. This API (and the hack) should be revised later, but add that function for now.
2008-08-26added decoder_seek_where() and decoder_seek_error()Max Kellermann1-0/+4
Provide access to seeking for the decoder plugins; they have to know where to seek, and they need a way to tell us that seeking has failed.
2008-08-26added decoder_command_finished() to decoder_api.hMax Kellermann1-0/+7
Some decoder commands are implemented in the decoder plugins, thus they need to have an API call to signal that their current command has been finished. Let them use the new decoder_command_finished() instead of the internal dc_command_finished().
2008-08-26added decoder_get_command()Max Kellermann1-0/+2
Another big patch which hides internal mpd APIs from decoder plugins: decoder plugins regularly poll dc->command; expose it with a decoder_api.h function.
2008-08-26moved InputPlugin to decoder_api.hMax Kellermann1-1/+60
InputPlugin is the API which is implemented by a decoder plugin. This belongs to the public API/ABI, so move it to decoder_api.h. It will later be renamed to something like "decoder_plugin".
2008-08-26added parameter total_time to decoder_initialized()Max Kellermann1-1/+2
Similar to the previous patch: pass total_time instead of manipulating dc->totalTime directly.
2008-08-26added audio_format parameter to decoder_initialized()Max Kellermann1-1/+2
dc->audioFormat is set once by the decoder plugins before invoking decoder_initialized(); hide dc->audioFormat and let the decoder pass an AudioFormat pointer to decoder_initialized().
2008-08-26added decoder_clear() and decoder_flush()Max Kellermann1-0/+4
We are now beginning to remove direct structure accesses from the decoder plugins. decoder_clear() and decoder_flush() mask two very common buffer functions.
2008-08-26added decoder_data()Max Kellermann1-0/+15
Moved all of the player-waiting code to decoder_data(), to make OutputBuffer more generic.
2008-08-26added decoder_initialized()Max Kellermann1-0/+6
decoder_initialized() sets the state to DECODE_STATE_DECODE and wakes up the player thread. It is called by the decoder plugin after its internal initialization is finished. More arguments will be added later to prevent direct accesses to the DecoderControl struct.
2008-08-26added struct decoderMax Kellermann1-10/+14
The decoder struct should later be made opaque to the decoder plugin, because maintaining a stable struct ABI is quite difficult. The ABI should only consist of a small number of stable functions.
2008-08-26clean up CPP includesMax Kellermann1-2/+0
Include only headers which are really required. This speeds up compilation and helps detect cross-layer accesses.
2008-06-02remove audioDeviceStates from playerData and getPlayerDataEric Wong1-8/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@7372 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Make the OutputBuffer API more consistentEric Wong1-1/+1
We had functions names varied between outputBufferFoo, fooOutputBuffer, and output_buffer_foo That was too confusing for my little brain to handle. And the global variable was somehow named 'cb' instead of the more obvious 'ob'... git-svn-id: https://svn.musicpd.org/mpd/trunk@7355 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Stop passing our single OutputBuffer object everywhereEric Wong1-1/+1
All of our main singleton data structures are implicitly shared, so there's no reason to keep passing them around and around in the stack and making our internal API harder to deal with. git-svn-id: https://svn.musicpd.org/mpd/trunk@7354 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Stop passing our single DecoderControl object everywhereEric Wong1-1/+1
This at least makes the argument list to a lot of our plugin functions shorter and removes a good amount of line nois^W^Wcode, hopefully making things easier to read and follow. git-svn-id: https://svn.musicpd.org/mpd/trunk@7353 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13Get rid of PlayerControl inside the PlayerData structEric Wong1-1/+1
It actually increases our image size a small bit and may even hurt performance a very small bit, but makes the code less verbose and easier to manage. I don't see a reason for mpd to ever support playing multiple files at the same time (users can run multiple instances of mpd if they really want to play Zaireeka, but that's such an edge case it's not worth ever supporting in our code). git-svn-id: https://svn.musicpd.org/mpd/trunk@7352 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12clean up CPP includesMax Kellermann1-2/+0
Try to only include headers which are really needed. We should particularly check all "headers including other headers". The long-term goal is to have a manageable, small API for plugins (decoders, output) without so many mpd internals cluttering the namespace. git-svn-id: https://svn.musicpd.org/mpd/trunk@7319 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12remove buffered_chunks, use cb->sizeMax Kellermann1-1/+0
Second patch to make OutputBuffer self-contained: since OutputBuffer now knows its own size, we do not need the global variable "buffered_chunks" anymore. git-svn-id: https://svn.musicpd.org/mpd/trunk@7311 09075e82-0dd4-0310-85a5-a0d7c8717e4f