/**< Stops the existing stream (optional, may be NULL).
* \note A stream must have been started when called.
*/
- void (*play)(audio_output_t *, block_t *, mtime_t *);
+ 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.
*/
* \note A stream must have been started when called.
*/
void (*flush)( audio_output_t *, bool wait);
- /**< Flushes or drains the playback buffers (optional, may be NULL).
+ /**< Flushes or drains the playback buffers (mandatoryl, 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.
* \param mute true to mute, false to unmute
* \warning A stream may or may not have been started when called.
*/
+ int (*device_enum)(audio_output_t *, char ***ids, char ***names);
+ /**< Enumerates available audio output devices (optional, may be NULL).
+ * \param ids pointer to a heap-allocated table of heap-allocated
+ * nul-terminated device unique identifiers [OUT]
+ * \param names pointer to a heap-allocated table of heap-allocated
+ * nul-terminated device human-readable names [OUT]
+ * \return The number of entries, or -1 on error.
+ * \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 *);
int (*gain_request)(audio_output_t *, float);
} event;
};
aout->event.policy_report(aout, cork);
}
+/**
+ * Report change of output device.
+ */
+static inline void aout_DeviceReport(audio_output_t *aout, const char *id)
+{
+ aout->event.device_report(aout, id);
+}
+
/**
* Request a change of software audio amplification.
* \param gain linear amplitude gain (must be positive)
aout_fifo_t partial; /**< Audio blocks before packetization */
aout_fifo_t fifo; /**< Packetized audio blocks */
mtime_t pause_date; /**< Date when paused or VLC_TS_INVALID */
- mtime_t time_report; /**< Desynchronization estimate or VLC_TS_INVALID */
unsigned samples; /**< Samples per packet */
bool starving; /**< Whether currently starving (to limit error messages) */
} aout_packet_t;
VLC_DEPRECATED void aout_PacketInit(audio_output_t *, aout_packet_t *, unsigned, const audio_sample_format_t *);
VLC_DEPRECATED void aout_PacketDestroy(audio_output_t *);
-VLC_DEPRECATED void aout_PacketPlay(audio_output_t *, block_t *, mtime_t *);
-VLC_DEPRECATED void aout_PacketPause(audio_output_t *, bool, mtime_t);
+VLC_DEPRECATED int aout_PacketTimeGet(audio_output_t *, mtime_t *);
+VLC_DEPRECATED void aout_PacketPlay(audio_output_t *, block_t *);
VLC_DEPRECATED void aout_PacketFlush(audio_output_t *, bool);
VLC_DEPRECATED block_t *aout_PacketNext(audio_output_t *, mtime_t) VLC_USED;