qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [5864] Make audio violate POSIX less


From: malc
Subject: [Qemu-devel] [5864] Make audio violate POSIX less
Date: Wed, 03 Dec 2008 22:48:45 +0000

Revision: 5864
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5864
Author:   malc
Date:     2008-12-03 22:48:44 +0000 (Wed, 03 Dec 2008)

Log Message:
-----------
Make audio violate POSIX less

Modified Paths:
--------------
    trunk/audio/alsaaudio.c
    trunk/audio/audio.c
    trunk/audio/audio.h
    trunk/audio/audio_int.h
    trunk/audio/audio_template.h
    trunk/audio/coreaudio.c
    trunk/audio/dsound_template.h
    trunk/audio/dsoundaudio.c
    trunk/audio/esdaudio.c
    trunk/audio/fmodaudio.c
    trunk/audio/mixeng.c
    trunk/audio/mixeng.h
    trunk/audio/mixeng_template.h
    trunk/audio/noaudio.c
    trunk/audio/ossaudio.c
    trunk/audio/paaudio.c
    trunk/audio/rate_template.h
    trunk/audio/sdlaudio.c
    trunk/audio/wavaudio.c
    trunk/audio/wavcapture.c
    trunk/hw/ac97.c
    trunk/hw/adlib.c
    trunk/hw/cs4231a.c
    trunk/hw/es1370.c
    trunk/hw/gus.c
    trunk/hw/omap2.c
    trunk/hw/pcspk.c
    trunk/hw/sb16.c
    trunk/hw/tsc210x.c
    trunk/hw/wm8750.c
    trunk/vnc.c

Modified: trunk/audio/alsaaudio.c
===================================================================
--- trunk/audio/alsaaudio.c     2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/alsaaudio.c     2008-12-03 22:48:44 UTC (rev 5864)
@@ -527,7 +527,7 @@
     int rpos, live, decr;
     int samples;
     uint8_t *dst;
-    st_sample_t *src;
+    struct st_sample *src;
     snd_pcm_sframes_t avail;
 
     live = audio_pcm_hw_get_live_out (hw);
@@ -612,13 +612,13 @@
     }
 }
 
-static int alsa_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     ALSAVoiceOut *alsa = (ALSAVoiceOut *) hw;
     struct alsa_params_req req;
     struct alsa_params_obt obt;
     snd_pcm_t *handle;
-    audsettings_t obt_as;
+    struct audsettings obt_as;
 
     req.fmt = aud_to_alsafmt (as->fmt);
     req.freq = as->freq;
@@ -692,13 +692,13 @@
     return -1;
 }
 
-static int alsa_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int alsa_init_in (HWVoiceIn *hw, struct audsettings *as)
 {
     ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw;
     struct alsa_params_req req;
     struct alsa_params_obt obt;
     snd_pcm_t *handle;
-    audsettings_t obt_as;
+    struct audsettings obt_as;
 
     req.fmt = aud_to_alsafmt (as->fmt);
     req.freq = as->freq;
@@ -792,7 +792,7 @@
 
     for (i = 0; i < 2; ++i) {
         void *src;
-        st_sample_t *dst;
+        struct st_sample *dst;
         snd_pcm_sframes_t nread;
         snd_pcm_uframes_t len;
 

Modified: trunk/audio/audio.c
===================================================================
--- trunk/audio/audio.c 2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/audio.c 2008-12-03 22:48:44 UTC (rev 5864)
@@ -47,7 +47,7 @@
     int enabled;
     int nb_voices;
     int greedy;
-    audsettings_t settings;
+    struct audsettings settings;
 };
 
 static struct {
@@ -91,7 +91,7 @@
 
 static AudioState glob_audio_state;
 
-volume_t nominal_volume = {
+struct mixeng_volume nominal_volume = {
     0,
 #ifdef FLOAT_MIXENG
     1.0,
@@ -513,7 +513,7 @@
     }
 }
 
-static void audio_print_settings (audsettings_t *as)
+static void audio_print_settings (struct audsettings *as)
 {
     dolog ("frequency=%d nchannels=%d fmt=", as->freq, as->nchannels);
 
@@ -556,7 +556,7 @@
     AUD_log (NULL, "\n");
 }
 
-static int audio_validate_settings (audsettings_t *as)
+static int audio_validate_settings (struct audsettings *as)
 {
     int invalid;
 
@@ -580,7 +580,7 @@
     return invalid ? -1 : 0;
 }
 
-static int audio_pcm_info_eq (struct audio_pcm_info *info, audsettings_t *as)
+static int audio_pcm_info_eq (struct audio_pcm_info *info, struct audsettings 
*as)
 {
     int bits = 8, sign = 0;
 
@@ -609,7 +609,7 @@
         && info->swap_endianness == (as->endianness != AUDIO_HOST_ENDIANNESS);
 }
 
-void audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as)
+void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as)
 {
     int bits = 8, sign = 0, shift = 0;
 
@@ -704,8 +704,8 @@
 /*
  * Capture
  */
-static void noop_conv (st_sample_t *dst, const void *src,
-                       int samples, volume_t *vol)
+static void noop_conv (struct st_sample *dst, const void *src,
+                       int samples, struct mixeng_volume *vol)
 {
     (void) src;
     (void) dst;
@@ -715,7 +715,7 @@
 
 static CaptureVoiceOut *audio_pcm_capture_find_specific (
     AudioState *s,
-    audsettings_t *as
+    struct audsettings *as
     )
 {
     CaptureVoiceOut *cap;
@@ -891,7 +891,7 @@
 {
     HWVoiceIn *hw = sw->hw;
     int samples, live, ret = 0, swlim, isamp, osamp, rpos, total = 0;
-    st_sample_t *src, *dst = sw->buf;
+    struct st_sample *src, *dst = sw->buf;
 
     rpos = audio_pcm_sw_get_rpos_in (sw) % hw->samples;
 
@@ -1442,7 +1442,7 @@
         while (live) {
             int left = hw->samples - rpos;
             int to_capture = audio_MIN (live, left);
-            st_sample_t *src;
+            struct st_sample *src;
             struct capture_callback *cb;
 
             src = hw->mix_buf + rpos;
@@ -1812,7 +1812,7 @@
 
 CaptureVoiceOut *AUD_add_capture (
     AudioState *s,
-    audsettings_t *as,
+    struct audsettings *as,
     struct audio_capture_ops *ops,
     void *cb_opaque
     )
@@ -1863,7 +1863,7 @@
         /* XXX find a more elegant way */
         hw->samples = 4096 * 4;
         hw->mix_buf = audio_calloc (AUDIO_FUNC, hw->samples,
-                                    sizeof (st_sample_t));
+                                    sizeof (struct st_sample));
         if (!hw->mix_buf) {
             dolog ("Could not allocate capture mix buffer (%d samples)\n",
                    hw->samples);

Modified: trunk/audio/audio.h
===================================================================
--- trunk/audio/audio.h 2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/audio.h 2008-12-03 22:48:44 UTC (rev 5864)
@@ -44,12 +44,12 @@
 #define AUDIO_HOST_ENDIANNESS 0
 #endif
 
-typedef struct {
+struct audsettings {
     int freq;
     int nchannels;
     audfmt_e fmt;
     int endianness;
-} audsettings_t;
+};
 
 typedef enum {
     AUD_CNOTIFY_ENABLE,
@@ -100,7 +100,7 @@
 void AUD_remove_card (QEMUSoundCard *card);
 CaptureVoiceOut *AUD_add_capture (
     AudioState *s,
-    audsettings_t *as,
+    struct audsettings *as,
     struct audio_capture_ops *ops,
     void *opaque
     );
@@ -112,7 +112,7 @@
     const char *name,
     void *callback_opaque,
     audio_callback_fn_t callback_fn,
-    audsettings_t *settings
+    struct audsettings *settings
     );
 
 void AUD_close_out (QEMUSoundCard *card, SWVoiceOut *sw);
@@ -133,7 +133,7 @@
     const char *name,
     void *callback_opaque,
     audio_callback_fn_t callback_fn,
-    audsettings_t *settings
+    struct audsettings *settings
     );
 
 void AUD_close_in (QEMUSoundCard *card, SWVoiceIn *sw);

Modified: trunk/audio/audio_int.h
===================================================================
--- trunk/audio/audio_int.h     2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/audio_int.h     2008-12-03 22:48:44 UTC (rev 5864)
@@ -76,7 +76,7 @@
     int rpos;
     uint64_t ts_helper;
 
-    st_sample_t *mix_buf;
+    struct st_sample *mix_buf;
 
     int samples;
     LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
@@ -95,7 +95,7 @@
     int total_samples_captured;
     uint64_t ts_helper;
 
-    st_sample_t *conv_buf;
+    struct st_sample *conv_buf;
 
     int samples;
     LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
@@ -107,14 +107,14 @@
     struct audio_pcm_info info;
     t_sample *conv;
     int64_t ratio;
-    st_sample_t *buf;
+    struct st_sample *buf;
     void *rate;
     int total_hw_samples_mixed;
     int active;
     int empty;
     HWVoiceOut *hw;
     char *name;
-    volume_t vol;
+    struct mixeng_volume vol;
     struct audio_callback callback;
     LIST_ENTRY (SWVoiceOut) entries;
 };
@@ -125,11 +125,11 @@
     int64_t ratio;
     void *rate;
     int total_hw_samples_acquired;
-    st_sample_t *buf;
+    struct st_sample *buf;
     f_sample *clip;
     HWVoiceIn *hw;
     char *name;
-    volume_t vol;
+    struct mixeng_volume vol;
     struct audio_callback callback;
     LIST_ENTRY (SWVoiceIn) entries;
 };
@@ -149,13 +149,13 @@
 };
 
 struct audio_pcm_ops {
-    int  (*init_out)(HWVoiceOut *hw, audsettings_t *as);
+    int  (*init_out)(HWVoiceOut *hw, struct audsettings *as);
     void (*fini_out)(HWVoiceOut *hw);
     int  (*run_out) (HWVoiceOut *hw);
     int  (*write)   (SWVoiceOut *sw, void *buf, int size);
     int  (*ctl_out) (HWVoiceOut *hw, int cmd, ...);
 
-    int  (*init_in) (HWVoiceIn *hw, audsettings_t *as);
+    int  (*init_in) (HWVoiceIn *hw, struct audsettings *as);
     void (*fini_in) (HWVoiceIn *hw);
     int  (*run_in)  (HWVoiceIn *hw);
     int  (*read)    (SWVoiceIn *sw, void *buf, int size);
@@ -204,9 +204,9 @@
 extern struct audio_driver dsound_audio_driver;
 extern struct audio_driver esd_audio_driver;
 extern struct audio_driver pa_audio_driver;
-extern volume_t nominal_volume;
+extern struct mixeng_volume nominal_volume;
 
-void audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as);
+void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as);
 void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int 
len);
 
 int  audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int len);

Modified: trunk/audio/audio_template.h
===================================================================
--- trunk/audio/audio_template.h        2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/audio_template.h        2008-12-03 22:48:44 UTC (rev 5864)
@@ -82,7 +82,7 @@
 
 static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw)
 {
-    HWBUF = audio_calloc (AUDIO_FUNC, hw->samples, sizeof (st_sample_t));
+    HWBUF = audio_calloc (AUDIO_FUNC, hw->samples, sizeof (struct st_sample));
     if (!HWBUF) {
         dolog ("Could not allocate " NAME " buffer (%d samples)\n",
                hw->samples);
@@ -116,7 +116,7 @@
     samples = ((int64_t) sw->hw->samples << 32) / sw->ratio;
 #endif
 
-    sw->buf = audio_calloc (AUDIO_FUNC, samples, sizeof (st_sample_t));
+    sw->buf = audio_calloc (AUDIO_FUNC, samples, sizeof (struct st_sample));
     if (!sw->buf) {
         dolog ("Could not allocate buffer for `%s' (%d samples)\n",
                SW_NAME (sw), samples);
@@ -140,7 +140,7 @@
     SW *sw,
     HW *hw,
     const char *name,
-    audsettings_t *as
+    struct audsettings *as
     )
 {
     int err;
@@ -229,7 +229,7 @@
 static HW *glue (audio_pcm_hw_find_specific_, TYPE) (
     AudioState *s,
     HW *hw,
-    audsettings_t *as
+    struct audsettings *as
     )
 {
     while ((hw = glue (audio_pcm_hw_find_any_, TYPE) (s, hw))) {
@@ -240,7 +240,8 @@
     return NULL;
 }
 
-static HW *glue (audio_pcm_hw_add_new_, TYPE) (AudioState *s, audsettings_t 
*as)
+static HW *glue (audio_pcm_hw_add_new_, TYPE) (AudioState *s,
+                                               struct audsettings *as)
 {
     HW *hw;
     struct audio_driver *drv = s->drv;
@@ -308,7 +309,8 @@
     return NULL;
 }
 
-static HW *glue (audio_pcm_hw_add_, TYPE) (AudioState *s, audsettings_t *as)
+static HW *glue (audio_pcm_hw_add_, TYPE) (AudioState *s,
+                                           struct audsettings *as)
 {
     HW *hw;
 
@@ -335,12 +337,12 @@
 static SW *glue (audio_pcm_create_voice_pair_, TYPE) (
     AudioState *s,
     const char *sw_name,
-    audsettings_t *as
+    struct audsettings *as
     )
 {
     SW *sw;
     HW *hw;
-    audsettings_t hw_as;
+    struct audsettings hw_as;
 
     if (glue (conf.fixed_, TYPE).enabled) {
         hw_as = glue (conf.fixed_, TYPE).settings;
@@ -405,7 +407,7 @@
     const char *name,
     void *callback_opaque ,
     audio_callback_fn_t callback_fn,
-    audsettings_t *as
+    struct audsettings *as
     )
 {
     AudioState *s;

Modified: trunk/audio/coreaudio.c
===================================================================
--- trunk/audio/coreaudio.c     2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/coreaudio.c     2008-12-03 22:48:44 UTC (rev 5864)
@@ -233,7 +233,7 @@
     HWVoiceOut *hw = hwptr;
     coreaudioVoiceOut *core = (coreaudioVoiceOut *) hwptr;
     int rpos, live;
-    st_sample_t *src;
+    struct st_sample *src;
 #ifndef FLOAT_MIXENG
 #ifdef RECIPROCAL
     const float scale = 1.f / UINT_MAX;
@@ -289,7 +289,7 @@
     return audio_pcm_sw_write (sw, buf, len);
 }
 
-static int coreaudio_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     OSStatus status;
     coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw;

Modified: trunk/audio/dsound_template.h
===================================================================
--- trunk/audio/dsound_template.h       2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/dsound_template.h       2008-12-03 22:48:44 UTC (rev 5864)
@@ -174,16 +174,16 @@
 }
 
 #ifdef DSBTYPE_IN
-static int dsound_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int dsound_init_in (HWVoiceIn *hw, struct audsettings *as)
 #else
-static int dsound_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int dsound_init_out (HWVoiceOut *hw, struct audsettings *as)
 #endif
 {
     int err;
     HRESULT hr;
     dsound *s = &glob_dsound;
     WAVEFORMATEX wfx;
-    audsettings_t obt_as;
+    struct audsettings obt_as;
 #ifdef DSBTYPE_IN
     const char *typ = "ADC";
     DSoundVoiceIn *ds = (DSoundVoiceIn *) hw;

Modified: trunk/audio/dsoundaudio.c
===================================================================
--- trunk/audio/dsoundaudio.c   2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/dsoundaudio.c   2008-12-03 22:48:44 UTC (rev 5864)
@@ -47,7 +47,7 @@
     int set_primary;
     int bufsize_in;
     int bufsize_out;
-    audsettings_t settings;
+    struct audsettings settings;
     int latency_millis;
 } conf = {
     1,
@@ -68,7 +68,7 @@
     LPDIRECTSOUND dsound;
     LPDIRECTSOUNDCAPTURE dsound_capture;
     LPDIRECTSOUNDBUFFER dsound_primary_buffer;
-    audsettings_t settings;
+    struct audsettings settings;
 } dsound;
 
 static dsound glob_dsound;
@@ -307,7 +307,8 @@
     return -1;
 }
 
-static int waveformat_from_audio_settings (WAVEFORMATEX *wfx, audsettings_t 
*as)
+static int waveformat_from_audio_settings (WAVEFORMATEX *wfx,
+                                           struct audsettings *as)
 {
     memset (wfx, 0, sizeof (*wfx));
 
@@ -346,7 +347,8 @@
     return 0;
 }
 
-static int waveformat_to_audio_settings (WAVEFORMATEX *wfx, audsettings_t *as)
+static int waveformat_to_audio_settings (WAVEFORMATEX *wfx,
+                                         struct audsettings *as)
 {
     if (wfx->wFormatTag != WAVE_FORMAT_PCM) {
         dolog ("Invalid wave format, tag is not PCM, but %d\n",
@@ -448,8 +450,8 @@
     int src_len1 = dst_len;
     int src_len2 = 0;
     int pos = hw->rpos + dst_len;
-    st_sample_t *src1 = hw->mix_buf + hw->rpos;
-    st_sample_t *src2 = NULL;
+    struct st_sample *src1 = hw->mix_buf + hw->rpos;
+    struct st_sample *src2 = NULL;
 
     if (pos > hw->samples) {
         src_len1 = hw->samples - hw->rpos;

Modified: trunk/audio/esdaudio.c
===================================================================
--- trunk/audio/esdaudio.c      2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/esdaudio.c      2008-12-03 22:48:44 UTC (rev 5864)
@@ -115,7 +115,7 @@
         while (to_mix) {
             ssize_t written;
             int chunk = audio_MIN (to_mix, hw->samples - rpos);
-            st_sample_t *src = hw->mix_buf + rpos;
+            struct st_sample *src = hw->mix_buf + rpos;
 
             hw->clip (esd->pcm_buf, src, chunk);
 
@@ -188,10 +188,10 @@
     return audio_pcm_sw_write (sw, buf, len);
 }
 
-static int qesd_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int qesd_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     ESDVoiceOut *esd = (ESDVoiceOut *) hw;
-    audsettings_t obt_as = *as;
+    struct audsettings obt_as = *as;
     int esdfmt = ESD_STREAM | ESD_PLAY;
     int err;
     sigset_t set, old_set;
@@ -421,10 +421,10 @@
     return audio_pcm_sw_read (sw, buf, len);
 }
 
-static int qesd_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int qesd_init_in (HWVoiceIn *hw, struct audsettings *as)
 {
     ESDVoiceIn *esd = (ESDVoiceIn *) hw;
-    audsettings_t obt_as = *as;
+    struct audsettings obt_as = *as;
     int esdfmt = ESD_STREAM | ESD_RECORD;
     int err;
     sigset_t set, old_set;

Modified: trunk/audio/fmodaudio.c
===================================================================
--- trunk/audio/fmodaudio.c     2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/fmodaudio.c     2008-12-03 22:48:44 UTC (rev 5864)
@@ -142,8 +142,8 @@
     int src_len1 = dst_len;
     int src_len2 = 0;
     int pos = hw->rpos + dst_len;
-    st_sample_t *src1 = hw->mix_buf + hw->rpos;
-    st_sample_t *src2 = NULL;
+    struct st_sample *src1 = hw->mix_buf + hw->rpos;
+    struct st_sample *src2 = NULL;
 
     if (pos > hw->samples) {
         src_len1 = hw->samples - hw->rpos;
@@ -355,11 +355,11 @@
     }
 }
 
-static int fmod_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int fmod_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     int bits16, mode, channel;
     FMODVoiceOut *fmd = (FMODVoiceOut *) hw;
-    audsettings_t obt_as = *as;
+    struct audsettings obt_as = *as;
 
     mode = aud_to_fmodfmt (as->fmt, as->nchannels == 2 ? 1 : 0);
     fmd->fmod_sample = FSOUND_Sample_Alloc (
@@ -417,11 +417,11 @@
     return 0;
 }
 
-static int fmod_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int fmod_init_in (HWVoiceIn *hw, struct audsettings *as)
 {
     int bits16, mode;
     FMODVoiceIn *fmd = (FMODVoiceIn *) hw;
-    audsettings_t obt_as = *as;
+    struct audsettings obt_as = *as;
 
     if (conf.broken_adc) {
         return -1;

Modified: trunk/audio/mixeng.c
===================================================================
--- trunk/audio/mixeng.c        2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/mixeng.c        2008-12-03 22:48:44 UTC (rev 5864)
@@ -290,7 +290,7 @@
     uint64_t opos;
     uint64_t opos_inc;
     uint32_t ipos;              /* position in the input stream (integer) */
-    st_sample_t ilast;          /* last sample in the input stream */
+    struct st_sample ilast;          /* last sample in the input stream */
 };
 
 /*
@@ -329,7 +329,7 @@
     qemu_free (opaque);
 }
 
-void mixeng_clear (st_sample_t *buf, int len)
+void mixeng_clear (struct st_sample *buf, int len)
 {
-    memset (buf, 0, len * sizeof (st_sample_t));
+    memset (buf, 0, len * sizeof (struct st_sample));
 }

Modified: trunk/audio/mixeng.h
===================================================================
--- trunk/audio/mixeng.h        2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/mixeng.h        2008-12-03 22:48:44 UTC (rev 5864)
@@ -25,27 +25,27 @@
 #define QEMU_MIXENG_H
 
 #ifdef FLOAT_MIXENG
-typedef float real_t;
-typedef struct { int mute; real_t r; real_t l; } volume_t;
-typedef struct { real_t l; real_t r; } st_sample_t;
+typedef float mixeng_real;
+struct mixeng_volume { int mute; mixeng_real r; mixeng_real l; };
+struct mixeng_sample { mixeng_real l; mixeng_real r; };
 #else
-typedef struct { int mute; int64_t r; int64_t l; } volume_t;
-typedef struct { int64_t l; int64_t r; } st_sample_t;
+struct mixeng_volume { int mute; int64_t r; int64_t l; };
+struct st_sample { int64_t l; int64_t r; };
 #endif
 
-typedef void (t_sample) (st_sample_t *dst, const void *src,
-                         int samples, volume_t *vol);
-typedef void (f_sample) (void *dst, const st_sample_t *src, int samples);
+typedef void (t_sample) (struct st_sample *dst, const void *src,
+                         int samples, struct mixeng_volume *vol);
+typedef void (f_sample) (void *dst, const struct st_sample *src, int samples);
 
 extern t_sample *mixeng_conv[2][2][2][3];
 extern f_sample *mixeng_clip[2][2][2][3];
 
 void *st_rate_start (int inrate, int outrate);
-void st_rate_flow (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
+void st_rate_flow (void *opaque, struct st_sample *ibuf, struct st_sample 
*obuf,
                    int *isamp, int *osamp);
-void st_rate_flow_mix (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
+void st_rate_flow_mix (void *opaque, struct st_sample *ibuf, struct st_sample 
*obuf,
                        int *isamp, int *osamp);
 void st_rate_stop (void *opaque);
-void mixeng_clear (st_sample_t *buf, int len);
+void mixeng_clear (struct st_sample *buf, int len);
 
 #endif  /* mixeng.h */

Modified: trunk/audio/mixeng_template.h
===================================================================
--- trunk/audio/mixeng_template.h       2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/mixeng_template.h       2008-12-03 22:48:44 UTC (rev 5864)
@@ -44,26 +44,26 @@
 #define ET glue (ENDIAN_CONVERSION, glue (_, IN_T))
 
 #ifdef FLOAT_MIXENG
-static real_t inline glue (conv_, ET) (IN_T v)
+static mixeng_real inline glue (conv_, ET) (IN_T v)
 {
     IN_T nv = ENDIAN_CONVERT (v);
 
 #ifdef RECIPROCAL
 #ifdef SIGNED
-    return nv * (1.f / (real_t) (IN_MAX - IN_MIN));
+    return nv * (1.f / (mixeng_real) (IN_MAX - IN_MIN));
 #else
-    return (nv - HALF) * (1.f / (real_t) IN_MAX);
+    return (nv - HALF) * (1.f / (mixeng_real) IN_MAX);
 #endif
 #else  /* !RECIPROCAL */
 #ifdef SIGNED
-    return nv / (real_t) (IN_MAX - IN_MIN);
+    return nv / (mixeng_real) (IN_MAX - IN_MIN);
 #else
-    return (nv - HALF) / (real_t) IN_MAX;
+    return (nv - HALF) / (mixeng_real) IN_MAX;
 #endif
 #endif
 }
 
-static IN_T inline glue (clip_, ET) (real_t v)
+static IN_T inline glue (clip_, ET) (mixeng_real v)
 {
     if (v >= 0.5) {
         return IN_MAX;
@@ -109,9 +109,9 @@
 #endif
 
 static void glue (glue (conv_, ET), _to_stereo)
-    (st_sample_t *dst, const void *src, int samples, volume_t *vol)
+    (struct st_sample *dst, const void *src, int samples, struct mixeng_volume 
*vol)
 {
-    st_sample_t *out = dst;
+    struct st_sample *out = dst;
     IN_T *in = (IN_T *) src;
 #ifdef CONFIG_MIXEMU
     if (vol->mute) {
@@ -129,9 +129,9 @@
 }
 
 static void glue (glue (conv_, ET), _to_mono)
-    (st_sample_t *dst, const void *src, int samples, volume_t *vol)
+    (struct st_sample *dst, const void *src, int samples, struct mixeng_volume 
*vol)
 {
-    st_sample_t *out = dst;
+    struct st_sample *out = dst;
     IN_T *in = (IN_T *) src;
 #ifdef CONFIG_MIXEMU
     if (vol->mute) {
@@ -150,9 +150,9 @@
 }
 
 static void glue (glue (clip_, ET), _from_stereo)
-    (void *dst, const st_sample_t *src, int samples)
+    (void *dst, const struct st_sample *src, int samples)
 {
-    const st_sample_t *in = src;
+    const struct st_sample *in = src;
     IN_T *out = (IN_T *) dst;
     while (samples--) {
         *out++ = glue (clip_, ET) (in->l);
@@ -162,9 +162,9 @@
 }
 
 static void glue (glue (clip_, ET), _from_mono)
-    (void *dst, const st_sample_t *src, int samples)
+    (void *dst, const struct st_sample *src, int samples)
 {
-    const st_sample_t *in = src;
+    const struct st_sample *in = src;
     IN_T *out = (IN_T *) dst;
     while (samples--) {
         *out++ = glue (clip_, ET) (in->l + in->r);

Modified: trunk/audio/noaudio.c
===================================================================
--- trunk/audio/noaudio.c       2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/noaudio.c       2008-12-03 22:48:44 UTC (rev 5864)
@@ -68,7 +68,7 @@
     return audio_pcm_sw_write (sw, buf, len);
 }
 
-static int no_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int no_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     audio_pcm_init_info (&hw->info, as);
     hw->samples = 1024;
@@ -87,7 +87,7 @@
     return 0;
 }
 
-static int no_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int no_init_in (HWVoiceIn *hw, struct audsettings *as)
 {
     audio_pcm_init_info (&hw->info, as);
     hw->samples = 1024;

Modified: trunk/audio/ossaudio.c
===================================================================
--- trunk/audio/ossaudio.c      2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/ossaudio.c      2008-12-03 22:48:44 UTC (rev 5864)
@@ -294,7 +294,7 @@
     int err, rpos, live, decr;
     int samples;
     uint8_t *dst;
-    st_sample_t *src;
+    struct st_sample *src;
     struct audio_buf_info abinfo;
     struct count_info cntinfo;
     int bufsize;
@@ -434,7 +434,7 @@
     }
 }
 
-static int oss_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int oss_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     OSSVoiceOut *oss = (OSSVoiceOut *) hw;
     struct oss_params req, obt;
@@ -442,7 +442,7 @@
     int err;
     int fd;
     audfmt_e effective_fmt;
-    audsettings_t obt_as;
+    struct audsettings obt_as;
 
     oss->fd = -1;
 
@@ -576,7 +576,7 @@
     return 0;
 }
 
-static int oss_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int oss_init_in (HWVoiceIn *hw, struct audsettings *as)
 {
     OSSVoiceIn *oss = (OSSVoiceIn *) hw;
     struct oss_params req, obt;
@@ -584,7 +584,7 @@
     int err;
     int fd;
     audfmt_e effective_fmt;
-    audsettings_t obt_as;
+    struct audsettings obt_as;
 
     oss->fd = -1;
 

Modified: trunk/audio/paaudio.c
===================================================================
--- trunk/audio/paaudio.c       2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/paaudio.c       2008-12-03 22:48:44 UTC (rev 5864)
@@ -95,7 +95,7 @@
         while (to_mix) {
             int error;
             int chunk = audio_MIN (to_mix, hw->samples - rpos);
-            st_sample_t *src = hw->mix_buf + rpos;
+            struct st_sample *src = hw->mix_buf + rpos;
 
             hw->clip (pa->pcm_buf, src, chunk);
 
@@ -295,11 +295,11 @@
     }
 }
 
-static int qpa_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int qpa_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     int error;
     static pa_sample_spec ss;
-    audsettings_t obt_as = *as;
+    struct audsettings obt_as = *as;
     PAVoiceOut *pa = (PAVoiceOut *) hw;
 
     ss.format = audfmt_to_pa (as->fmt, as->endianness);
@@ -349,11 +349,11 @@
     return -1;
 }
 
-static int qpa_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int qpa_init_in (HWVoiceIn *hw, struct audsettings *as)
 {
     int error;
     static pa_sample_spec ss;
-    audsettings_t obt_as = *as;
+    struct audsettings obt_as = *as;
     PAVoiceIn *pa = (PAVoiceIn *) hw;
 
     ss.format = audfmt_to_pa (as->fmt, as->endianness);

Modified: trunk/audio/rate_template.h
===================================================================
--- trunk/audio/rate_template.h 2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/rate_template.h 2008-12-03 22:48:44 UTC (rev 5864)
@@ -27,15 +27,15 @@
  * Processed signed long samples from ibuf to obuf.
  * Return number of samples processed.
  */
-void NAME (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
+void NAME (void *opaque, struct st_sample *ibuf, struct st_sample *obuf,
            int *isamp, int *osamp)
 {
     struct rate *rate = opaque;
-    st_sample_t *istart, *iend;
-    st_sample_t *ostart, *oend;
-    st_sample_t ilast, icur, out;
+    struct st_sample *istart, *iend;
+    struct st_sample *ostart, *oend;
+    struct st_sample ilast, icur, out;
 #ifdef FLOAT_MIXENG
-    real_t t;
+    mixeng_real t;
 #else
     int64_t t;
 #endif
@@ -84,7 +84,7 @@
 #ifdef RECIPROCAL
         t = (rate->opos & UINT_MAX) * (1.f / UINT_MAX);
 #else
-        t = (rate->opos & UINT_MAX) / (real_t) UINT_MAX;
+        t = (rate->opos & UINT_MAX) / (mixeng_real) UINT_MAX;
 #endif
         out.l = (ilast.l * (1.0 - t)) + icur.l * t;
         out.r = (ilast.r * (1.0 - t)) + icur.r * t;

Modified: trunk/audio/sdlaudio.c
===================================================================
--- trunk/audio/sdlaudio.c      2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/sdlaudio.c      2008-12-03 22:48:44 UTC (rev 5864)
@@ -257,7 +257,7 @@
         decr = to_mix;
         while (to_mix) {
             int chunk = audio_MIN (to_mix, hw->samples - hw->rpos);
-            st_sample_t *src = hw->mix_buf + hw->rpos;
+            struct st_sample *src = hw->mix_buf + hw->rpos;
 
             /* dolog ("in callback to_mix %d, chunk %d\n", to_mix, chunk); */
             hw->clip (buf, src, chunk);
@@ -323,7 +323,7 @@
     sdl_close (&glob_sdl);
 }
 
-static int sdl_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     SDLVoiceOut *sdl = (SDLVoiceOut *) hw;
     SDLAudioState *s = &glob_sdl;
@@ -332,7 +332,7 @@
     int endianess;
     int err;
     audfmt_e effective_fmt;
-    audsettings_t obt_as;
+    struct audsettings obt_as;
 
     shift <<= as->nchannels == 2;
 

Modified: trunk/audio/wavaudio.c
===================================================================
--- trunk/audio/wavaudio.c      2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/wavaudio.c      2008-12-03 22:48:44 UTC (rev 5864)
@@ -37,7 +37,7 @@
 } WAVVoiceOut;
 
 static struct {
-    audsettings_t settings;
+    struct audsettings settings;
     const char *wav_path;
 } conf = {
     {
@@ -54,7 +54,7 @@
     WAVVoiceOut *wav = (WAVVoiceOut *) hw;
     int rpos, live, decr, samples;
     uint8_t *dst;
-    st_sample_t *src;
+    struct st_sample *src;
     int64_t now = qemu_get_clock (vm_clock);
     int64_t ticks = now - wav->old_ticks;
     int64_t bytes = (ticks * hw->info.bytes_per_second) / ticks_per_sec;
@@ -109,7 +109,7 @@
     }
 }
 
-static int wav_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int wav_init_out (HWVoiceOut *hw, struct audsettings *as)
 {
     WAVVoiceOut *wav = (WAVVoiceOut *) hw;
     int bits16 = 0, stereo = 0;
@@ -119,7 +119,7 @@
         0x02, 0x00, 0x44, 0xac, 0x00, 0x00, 0x10, 0xb1, 0x02, 0x00, 0x04,
         0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00
     };
-    audsettings_t wav_as = conf.settings;
+    struct audsettings wav_as = conf.settings;
 
     (void) as;
 

Modified: trunk/audio/wavcapture.c
===================================================================
--- trunk/audio/wavcapture.c    2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/audio/wavcapture.c    2008-12-03 22:48:44 UTC (rev 5864)
@@ -91,7 +91,7 @@
         0x02, 0x00, 0x44, 0xac, 0x00, 0x00, 0x10, 0xb1, 0x02, 0x00, 0x04,
         0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00
     };
-    audsettings_t as;
+    struct audsettings as;
     struct audio_capture_ops ops;
     int stereo, bits16, shift;
     CaptureVoiceOut *cap;

Modified: trunk/hw/ac97.c
===================================================================
--- trunk/hw/ac97.c     2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/ac97.c     2008-12-03 22:48:44 UTC (rev 5864)
@@ -354,7 +354,7 @@
 
 static void open_voice (AC97LinkState *s, int index, int freq)
 {
-    audsettings_t as;
+    struct audsettings as;
 
     as.freq = freq;
     as.nchannels = 2;

Modified: trunk/hw/adlib.c
===================================================================
--- trunk/hw/adlib.c    2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/adlib.c    2008-12-03 22:48:44 UTC (rev 5864)
@@ -280,7 +280,7 @@
 int Adlib_init (AudioState *audio, qemu_irq *pic)
 {
     AdlibState *s = &glob_adlib;
-    audsettings_t as;
+    struct audsettings as;
 
     if (!audio) {
         dolog ("No audio state\n");

Modified: trunk/hw/cs4231a.c
===================================================================
--- trunk/hw/cs4231a.c  2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/cs4231a.c  2008-12-03 22:48:44 UTC (rev 5864)
@@ -268,7 +268,7 @@
 static void cs_reset_voices (CSState *s, uint32_t val)
 {
     int xtal;
-    audsettings_t as;
+    struct audsettings as;
 
 #ifdef DEBUG_XLAW
     if (val == 0 || val == 32)

Modified: trunk/hw/es1370.c
===================================================================
--- trunk/hw/es1370.c   2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/es1370.c   2008-12-03 22:48:44 UTC (rev 5864)
@@ -421,7 +421,7 @@
                     (new_fmt & 2) ? AUD_FMT_S16 : AUD_FMT_U8,
                     d->shift);
             if (new_freq) {
-                audsettings_t as;
+                struct audsettings as;
 
                 as.freq = new_freq;
                 as.nchannels = 1 << (new_fmt & 1);

Modified: trunk/hw/gus.c
===================================================================
--- trunk/hw/gus.c      2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/gus.c      2008-12-03 22:48:44 UTC (rev 5864)
@@ -253,7 +253,7 @@
 int GUS_init (AudioState *audio, qemu_irq *pic)
 {
     GUSState *s;
-    audsettings_t as;
+    struct audsettings as;
 
     if (!audio) {
         dolog ("No audio state\n");

Modified: trunk/hw/omap2.c
===================================================================
--- trunk/hw/omap2.c    2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/omap2.c    2008-12-03 22:48:44 UTC (rev 5864)
@@ -1610,7 +1610,7 @@
 
 static void omap_eac_format_update(struct omap_eac_s *s)
 {
-    audsettings_t fmt;
+    struct audsettings fmt;
 
     /* The hardware buffers at most one sample */
     if (s->codec.rxlen)

Modified: trunk/hw/pcspk.c
===================================================================
--- trunk/hw/pcspk.c    2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/pcspk.c    2008-12-03 22:48:44 UTC (rev 5864)
@@ -99,7 +99,7 @@
 int pcspk_audio_init(AudioState *audio, qemu_irq *pic)
 {
     PCSpkState *s = &pcspk_state;
-    audsettings_t as = {PCSPK_SAMPLE_RATE, 1, AUD_FMT_U8, 0};
+    struct audsettings as = {PCSPK_SAMPLE_RATE, 1, AUD_FMT_U8, 0};
 
     if (!audio) {
         AUD_log(s_spk, "No audio state\n");

Modified: trunk/hw/sb16.c
===================================================================
--- trunk/hw/sb16.c     2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/sb16.c     2008-12-03 22:48:44 UTC (rev 5864)
@@ -201,7 +201,7 @@
 static void continue_dma8 (SB16State *s)
 {
     if (s->freq > 0) {
-        audsettings_t as;
+        struct audsettings as;
 
         s->audio_free = 0;
 
@@ -346,7 +346,7 @@
     }
 
     if (s->freq) {
-        audsettings_t as;
+        struct audsettings as;
 
         s->audio_free = 0;
 
@@ -833,7 +833,7 @@
 
 static void legacy_reset (SB16State *s)
 {
-    audsettings_t as;
+    struct audsettings as;
 
     s->freq = 11025;
     s->fmt_signed = 0;
@@ -1375,7 +1375,7 @@
 
     if (s->dma_running) {
         if (s->freq) {
-            audsettings_t as;
+            struct audsettings as;
 
             s->audio_free = 0;
 

Modified: trunk/hw/tsc210x.c
===================================================================
--- trunk/hw/tsc210x.c  2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/tsc210x.c  2008-12-03 22:48:44 UTC (rev 5864)
@@ -327,7 +327,7 @@
 static void tsc2102_audio_output_update(struct tsc210x_state_s *s)
 {
     int enable;
-    audsettings_t fmt;
+    struct audsettings fmt;
 
     if (s->dac_voice[0]) {
         tsc210x_out_flush(s, s->codec.out.len);

Modified: trunk/hw/wm8750.c
===================================================================
--- trunk/hw/wm8750.c   2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/hw/wm8750.c   2008-12-03 22:48:44 UTC (rev 5864)
@@ -170,9 +170,9 @@
 static void wm8750_set_format(struct wm8750_s *s)
 {
     int i;
-    audsettings_t in_fmt;
-    audsettings_t out_fmt;
-    audsettings_t monoout_fmt;
+    struct audsettings in_fmt;
+    struct audsettings out_fmt;
+    struct audsettings monoout_fmt;
 
     wm8750_out_flush(s);
 

Modified: trunk/vnc.c
===================================================================
--- trunk/vnc.c 2008-12-03 16:29:47 UTC (rev 5863)
+++ trunk/vnc.c 2008-12-03 22:48:44 UTC (rev 5864)
@@ -171,7 +171,7 @@
     int client_blue_shift, client_blue_max, server_blue_shift, server_blue_max;
 
     CaptureVoiceOut *audio_cap;
-    audsettings_t as;
+    struct audsettings as;
 
     VncReadEvent *read_handler;
     size_t read_handler_expect;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]