Fix a possible crash on 64 bit systems when the lumSrcPtr or chrSrcPtr
[mplayer/glamo.git] / stream / audio_in.h
blobc4b3ea91a7a2a735c64f509f2dba65e0b8cc444d
1 #ifndef _audio_in_h
2 #define _audio_in_h
4 #define AUDIO_IN_ALSA 1
5 #define AUDIO_IN_OSS 2
7 #include "config.h"
9 #if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X)
10 #include <alsa/asoundlib.h>
12 typedef struct {
13 char *device;
15 snd_pcm_t *handle;
16 snd_output_t *log;
17 int buffer_time, period_time, chunk_size;
18 size_t bits_per_sample, bits_per_frame;
19 } ai_alsa_t;
20 #endif
22 #ifdef USE_OSS_AUDIO
23 typedef struct {
24 char *device;
26 int audio_fd;
27 } ai_oss_t;
28 #endif
30 typedef struct
32 int type;
33 int setup;
35 /* requested values */
36 int req_channels;
37 int req_samplerate;
39 /* real values read-only */
40 int channels;
41 int samplerate;
42 int blocksize;
43 int bytes_per_sample;
44 int samplesize;
46 #if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X)
47 ai_alsa_t alsa;
48 #endif
49 #ifdef USE_OSS_AUDIO
50 ai_oss_t oss;
51 #endif
52 } audio_in_t;
54 int audio_in_init(audio_in_t *ai, int type);
55 int audio_in_setup(audio_in_t *ai);
56 int audio_in_set_device(audio_in_t *ai, char *device);
57 int audio_in_set_samplerate(audio_in_t *ai, int rate);
58 int audio_in_set_channels(audio_in_t *ai, int channels);
59 int audio_in_uninit(audio_in_t *ai);
60 int audio_in_start_capture(audio_in_t *ai);
61 int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer);
63 #if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X)
64 int ai_alsa_setup(audio_in_t *ai);
65 int ai_alsa_init(audio_in_t *ai);
66 int ai_alsa_xrun(audio_in_t *ai);
67 #endif
69 #ifdef USE_OSS_AUDIO
70 int ai_oss_set_samplerate(audio_in_t *ai);
71 int ai_oss_set_channels(audio_in_t *ai);
72 int ai_oss_init(audio_in_t *ai);
73 #endif
75 #endif /* _audio_in_h */