Commit Graph

14 Commits

Author SHA1 Message Date
Max Kellermann
940ecf5345 added decoder_read()
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-26 08:27:14 +02:00
Max Kellermann
6120635f06 added decoder_plugin_register()
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-26 08:27:09 +02:00
Max Kellermann
c7384b65ac eliminate OUTPUT_BUFFER_DC_STOP, OUTPUT_BUFFER_DC_SEEK
(Ab)use the decoder_command enumeration, which has nearly the same
values and the same meaning.
2008-08-26 08:27:07 +02:00
Max Kellermann
67bf4b448d added decoder_get_url()
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-26 08:27:07 +02:00
Max Kellermann
17e9cc84c5 added decoder_seek_where() and decoder_seek_error()
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-26 08:27:07 +02:00
Max Kellermann
78c55e2432 added decoder_command_finished() to decoder_api.h
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-26 08:27:07 +02:00
Max Kellermann
817a68b2b2 added decoder_get_command()
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-26 08:27:07 +02:00
Max Kellermann
2e9169de9d moved convState to struct decoder
Since we moved all PCM conversions to decoder_data(), the attribute
convState isn't being used anymore by the OutputBuffer code.  Move it
to struct decoder.
2008-08-26 08:27:06 +02:00
Max Kellermann
1b845f94a0 moved struct AudioFormat to audio_format.h
We want to expose the AudioFormat structure to plugins; remove some
clutter by moving its declaration to a separate header file.
2008-08-26 08:27:06 +02:00
Max Kellermann
0d8b551c5a added parameter total_time to decoder_initialized()
Similar to the previous patch: pass total_time instead of manipulating
dc->totalTime directly.
2008-08-26 08:27:05 +02:00
Max Kellermann
4590a98f0e added audio_format parameter to decoder_initialized()
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-26 08:27:05 +02:00
Max Kellermann
0d45870cea added decoder_clear() and decoder_flush()
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-26 08:27:05 +02:00
Max Kellermann
2a83ccdb8f added decoder_data()
Moved all of the player-waiting code to decoder_data(), to make
OutputBuffer more generic.
2008-08-26 08:27:05 +02:00
Max Kellermann
2bf7ec4f39 added decoder_initialized()
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-26 08:27:04 +02:00