/[qemu]/qemu/audio/audio_int.h
ViewVC logotype

Diff of /qemu/audio/audio_int.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by bellard, Sun Oct 30 18:58:22 2005 UTC revision 1.5 by bellard, Sat Nov 5 18:55:27 2005 UTC
# Line 24  Line 24 
24  #ifndef QEMU_AUDIO_INT_H  #ifndef QEMU_AUDIO_INT_H
25  #define QEMU_AUDIO_INT_H  #define QEMU_AUDIO_INT_H
26    
 #include "sys-queue.h"  
   
27  #ifdef CONFIG_COREAUDIO  #ifdef CONFIG_COREAUDIO
28  #define FLOAT_MIXENG  #define FLOAT_MIXENG
29  /* #define RECIPROCAL */  /* #define RECIPROCAL */
30  #endif  #endif
31  #include "mixeng.h"  #include "mixeng.h"
32    
 int audio_bug (const char *funcname, int cond);  
   
33  struct audio_pcm_ops;  struct audio_pcm_ops;
34    
35  typedef enum {  typedef enum {
# Line 69  struct audio_pcm_info { Line 65  struct audio_pcm_info {
65  };  };
66    
67  typedef struct HWVoiceOut {  typedef struct HWVoiceOut {
     int active;  
68      int enabled;      int enabled;
69      int pending_disable;      int pending_disable;
70      int valid;      int valid;
# Line 78  typedef struct HWVoiceOut { Line 73  typedef struct HWVoiceOut {
73      f_sample *clip;      f_sample *clip;
74    
75      int rpos;      int rpos;
     int bufsize;  
76      uint64_t ts_helper;      uint64_t ts_helper;
77    
78      st_sample_t *mix_buf;      st_sample_t *mix_buf;
# Line 91  typedef struct HWVoiceOut { Line 85  typedef struct HWVoiceOut {
85    
86  typedef struct HWVoiceIn {  typedef struct HWVoiceIn {
87      int enabled;      int enabled;
     int active;  
88      struct audio_pcm_info info;      struct audio_pcm_info info;
89    
90      t_sample *conv;      t_sample *conv;
91    
92      int wpos;      int wpos;
     int bufsize;  
93      int total_samples_captured;      int total_samples_captured;
94      uint64_t ts_helper;      uint64_t ts_helper;
95    
# Line 109  typedef struct HWVoiceIn { Line 101  typedef struct HWVoiceIn {
101      LIST_ENTRY (HWVoiceIn) entries;      LIST_ENTRY (HWVoiceIn) entries;
102  } HWVoiceIn;  } HWVoiceIn;
103    
 extern struct audio_driver no_audio_driver;  
 extern struct audio_driver oss_audio_driver;  
 extern struct audio_driver sdl_audio_driver;  
 extern struct audio_driver wav_audio_driver;  
 extern struct audio_driver fmod_audio_driver;  
 extern struct audio_driver alsa_audio_driver;  
 extern struct audio_driver coreaudio_audio_driver;  
 extern struct audio_driver dsound_audio_driver;  
 extern volume_t nominal_volume;  
   
 struct audio_driver {  
     const char *name;  
     const char *descr;  
     struct audio_option *options;  
     void *(*init) (void);  
     void (*fini) (void *);  
     struct audio_pcm_ops *pcm_ops;  
     int can_be_default;  
     int max_voices_out;  
     int max_voices_in;  
     int voice_size_out;  
     int voice_size_in;  
 };  
   
 typedef struct AudioState {  
     int fixed_settings_out;  
     int fixed_freq_out;  
     int fixed_channels_out;  
     int fixed_fmt_out;  
     int nb_hw_voices_out;  
     int greedy_out;  
   
     int fixed_settings_in;  
     int fixed_freq_in;  
     int fixed_channels_in;  
     int fixed_fmt_in;  
     int nb_hw_voices_in;  
     int greedy_in;  
   
     void *opaque;  
     struct audio_driver *drv;  
   
     QEMUTimer *ts;  
     union {  
         int usec;  
         int64_t ticks;  
     } period;  
   
     int plive;  
 } AudioState;  
 extern AudioState audio_state;  
   
104  struct SWVoiceOut {  struct SWVoiceOut {
105      struct audio_pcm_info info;      struct audio_pcm_info info;
106      t_sample *conv;      t_sample *conv;
# Line 192  struct SWVoiceIn { Line 132  struct SWVoiceIn {
132      LIST_ENTRY (SWVoiceIn) entries;      LIST_ENTRY (SWVoiceIn) entries;
133  };  };
134    
135    struct audio_driver {
136        const char *name;
137        const char *descr;
138        struct audio_option *options;
139        void *(*init) (void);
140        void (*fini) (void *);
141        struct audio_pcm_ops *pcm_ops;
142        int can_be_default;
143        int max_voices_out;
144        int max_voices_in;
145        int voice_size_out;
146        int voice_size_in;
147    };
148    
149  struct audio_pcm_ops {  struct audio_pcm_ops {
150      int  (*init_out)(HWVoiceOut *hw, int freq, int nchannels, audfmt_e fmt);      int  (*init_out)(HWVoiceOut *hw, audsettings_t *as);
151      void (*fini_out)(HWVoiceOut *hw);      void (*fini_out)(HWVoiceOut *hw);
152      int  (*run_out) (HWVoiceOut *hw);      int  (*run_out) (HWVoiceOut *hw);
153      int  (*write)   (SWVoiceOut *sw, void *buf, int size);      int  (*write)   (SWVoiceOut *sw, void *buf, int size);
154      int  (*ctl_out) (HWVoiceOut *hw, int cmd, ...);      int  (*ctl_out) (HWVoiceOut *hw, int cmd, ...);
155    
156      int  (*init_in) (HWVoiceIn *hw, int freq, int nchannels, audfmt_e fmt);      int  (*init_in) (HWVoiceIn *hw, audsettings_t *as);
157      void (*fini_in) (HWVoiceIn *hw);      void (*fini_in) (HWVoiceIn *hw);
158      int  (*run_in)  (HWVoiceIn *hw);      int  (*run_in)  (HWVoiceIn *hw);
159      int  (*read)    (SWVoiceIn *sw, void *buf, int size);      int  (*read)    (SWVoiceIn *sw, void *buf, int size);
160      int  (*ctl_in)  (HWVoiceIn *hw, int cmd, ...);      int  (*ctl_in)  (HWVoiceIn *hw, int cmd, ...);
161  };  };
162    
163  void audio_pcm_init_info (struct audio_pcm_info *info, int freq,  struct AudioState {
164                            int nchannels, audfmt_e fmt, int swap_endian);      struct audio_driver *drv;
165        void *drv_opaque;
166    
167        QEMUTimer *ts;
168        LIST_HEAD (card_head, QEMUSoundCard) card_head;
169        LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
170        LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
171        int nb_hw_voices_out;
172        int nb_hw_voices_in;
173    };
174    
175    extern struct audio_driver no_audio_driver;
176    extern struct audio_driver oss_audio_driver;
177    extern struct audio_driver sdl_audio_driver;
178    extern struct audio_driver wav_audio_driver;
179    extern struct audio_driver fmod_audio_driver;
180    extern struct audio_driver alsa_audio_driver;
181    extern struct audio_driver coreaudio_audio_driver;
182    extern struct audio_driver dsound_audio_driver;
183    extern volume_t nominal_volume;
184    
185    void audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as,
186                              int swap_endian);
187  void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int len);  void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int len);
188    
189  int  audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int len);  int  audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int len);
# Line 217  int  audio_pcm_sw_read (SWVoiceIn *sw, v Line 193  int  audio_pcm_sw_read (SWVoiceIn *sw, v
193  int  audio_pcm_hw_get_live_out (HWVoiceOut *hw);  int  audio_pcm_hw_get_live_out (HWVoiceOut *hw);
194  int  audio_pcm_hw_get_live_out2 (HWVoiceOut *hw, int *nb_live);  int  audio_pcm_hw_get_live_out2 (HWVoiceOut *hw, int *nb_live);
195    
196    int audio_bug (const char *funcname, int cond);
197    void *audio_calloc (const char *funcname, int nmemb, size_t size);
198    
199  #define VOICE_ENABLE 1  #define VOICE_ENABLE 1
200  #define VOICE_DISABLE 2  #define VOICE_DISABLE 2
201    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26