- /* Locks : please note that if you need several of these locks, it is
- * mandatory (to avoid deadlocks) to take them in the following order :
- * mixer_lock, p_input->lock, output_fifo_lock, input_fifos_lock.
- * --Meuuh */
- /* When input_fifos_lock is taken, none of the p_input->fifo structures
- * can be read or modified by a third-party thread. */
- vlc_mutex_t input_fifos_lock;
- /* When mixer_lock is taken, all decoder threads willing to mix a
- * buffer must wait until it is released. The output pipeline cannot
- * be modified. No input stream can be added or removed. */
- vlc_mutex_t mixer_lock;
- /* When output_fifo_lock is taken, the p_aout->output.fifo structure
- * cannot be read or written by a third-party thread. */
- vlc_mutex_t output_fifo_lock;
- /* volume_vars_lock is taken */
- vlc_mutex_t volume_vars_lock;
-
- /* Input streams & pre-filters */
- aout_input_t * pp_inputs[1];
- int i_nb_inputs;
-
- /* Mixer */
- audio_sample_format_t mixer_format;
- aout_alloc_t mixer_allocation;
- float mixer_multiplier;
- aout_mixer_t *p_mixer;
-
- /* Output plug-in */
- aout_output_t output;
+ struct aout_sys_t *sys; /**< Private data for callbacks */
+
+ int (*start)(audio_output_t *, audio_sample_format_t *fmt);
+ /**< Starts a new stream (mandatory, cannot be NULL).
+ * \param fmt input stream sample format upon entry,
+ * output stream sample format upon return [IN/OUT]
+ * \return VLC_SUCCESS on success, non-zero on failure
+ * \note No other stream may be already started when called.
+ */
+ void (*stop)(audio_output_t *);
+ /**< Stops the existing stream (optional, may be NULL).
+ * \note A stream must have been started when called.
+ */
+ int (*time_get)(audio_output_t *, mtime_t *delay);
+ /**< Estimates playback buffer latency (optional, may be NULL).
+ * \param delay pointer to the delay until the next sample to be written
+ * to the playback buffer is rendered [OUT]
+ * \return 0 on success, non-zero on failure or lack of data
+ * \note A stream must have been started when called.
+ */
+ void (*play)(audio_output_t *, block_t *);
+ /**< Queues a block of samples for playback (mandatory, cannot be NULL).
+ * \note A stream must have been started when called.
+ */
+ void (*pause)( audio_output_t *, bool pause, mtime_t date);
+ /**< Pauses or resumes playback (optional, may be NULL).
+ * \param pause pause if true, resume from pause if false
+ * \param date timestamp when the pause or resume was requested
+ * \note A stream must have been started when called.
+ */
+ void (*flush)( audio_output_t *, bool wait);
+ /**< Flushes or drains the playback buffers (mandatory, cannot be NULL).
+ * \param wait true to wait for playback of pending buffers (drain),
+ * false to discard pending buffers (flush)
+ * \note A stream must have been started when called.
+ */
+ int (*volume_set)(audio_output_t *, float volume);
+ /**< Changes playback volume (optional, may be NULL).
+ * \param volume requested volume (0. = mute, 1. = nominal)
+ * \note The volume is always a positive number.
+ * \warning A stream may or may not have been started when called.
+ */
+ int (*mute_set)(audio_output_t *, bool mute);
+ /**< Changes muting (optinal, may be NULL).
+ * \param mute true to mute, false to unmute
+ * \warning A stream may or may not have been started when called.
+ */
+ int (*device_select)(audio_output_t *, const char *id);
+ /**< Selects an audio output device (optional, may be NULL).
+ * \param id nul-terminated device unique identifier.
+ * \return 0 on success, non-zero on failure.
+ * \warning A stream may or may not have been started when called.
+ */
+ struct {
+ void (*volume_report)(audio_output_t *, float);
+ void (*mute_report)(audio_output_t *, bool);
+ void (*policy_report)(audio_output_t *, bool);
+ void (*device_report)(audio_output_t *, const char *);
+ void (*hotplug_report)(audio_output_t *, const char *, const char *);
+ int (*gain_request)(audio_output_t *, float);
+ void (*restart_request)(audio_output_t *, unsigned);
+ } event;