]> git.sesse.net Git - vlc/blobdiff - include/vlc_aout.h
libvlc: stub device_type functions
[vlc] / include / vlc_aout.h
index be84182e2ec977052104c5f6a5c4328986de92d8..ed118b35e648a417d8a1fe8b940a85c0f13687d2 100644 (file)
@@ -150,11 +150,10 @@ struct audio_output
     /**< 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 *write_pts);
-    /**< Estimates the date/time of the playback buffer write offset
-      * (optional, may be NULL). The read offset is not returned since it is
-      * always implicitly equal to the current time (mdate()).
-      * \param write_pts timestamp of the write offset [OUT]
+    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.
       */
@@ -185,10 +184,26 @@ struct audio_output
       * \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;
 };
@@ -288,6 +303,14 @@ static inline void aout_PolicyReport(audio_output_t *aout, bool cork)
     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)