|
sipxmedialib
Version 3.3
|
Wrapper for ALSA device that use file descriptor to communicate. More...
#include <MpAlsa.h>


Public Member Functions | |||||
Creators | |||||
| MpAlsa () | |||||
| Constructor. More... | |||||
| ~MpAlsa () | |||||
| Destructor. More... | |||||
Manipulators | |||||
| OsStatus | setInputDevice (MpidAlsa *pIDD) | ||||
| Connect MpidAlsa class driver. More... | |||||
| OsStatus | setOutputDevice (MpodAlsa *pODD) | ||||
| Connect MpodAlsa class driver. More... | |||||
| OsStatus | freeInputDevice () | ||||
| Disconnect Input driver. More... | |||||
| OsStatus | freeOutputDevice () | ||||
| Disconnect Output driver. More... | |||||
| OsStatus | attachReader () | ||||
| Enable input device. More... | |||||
| OsStatus | attachWriter () | ||||
| Enable output device. More... | |||||
| OsStatus | detachReader () | ||||
| Disable input device. More... | |||||
| OsStatus | detachWriter () | ||||
| Disable output device. More... | |||||
Inquiry | |||||
| |||||
| UtlBoolean | isDeviceValid () | ||||
| Inquire if the device is valid. More... | |||||
| UtlBoolean | isReaderAttached () | ||||
| Inquire if the input device is connected. More... | |||||
| UtlBoolean | isWriterAttached () | ||||
| Inquire if the output device is connected. More... | |||||
| UtlBoolean | isDevCapBatch () | ||||
| UtlBoolean | isDevCapDuplex () | ||||
| UtlBoolean | isDevCapMmap () | ||||
| UtlBoolean | isDevCapTrigger () | ||||
| UtlBoolean | isNotUsed () | ||||
| Inquire if ALSA device is free, i.e. neither input nor output is connected. More... | |||||
Static Public Member Functions | |
Accessors | |
| static int | getDeviceNames (UtlContainer &deviceNames, bool capture) |
| get list of available input or output Alsa device names More... | |
Protected Member Functions | |
| OsStatus | initDevice (const char *devname, int samplesPerSecond) |
| Pre initializations for ALSA device. More... | |
| OsStatus | initDeviceFinal (unsigned samplesPerSec, unsigned samplerPerFrame) |
| Final initializations for ALSA device. More... | |
| OsStatus | setSampleRate (unsigned samplesPerSec, unsigned samplerPerFrame) |
| Because ALSA device works in duplex mode we must ensure that input and output driver use one sample rate and perfrom final init. More... | |
| OsStatus | doInput (char *buffer, int size) |
| Perform input operation of ALSA device. More... | |
| OsStatus | doOutput (const char *buffer, int size) |
| Perform output operation of ALSA device. More... | |
| OsStatus | doInputRs (MpAudioSample *buffer, unsigned size) |
| Perform input operation of ALSA device with siutable resampler. More... | |
| OsStatus | doOutputRs (const MpAudioSample *buffer, unsigned size) |
| Perform output operation of ALSA device with siutable resampler. More... | |
| void | noMoreNeeded () |
| Deinitialization and freeing sequences. More... | |
| void | soundIoThread () |
| Thread subroutine. More... | |
Protected Attributes | |
| UtlBoolean | mbReadCap |
| Device is able to play audio. More... | |
| UtlBoolean | mbWriteCap |
| Device is able to capture audio. More... | |
| MpidAlsa * | mReader |
| Input driver. More... | |
| MpodAlsa * | mWriter |
| Output driver. More... | |
| int | mDeviceCap |
| Device capabilities. More... | |
| volatile UtlBoolean | mStReader |
| Input device is enabled. More... | |
| volatile UtlBoolean | mStWriter |
| Output device is enabled. More... | |
| volatile UtlBoolean | mStShutdown |
| Thread exit flag. More... | |
| volatile UtlBoolean | mModeChanged |
| IO settings has changed. More... | |
| unsigned | mUsedSamplesPerSec |
| Used samples rate either for IO. More... | |
| unsigned | mUsedSamplesPerFrame |
| Used frame size for IO. More... | |
| MpAudioSample * | mResamplerBuffer |
| Buffer for conversions. More... | |
| UtlBoolean | mStereoOps |
| Use stereo output. More... | |
| pthread_t | mIoThread |
| Internal IO thread. More... | |
| sem_t | mSleepSem |
| Control IO thread sleeping. More... | |
| sem_t | mSignalSem |
| Use for parameters synchronization. More... | |
| snd_pcm_t * | pPcmOut |
| snd_pcm_t * | pPcmIn |
| int | writeBufSize |
| int | readBufSize |
Private Member Functions | |
| void | threadIoStatusChanged () |
| void | threadWakeUp () |
| void | threadKill () |
| UtlBoolean | alsaSetTrigger (bool turnOn) |
| UtlBoolean | alsaReset () |
| int | alsaSetupPcmDevice (const char *devname, bool capture, unsigned &suggestedRate) |
| int | alsaSetupWarning (const char *devname, int err, bool cap, const char *pLogString) |
Static Private Member Functions | |
| static void * | soundCardIoWrapper (void *arg) |
| Thread subroutine. More... | |
Friends | |
| class | MpidAlsa |
| class | MpodAlsa |
Wrapper for ALSA device that use file descriptor to communicate.
| MpAlsa | ( | ) |
Constructor.
| ~MpAlsa | ( | ) |
Destructor.
| OsStatus freeInputDevice | ( | ) |
Disconnect Input driver.
| OsStatus freeOutputDevice | ( | ) |
Disconnect Output driver.
| OsStatus attachReader | ( | ) |
Enable input device.
| OsStatus attachWriter | ( | ) |
Enable output device.
| OsStatus detachReader | ( | ) |
Disable input device.
| OsStatus detachWriter | ( | ) |
Disable output device.
|
static |
get list of available input or output Alsa device names
|
inline |
Inquire if the device is valid.
|
inline |
Inquire if the input device is connected.
|
inline |
Inquire if the output device is connected.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Inquire if ALSA device is free, i.e. neither input nor output is connected.
|
protected |
Pre initializations for ALSA device.
|
protected |
Final initializations for ALSA device.
|
protected |
Because ALSA device works in duplex mode we must ensure that input and output driver use one sample rate and perfrom final init.
|
protected |
Perform input operation of ALSA device.
|
protected |
Perform output operation of ALSA device.
|
protected |
Perform input operation of ALSA device with siutable resampler.
|
protected |
Perform output operation of ALSA device with siutable resampler.
|
protected |
Deinitialization and freeing sequences.
|
protected |
Thread subroutine.
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
Thread subroutine.
|
private |
|
private |
|
friend |
|
friend |
|
protected |
Device is able to play audio.
|
protected |
Device is able to capture audio.
|
protected |
Input driver.
|
protected |
Output driver.
|
protected |
Device capabilities.
|
protected |
Input device is enabled.
|
protected |
Output device is enabled.
|
protected |
Thread exit flag.
|
protected |
IO settings has changed.
|
protected |
Used samples rate either for IO.
|
protected |
Used frame size for IO.
|
protected |
Buffer for conversions.
|
protected |
Use stereo output.
|
protected |
Internal IO thread.
|
protected |
Control IO thread sleeping.
|
protected |
Use for parameters synchronization.
|
protected |
|
protected |
|
protected |
|
protected |
1.8.11