4 #include "audiodevice.h"
5 #include "playbackconfig.inc"
8 #include <sys/soundcard.h>
10 class OSSThread
: public Thread
13 OSSThread(AudioOSS
*device
);
17 void write_data(int fd
, unsigned char *data
, int bytes
);
18 void read_data(int fd
, unsigned char *data
, int bytes
);
19 // Must synchronize reads and writes
23 Mutex input_lock
, output_lock
, read_lock
, write_lock
;
31 class AudioOSS
: public AudioLowLevel
34 AudioOSS(AudioDevice
*device
);
40 int write_buffer(char *buffer
, int bytes
);
41 int read_buffer(char *buffer
, int bytes
);
43 int64_t device_position();
44 int flush_device(int number
);
45 int interrupt_playback();
48 int get_fmt(int bits
);
49 int sizetofrag(int samples
, int channels
, int bits
);
50 int set_cloexec_flag(int desc
, int value
);
51 int get_output(int number
);
52 int get_input(int number
);
53 int dsp_in
[MAXDEVICES
], dsp_out
[MAXDEVICES
], dsp_duplex
[MAXDEVICES
];
54 OSSThread
*thread
[MAXDEVICES
];
55 // Temp for each device
56 unsigned char *data
[MAXDEVICES
];
58 int data_allocated
[MAXDEVICES
];