comparison libmpdemux/audio_in.h @ 7060:b14880a6cccb

new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>: - multithreaded audio/video buffering (I know mplayer crew hates threads but it seems to me as the only way of doing reliable a/v capture) - a/v timebase synchronization (sample count vs. gettimeofday) - "immediate" mode support for mplayer - fixed colorspace stuff - RGB?? and YUY2 modes now work as expected - native ALSA audio capture - separated audio input layer
author arpi
date Wed, 21 Aug 2002 22:50:40 +0000
parents
children 838ee1b00853
comparison
equal deleted inserted replaced
7059:5285a81929a5 7060:b14880a6cccb
1 #ifndef _audio_in_h
2 #define _audio_in_h
3
4 #define AUDIO_IN_ALSA 1
5 #define AUDIO_IN_OSS 2
6
7 #include "config.h"
8
9 #ifdef HAVE_ALSA9
10 #include <alsa/asoundlib.h>
11
12 typedef struct {
13 char *device;
14
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
21
22 typedef struct {
23 char *device;
24
25 int audio_fd;
26 } ai_oss_t;
27
28 typedef struct
29 {
30 int type;
31 int setup;
32
33 /* requested values */
34 int req_channels;
35 int req_samplerate;
36
37 /* real values read-only */
38 int channels;
39 int samplerate;
40 int blocksize;
41 int bytes_per_sample;
42 int samplesize;
43
44 #ifdef HAVE_ALSA9
45 ai_alsa_t alsa;
46 #endif
47 ai_oss_t oss;
48 } audio_in_t;
49
50 int audio_in_init(audio_in_t *ai, int type);
51 int audio_in_setup(audio_in_t *ai);
52 int audio_in_set_device(audio_in_t *ai, char *device);
53 int audio_in_set_samplerate(audio_in_t *ai, int rate);
54 int audio_in_set_channels(audio_in_t *ai, int channels);
55 int audio_in_uninit(audio_in_t *ai);
56 int audio_in_start_capture(audio_in_t *ai);
57 int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer);
58
59 #ifdef HAVE_ALSA9
60 int ai_alsa_setup(audio_in_t *ai);
61 int ai_alsa_init(audio_in_t *ai);
62 #endif
63
64 int ai_oss_set_samplerate(audio_in_t *ai);
65 int ai_oss_set_channels(audio_in_t *ai);
66 int ai_oss_init(audio_in_t *ai);
67
68 #endif /* _audio_in_h */