]> git.sesse.net Git - vlc/blobdiff - include/vlc_aout.h
Implement thread semaphores
[vlc] / include / vlc_aout.h
index 23bab0eb534f74a180683cbf351984888228554e..6fd0f24480794062c32498cf239797c1fa90a72c 100644 (file)
@@ -129,30 +129,23 @@ typedef int32_t vlc_fixed_t;
 struct aout_buffer_t
 {
     uint8_t *               p_buffer;
-    int                     i_alloc_type;
     /* i_size is the real size of the buffer (used for debug ONLY), i_nb_bytes
      * is the number of significative bytes in it. */
     size_t                  i_size, i_nb_bytes;
     unsigned int            i_nb_samples;
-    mtime_t                 start_date, end_date;
+    bool                    b_alloc;
     bool                    b_discontinuity; /* Set on discontinuity (for non pcm stream) */
+    mtime_t                 start_date, end_date;
 
     struct aout_buffer_t *  p_next;
-
-    /** Private data (aout_buffer_t will disappear soon so no need for an
-     * aout_buffer_sys_t type) */
-    void * p_sys;
-
-    /** This way the release can be overloaded */
-    void (*pf_release)( aout_buffer_t * );
+    void                 *p_sys;
 };
 
-#define aout_BufferFree( p_buffer ) do {                                    \
-    if( p_buffer != NULL && (p_buffer)->i_alloc_type == AOUT_ALLOC_HEAP )   \
-    {                                                                       \
-        free( p_buffer );                                                   \
-    }                                                                       \
-    p_buffer = NULL; } while(0)
+static inline void aout_BufferFree( aout_buffer_t *buffer )
+{
+    if( buffer && buffer->b_alloc )
+        free( buffer );
+}
 
 /* Size of a frame for S/PDIF output. */
 #define AOUT_SPDIF_SIZE 6144
@@ -166,14 +159,10 @@ struct aout_buffer_t
 /** allocation of memory in the audio output */
 typedef struct aout_alloc_t
 {
-    int                     i_alloc_type;
+    bool                    b_alloc;
     int                     i_bytes_per_sec;
 } aout_alloc_t;
 
-#define AOUT_ALLOC_NONE     0
-#define AOUT_ALLOC_STACK    1
-#define AOUT_ALLOC_HEAP     2
-
 /** audio output buffer FIFO */
 struct aout_fifo_t
 {
@@ -227,58 +216,6 @@ struct aout_filter_t
 #define AOUT_RESAMPLING_NONE     0
 #define AOUT_RESAMPLING_UP       1
 #define AOUT_RESAMPLING_DOWN     2
-/** an input stream for the audio output */
-struct aout_input_t
-{
-    /* When this lock is taken, the pipeline cannot be changed by a
-     * third-party. */
-    vlc_mutex_t             lock;
-
-    audio_sample_format_t   input;
-    aout_alloc_t            input_alloc;
-
-    /* pre-filters */
-    aout_filter_t *         pp_filters[AOUT_MAX_FILTERS];
-    int                     i_nb_filters;
-
-    aout_filter_t *         p_playback_rate_filter;
-
-    /* resamplers */
-    aout_filter_t *         pp_resamplers[AOUT_MAX_FILTERS];
-    int                     i_nb_resamplers;
-    int                     i_resampling_type;
-    mtime_t                 i_resamp_start_date;
-    int                     i_resamp_start_drift;
-
-    /* Mixer information */
-    audio_replay_gain_t     replay_gain;
-
-    /* If b_restart == 1, the input pipeline will be re-created. */
-    bool              b_restart;
-
-    /* If b_error == 1, there is no input pipeline. */
-    bool              b_error;
-
-    /* Did we just change the output format? (expect buffer inconsistencies) */
-    bool              b_changed;
-
-    /* last rate from input */
-    int               i_last_input_rate;
-
-    /* */
-    int               i_buffer_lost;
-
-    /* */
-    bool              b_paused;
-    mtime_t           i_pause_date;
-
-    /* */
-    bool                b_recycle_vout;
-    aout_request_vout_t request_vout;
-
-    /* */
-    aout_mixer_input_t mixer;
- };
 
 /** an output stream for the audio output */
 typedef struct aout_output_t