18 #include <semaphore.h> 20 #include <sys/types.h> 21 #include <sys/soundcard.h> 27 #include "utl/UtlVoidPtr.h" 138 OsStatus
initDeviceFinal(
unsigned samplesPerSec,
unsigned samplerPerFrame);
144 OsStatus
setSampleRate(
unsigned samplesPerSec,
unsigned samplerPerFrame);
147 OsStatus
doInput(
char* buffer,
int size);
149 OsStatus
doOutput(
const char* buffer,
int size);
OsStatus setInputDevice(MpidOss *pIDD)
Connect MpidOss class driver.
volatile UtlBoolean mStWriter
Output device is enabled.
Definition: MpOss.h:121
OsStatus attachReader()
Enable input device.
UtlBoolean isWriterAttached()
Inquire if the output device is connected.
Definition: MpOss.h:188
UtlBoolean ossSetTrigger(bool turnOn)
OsStatus freeDevice()
Free OSS device.
void noMoreNeeded()
Deinitialization and freeing sequences.
OsStatus initDeviceFinal(unsigned samplesPerSec, unsigned samplerPerFrame)
Final initializations for OSS device.
sem_t mSleepSem
Control IO thread sleeping.
Definition: MpOss.h:132
Container for device specific input OSS driver.
Definition: MpidOss.h:38
UtlBoolean isDevCapMmap()
Definition: MpOss.h:203
OsStatus detachReader()
Disable input device.
sem_t mSignalSem
Use for parameters synchronization.
Definition: MpOss.h:133
int mfdDevice
The fd of the POSIX device (e.g. /dev/dsp)
Definition: MpOss.h:111
Container for device specific input OSS driver.
Definition: MpodOss.h:41
int mDeviceCap
Device capabilities.
Definition: MpOss.h:118
OsStatus detachWriter()
Disable output device.
MpodOss * mWriter
Output driver.
Definition: MpOss.h:116
OsStatus setOutputDevice(MpodOss *pODD)
Connect MpodOss class driver.
OsStatus doOutput(const char *buffer, int size)
Perform output operation of OSS device.
int16_t MpAudioSample
Definition: MpTypes.h:44
UtlBoolean mbWriteCap
Device is able to capture audio.
Definition: MpOss.h:113
UtlBoolean isDevCapTrigger()
Definition: MpOss.h:208
unsigned mUsedSamplesPerSec
Used samples rate either for IO.
Definition: MpOss.h:125
void soundIoThread()
Thread subroutine.
OsStatus freeInputDevice()
Disconnect Input driver.
OsStatus freeOutputDevice()
Disconnect Output driver.
OsStatus doOutputRs(const MpAudioSample *buffer, unsigned size)
Perform output operation of OSS device with siutable resampler.
UtlBoolean isDevCapBatch()
Definition: MpOss.h:193
OsStatus setSampleRate(unsigned samplesPerSec, unsigned samplerPerFrame)
Because OSS device works in duplex mode we must ensure that input and output driver use one sample ra...
UtlBoolean isDevCapDuplex()
Definition: MpOss.h:198
MpAudioSample * mResamplerBuffer
Buffer for conversions.
Definition: MpOss.h:128
UtlBoolean isNotUsed()
Inquire if OSS device is free, i.e. neither input nor output is connected.
Definition: MpOss.h:213
pthread_t mIoThread
Internal IO thread.
Definition: MpOss.h:131
UtlBoolean isReaderAttached()
Inquire if the input device is connected.
Definition: MpOss.h:183
UtlBoolean isDeviceValid()
Inquire if the device is valid.
Definition: MpOss.h:178
MpidOss * mReader
Input driver.
Definition: MpOss.h:115
unsigned mUsedSamplesPerFrame
Used frame size for IO.
Definition: MpOss.h:126
void threadIoStatusChanged()
UtlBoolean mbReadCap
Device is able to play audio.
Definition: MpOss.h:112
OsStatus doInput(char *buffer, int size)
Perform input operation of OSS device.
UtlBoolean mStereoOps
Use stereo output.
Definition: MpOss.h:129
volatile UtlBoolean mStShutdown
Thread exit flag.
Definition: MpOss.h:122
OsStatus attachWriter()
Enable output device.
volatile UtlBoolean mModeChanged
IO settings has changed.
Definition: MpOss.h:123
volatile UtlBoolean mStReader
Input device is enabled.
Definition: MpOss.h:120
OsStatus doInputRs(MpAudioSample *buffer, unsigned size)
Perform input operation of OSS device with siutable resampler.
OsStatus initDevice(const char *devname)
Pre initializations for OSS device.
static void * soundCardIoWrapper(void *arg)
Thread subroutine.
Wrapper for OSS device that use file descriptor to communicate.
Definition: MpOss.h:35