aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_api.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-02-09output_api: include "config.h" without "../"Max Kellermann1-1/+1
Including "../config.h" breaks on some systems.
2009-01-30output_api: moved the command check out of method pause()Max Kellermann1-6/+4
Move the "while" loop which checks for commands to the caller ao_pause(). This simplifies the pause() method, and lets us remove audio_output_is_pending().
2009-01-30output_api: removed DISABLED_AUDIO_OUTPUT_PLUGINMax Kellermann1-2/+0
The macro is unused.
2009-01-30output_api: removed audio_output_closed()Max Kellermann1-2/+0
The function is only used by the MVP output plugin, and this one call is wrong.
2009-01-25mixer: removed mixer_configure_legacy(), AC_MIXER_CONFIGUREMax Kellermann1-1/+0
Those have been superseded by the new legacy configuration code.
2009-01-25conf: const pointers in block get functionsMax Kellermann1-1/+1
All config_get_block_*() functions should accept constant config_param pointers.
2009-01-17conf: no CamelCase, part IMax Kellermann1-1/+1
Renamed functions, types, variables.
2008-12-31Moving mixers to audio outputsViliam Mateicka1-0/+12
2008-11-25output: use GLib instead of log.h/util.hMax Kellermann1-1/+0
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-29output: use bool for return values and flagsMax Kellermann1-3/+3
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-08don't include os_compat.hMax Kellermann1-1/+0
When there are standardized headers, use these instead of the bloated os_compat.h.
2008-09-29audio_output: added method pause()Max Kellermann1-0/+11
pause() puts the audio output into pause mode: if supported, it may perform a special action, which keeps the device open, but does not play anything. Output plugins like "shout" might want to play silence during pause, so their clients won't be disconnected. Plugins which do not support pausing will simply be closed, and have to be reopened when unpaused. This pach includes an implementation for the shout plugin, which sends silence chunks.
2008-09-29audio_output: added function audio_output_is_pending()Max Kellermann1-0/+7
The function audio_output_is_pending() returns whether there is a pending command. This is useful for output plugins as a break condition for longer loops.
2008-09-24output: document the audio_output_plugin methodsMax Kellermann1-0/+44
2008-09-24output: make "struct audio_output" opaque for output pluginsMax Kellermann1-44/+10
We have eliminated direct accesses to the audio_output struct from the all output plugins. Make it opaque for them, and move its real declaration to output_internal.h, similar to decoder_internal.h. Pass the opaque structure to plugin.init() only, which will return the plugin's data pointer on success, and NULL on failure. This data pointer will be passed to all other methods instead of the audio_output struct.
2008-09-24output: added audio_output_closed()Max Kellermann1-0/+2
The JACK output plugin needs to reset its "opened" flag when the JACK server fails. To prevent it from accessing the audio_output struct directly introduce the API function audio_output_closed().
2008-09-24output: added audio_output_get_name()Max Kellermann1-0/+2
Reduce direct accesses to the audio_output struct from the plugins: this time, eliminate all accesses to audio_output.name. The name is required by some plugins for log messages.
2008-09-24output: pass audio_format to plugin.init() and plugin.open()Max Kellermann1-2/+5
Pass the globally configured audio_format as a const pointer to plugin.init(). plugin.open() gets a writable pointer which contains the audio_format requested by the plugin. Its initial value is either the configured audio_format or the input file's audio_format.
2008-09-24output: one thread per audio outputMax Kellermann1-0/+26
To keep I/O nastiness and latencies away from the core, move the audio output code to a separate thread, one per output. The thread is created on demand, and currently runs until mpd exits.
2008-09-11output: removed audio_output.sameInAndOutFormatsMax Kellermann1-1/+0
Eliminate sameInAndOutFormats and check with audio_format_equals() each time it this information is needed. Another 4 bytes saved.
2008-09-11output: removed audio_output.convertAudioFormatMax Kellermann1-1/+0
Instead of checking convertAudioFormat, we can simply check if reqAudioFormat is defined. This saves 4 bytes in the struct.
2008-09-09output: renamed method namesMax Kellermann1-22/+12
No CamelCase. Also don't declare typedefs for the methods.
2008-09-08output: const plugin structuresMax Kellermann1-1/+1
Since the plugin struct is never modified, we should store it in constant locations.
2008-09-07output: replace audio_output.*Func with audio_output.pluginMax Kellermann1-7/+1
Instead of copying all that stuff from the audio output plugin to the audio output structure, store a pointer to the plugin.
2008-09-07output: renamed typedef AudioOutput to struct audio_outputMax Kellermann1-12/+12
Also rename AudioOutputPlugin to struct audio_output_plugin, and use forward declarations to reduce include dependencies.
2008-09-07output: added output_api.hMax Kellermann1-49/+17
Just like decoder_api.h, output_api.h provides the audio output API which is used by the plugins.
2008-09-07audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann1-4/+4
Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
2008-08-29tag: renamed MpdTag and MpdTagItem to struct tag, struct mpd_tag_itemMax Kellermann1-2/+3
Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
2008-08-29pass constant pointersMax Kellermann1-2/+2
And again, convert arguments to const.
2008-08-26moved struct AudioFormat to audio_format.hMax Kellermann1-1/+1
We want to expose the AudioFormat structure to plugins; remove some clutter by moving its declaration to a separate header file.
2008-04-12const pointers in audioOutput.cMax Kellermann1-1/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@7345 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12use size_t in audioOutput.c internalsMax Kellermann1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@7294 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12use size_t and constant pointer in ao pluginsMax Kellermann1-2/+3
The audio output plugins should get a constant pointer, because they must not modify the buffer. Since the size is a non-negative buffer size in bytes, we should change its type to size_t. git-svn-id: https://svn.musicpd.org/mpd/trunk@7293 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-02-05fix -Wconst warningsMax Kellermann1-3/+3
[ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-26fixed invalid C prototypesMax Kellermann1-1/+1
Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7142 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong1-0/+1
This will make refactoring features easier, especially now that pthreads support and larger refactorings are on the horizon. Hopefully, this will make porting to other platforms (even non-UNIX-like ones for masochists) easier, too. os_compat.h will house all the #includes for system headers considered to be the "core" of MPD. Headers for optional features will be left to individual source files. git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-13Adding FIFO audio output. This is pretty much identical to the old one,J. Alexander Treuman1-0/+1
except that it now uses a timer for throttling. git-svn-id: https://svn.musicpd.org/mpd/trunk@6621 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-12Load shout first instead of last. This makes it more likely to block otherJ. Alexander Treuman1-1/+1
outputs, which is actually desired behaviour. This way if the shout server takes a while to respond, the shout output can block until connected without messing up other audio outputs. git-svn-id: https://svn.musicpd.org/mpd/trunk@6554 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-10Load the shout plugin last. This will make sure it's played to last,J. Alexander Treuman1-1/+1
reducing the likelyhood of it blocking other outputs. git-svn-id: https://svn.musicpd.org/mpd/trunk@6543 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-30Adding a null output plugin.J. Alexander Treuman1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@6393 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-24Reverting to the full lsr API. Turns out the simple API needs all of theJ. Alexander Treuman1-0/+2
audio at once, so it won't work for us. The old full API code was still heavily broken, as each call to pcm_convertSampleRate() used the same state, even if it was processing two streams of audio. The new code keeps a separate state for each audio stream that's being converted. git-svn-id: https://svn.musicpd.org/mpd/trunk@6255 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05The massive copyright updateAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14sparse: move extern declarations for plugins into header filesEric Wong1-0/+10
git-svn-id: https://svn.musicpd.org/mpd/trunk@5261 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14Don't initialize globals to zero (or NULL)Eric Wong1-12/+1
Some compilers and linkers aren't smart enough to optimize this, as global variables are implictly initialized to zero. As a result, binaries are a bit smaller as more goes in the .bss and less in the text section. git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-26Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong1-0/+1
I'm checking for zero-size allocations and assert()-ing them, so we can more easily get backtraces and debug problems, but we'll also allow -DNDEBUG people to live on the edge if they wish. We do not rely on errno when checking for OOM errors because some implementations of malloc do not set it, and malloc is commonly overridden by userspace wrappers. I've spent some time looking through the source and didn't find any obvious places where we would explicitly allocate 0 bytes, so we shouldn't trip any of those assertions. We also avoid allocating zero bytes because C libraries don't handle this consistently (some return NULL, some not); and it's dangerous either way. git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-20Fix missing initializer in DISABLED_AUDIO_OUTPUT_PLUGIN();Avuton Olrich1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4658 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-20Fix warnings for -Wmissing-prototypesAvuton Olrich1-2/+2
Add -Wmissing-prototypes if compiling with gcc Static where possible git-svn-id: https://svn.musicpd.org/mpd/trunk@4657 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01audio: malloc reductionsEric Wong1-1/+1
Just malloc all of the audioOutput array in one shot to avoid fragmentation and to improve cache locality when iterating through the array. We also know name and type members of the AudioOutput struct won't change in the config, so there's no need to strdup them. newAudioOutput => initAudioOutput git-svn-id: https://svn.musicpd.org/mpd/trunk@4515 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich1-32/+32
Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f