/*****************************************************************************
- * audio_decoder.h : audio decoder interface
+ * audio_decoder.h : audio decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
+ * $Id: audio_decoder.h,v 1.7 2001/05/01 04:18:18 sam Exp $
*
- * Authors:
- * Michel Kaempf <maxx@via.ecp.fr>
+ * Authors: Michel Kaempf <maxx@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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-/**** audio decoder API - public audio decoder structures */
-
-typedef struct audiodec_s audiodec_t;
-
-typedef struct adec_sync_info_s {
- int sample_rate; /* sample rate in Hz */
- int frame_size; /* frame size in bytes */
- int bit_rate; /* nominal bit rate in kbps */
-} adec_sync_info_t;
-
-typedef struct adec_byte_stream_s {
- u8 * p_byte;
- u8 * p_end;
- void * info;
-} adec_byte_stream_t;
-
-/**** audio decoder API - functions publically provided by the audio dec. ****/
-
-int adec_init (audiodec_t * p_adec);
-int adec_sync_frame (audiodec_t * p_adec, adec_sync_info_t * p_sync_info);
-int adec_decode_frame (audiodec_t * p_adec, s16 * buffer);
-static adec_byte_stream_t * adec_byte_stream (audiodec_t * p_adec);
-
-/**** audio decoder API - user functions to be provided to the audio dec. ****/
-
-void adec_byte_stream_next (adec_byte_stream_t * p_byte_stream);
-
-/**** EVERYTHING AFTER THIS POINT IS PRIVATE ! DO NOT USE DIRECTLY ****/
-
-/**** audio decoder internal structures ****/
-
-typedef struct adec_bank_s {
- float v1[512];
- float v2[512];
- float * actual;
- int pos;
-} adec_bank_t;
-
-typedef struct adec_bit_stream_s {
- u32 buffer;
- int i_available;
- adec_byte_stream_t byte_stream;
- int total_bytes_read;
-} adec_bit_stream_t;
+/*****************************************************************************
+ * adec_thread_t : audio decoder thread descriptor
+ *****************************************************************************/
+typedef struct adec_thread_s
+{
+ /*
+ * Thread properties
+ */
+ vlc_thread_t thread_id; /* id for thread functions */
-struct audiodec_s {
/*
* Input properties
*/
-
+ decoder_fifo_t * p_fifo; /* stores the PES stream data */
/* The bit stream structure handles the PES stream at the bit level */
- adec_bit_stream_t bit_stream;
+ bit_stream_t bit_stream;
+ int i_read_bits;
+ adec_config_t * p_config;
/*
* Decoder properties
*/
- u32 header;
- int frame_size;
+ u32 header;
+ int frame_size;
adec_bank_t bank_0;
adec_bank_t bank_1;
-};
-/**** audio decoder inline functions ****/
+ /*
+ * Output properties
+ */
+ struct aout_fifo_s * p_aout_fifo; /* stores the decompressed frames */
+
+} adec_thread_t;
+
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+vlc_thread_t adec_CreateThread ( adec_config_t * p_config );
+int adec_Init ( adec_thread_t * p_adec );
+int adec_SyncFrame ( adec_thread_t * p_adec,
+ adec_sync_info_t * p_sync_info );
+int adec_DecodeFrame ( adec_thread_t * p_adec, s16 * buffer );
-static adec_byte_stream_t * adec_byte_stream (audiodec_t * p_adec)
-{
- return &(p_adec->bit_stream.byte_stream);
-}