aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/output_internal.h')
-rw-r--r--src/output_internal.h53
1 files changed, 40 insertions, 13 deletions
diff --git a/src/output_internal.h b/src/output_internal.h
index 72596c1c3..6b81bbc78 100644
--- a/src/output_internal.h
+++ b/src/output_internal.h
@@ -21,14 +21,23 @@
#define MPD_OUTPUT_INTERNAL_H
#include "audio_format.h"
-#include "pcm_convert.h"
-#include "notify.h"
+
+#include <glib.h>
#include <time.h>
enum audio_output_command {
AO_COMMAND_NONE = 0,
+ AO_COMMAND_ENABLE,
+ AO_COMMAND_DISABLE,
AO_COMMAND_OPEN,
+
+ /**
+ * This command is invoked when the input audio format
+ * changes.
+ */
+ AO_COMMAND_REOPEN,
+
AO_COMMAND_CLOSE,
AO_COMMAND_PAUSE,
AO_COMMAND_CANCEL,
@@ -60,15 +69,15 @@ struct audio_output {
struct mixer *mixer;
/**
- * This flag is true, when the audio_format of this device is
- * configured in mpd.conf.
+ * Has the user enabled this device?
*/
- bool config_audio_format;
+ bool enabled;
/**
- * Has the user enabled this device?
+ * Is this device actually enabled, i.e. the "enable" method
+ * has succeeded?
*/
- bool enabled;
+ bool really_enabled;
/**
* Is the device (already) open and functional?
@@ -94,6 +103,11 @@ struct audio_output {
GTimer *fail_timer;
/**
+ * The configured audio format.
+ */
+ struct audio_format config_audio_format;
+
+ /**
* The audio_format in which audio data is received from the
* player thread (which in turn receives it from the decoder).
*/
@@ -107,18 +121,25 @@ struct audio_output {
*/
struct audio_format out_audio_format;
- struct pcm_convert_state convert_state;
+ /**
+ * The filter object of this audio output. This is an
+ * instance of chain_filter_plugin.
+ */
+ struct filter *filter;
/**
- * The thread handle, or NULL if the output thread isn't
- * running.
+ * The convert_filter_plugin instance of this audio output.
+ * It is the last item in the filter chain, and is responsible
+ * for converting the input data into the appropriate format
+ * for this audio output.
*/
- GThread *thread;
+ struct filter *convert_filter;
/**
- * Notify object for the thread.
+ * The thread handle, or NULL if the output thread isn't
+ * running.
*/
- struct notify notify;
+ GThread *thread;
/**
* The next command to be performed by the output thread.
@@ -136,6 +157,12 @@ struct audio_output {
GMutex *mutex;
/**
+ * This condition object wakes up the output thread after
+ * #command has been set.
+ */
+ GCond *cond;
+
+ /**
* The #music_chunk which is currently being played. All
* chunks before this one may be returned to the
* #music_buffer, because they are not going to be used by