/*
* QEMU Audio subsystem header
*
* Copyright (c) 2003-2005 Vassili Karpov (malc)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef QEMU_AUDIO_INT_H
#define QEMU_AUDIO_INT_H
#ifdef CONFIG_COREAUDIO
#ifndef VBOX
#define FLOAT_MIXENG
#else
#endif
/* #define RECIPROCAL */
#endif
#include <limits.h>
#include "mixeng.h"
struct audio_pcm_ops;
typedef enum {
struct audio_option {
const char *name;
void *valp;
const char *descr;
int *overridenp;
int overriden;
};
struct audio_callback {
void *opaque;
};
struct audio_pcm_info {
int bits;
int sign;
int freq;
int nchannels;
int align;
int shift;
int bytes_per_second;
int swap_endianness;
};
typedef struct HWVoiceOut {
int enabled;
int pending_disable;
int rpos;
int samples;
} HWVoiceOut;
typedef struct HWVoiceIn {
int enabled;
int wpos;
int samples;
} HWVoiceIn;
struct SWVoiceOut {
int buf_samples;
void *rate;
int active;
int empty;
char *name;
};
struct SWVoiceIn {
int active;
void *rate;
char *name;
};
struct audio_driver {
const char *name;
const char *descr;
void *(*init) (void);
void (*fini) (void *);
int can_be_default;
int max_voices_out;
int max_voices_in;
int voice_size_out;
int voice_size_in;
};
struct audio_pcm_ops {
};
struct capture_callback {
void *opaque;
};
struct CaptureVoiceOut {
void *buf;
};
struct SWVoiceCap {
};
struct AudioState {
void *drv_opaque;
int nb_hw_voices_out;
int nb_hw_voices_in;
};
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 pulse_audio_driver;
extern struct audio_driver coreaudio_audio_driver;
extern struct audio_driver dsound_audio_driver;
extern struct audio_driver solaudio_audio_driver;
extern volume_t nominal_volume;
#ifdef VBOX
extern volume_t pcm_out_volume;
extern volume_t pcm_in_volume;
#endif
uint64_t audio_get_clock (void);
uint64_t audio_get_ticks_per_sec (void);
{
}
#if __STDC_VERSION__ > 199901L
#define INIT_FIELD(f) . f
#else
#endif
#else
#define GCC_FMT_ATTR(n, m)
#endif
#ifndef VBOX
#else
#endif
{
}
#ifdef DEBUG
{
}
#else
#define ldebug(...)
#else
#ifndef VBOX
#else
#endif
{
(void) fmt;
}
#endif
#endif
#define AUDIO_STRINGIFY_(n) #n
#else
#endif
unsigned cSamples);
/*
* Filter interface.
*/
typedef DECLCALLBACK(int) FNAUDIOINPUTCALLBACK(void* pvCtx, uint32_t cbSamples, const void *pvSamples);
int filter_output_intercepted(void);
void filter_output_end(void *pvOutputCtx);
int filter_input_intercepted(void);
int filter_input_begin(void **ppvInputCtx, PFNAUDIOINPUTCALLBACK pfnCallback, void *pvCallback, HWVoiceIn *phw, int samples);
void filter_input_end(void *pvInputCtx);
#endif /* audio_int.h */