* audio_output.h : audio output thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_output.h,v 1.34 2001/05/06 04:32:02 sam Exp $
+ * $Id: audio_output.h,v 1.40 2002/01/09 00:33:37 asmax Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
+ * Cyril Deguet <asmax@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*****************************************************************************
* This global variable is accessed by any function using the audio output.
*****************************************************************************/
-typedef struct
+typedef struct aout_bank_s
{
/* Array to all the audio outputs */
struct aout_thread_s *pp_aout[ AOUT_MAX_THREADS ];
} aout_bank_t;
+#ifndef PLUGIN
extern aout_bank_t *p_aout_bank;
+#else
+# define p_aout_bank (p_symbols->p_aout_bank)
+#endif
/*****************************************************************************
* aout_increment_t
/* Rate and gain of the audio output sound (in Hz) */
long l_rate;
long l_gain;
+ int i_latency;
/* there might be some useful private structure, such as audio_buf_info
* for the OSS output */
#define AOUT_FMT_U16_BE 0x00000100 /* Big endian U16 */
#define AOUT_FMT_AC3 0x00000400 /* Dolby Digital AC3 */
-
#ifdef WORDS_BIGENDIAN
#define AOUT_FMT_S16_NE AOUT_FMT_S16_BE
#else
#define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
#endif
+/* Number of samples in an AC3 frame */
+#define AC3_FRAME_SIZE 1536
+
+/* Size of a frame for spdif output */
+#define SPDIF_FRAME_SIZE 6144
+
/*****************************************************************************
* Prototypes
*****************************************************************************/
+#ifndef PLUGIN
void aout_InitBank ( void );
void aout_EndBank ( void );
-aout_thread_t * aout_CreateThread ( int *pi_status );
+aout_thread_t * aout_CreateThread ( int *pi_status, int i_channels,
+ long l_rate );
void aout_DestroyThread ( aout_thread_t *, int * );
aout_fifo_t * aout_CreateFifo ( int, int, long, long, long, void * );
void aout_DestroyFifo ( aout_fifo_t *p_fifo );
void aout_FreeFifo ( aout_fifo_t *p_fifo );
+#else
+# define aout_CreateFifo p_symbols->aout_CreateFifo
+# define aout_DestroyFifo p_symbols->aout_DestroyFifo
+#endif