#include <stdio.h>#include <string.h>#include <math.h>#include <fcntl.h>#include <sys/ioctl.h>#include <unistd.h>#include <pthread.h>#include <alloca.h>#include <malloc.h>#include <assert.h>#include <errno.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/poll.h>#include <limits.h>#include <semaphore.h>#include <machine/soundcard.h>#include "portaudio.h"#include "pa_util.h"#include "pa_allocation.h"#include "pa_hostapi.h"#include "pa_stream.h"#include "pa_cpuload.h"#include "pa_process.h"#include "pa_unix_util.h"Data Structures | |
| struct | PaOSSHostApiRepresentation |
| struct | PaOssStreamComponent |
| struct | PaOssStream |
Defines | |
| #define | DEVICE_NAME_BASE "/dev/audio" |
| #define | ENSURE_(expr, code) |
| #define | AFMT_S16_NE Get_AFMT_S16_NE() |
Enumerations | |
| enum | StreamMode { StreamMode_In, StreamMode_Out } |
Functions | |
| PaError | PaOSS_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) |
| PaError | PaUtil_InitializeDeviceInfo (PaDeviceInfo *deviceInfo, const char *name, PaHostApiIndex hostApiIndex, int maxInputChannels, int maxOutputChannels, PaTime defaultLowInputLatency, PaTime defaultLowOutputLatency, PaTime defaultHighInputLatency, PaTime defaultHighOutputLatency, double defaultSampleRate, PaUtilAllocationGroup *allocations) |
| #define AFMT_S16_NE Get_AFMT_S16_NE() |
| #define DEVICE_NAME_BASE "/dev/audio" |
| #define ENSURE_ | ( | expr, | |||
| code | ) |
Value:
do { \ if( UNLIKELY( (sysErr_ = (expr)) < 0 ) ) \ { \ /* PaUtil_SetLastHostErrorInfo should only be used in the main thread */ \ if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \ { \ PaUtil_SetLastHostErrorInfo( paALSA, sysErr_, strerror( errno ) ); \ } \ \ PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \ result = (code); \ goto error; \ } \ } while( 0 );
| enum StreamMode |
| PaError PaOSS_Initialize | ( | PaUtilHostApiRepresentation ** | hostApi, | |
| PaHostApiIndex | hostApiIndex | |||
| ) |
Initialize the OSS API implementation.
This function will initialize host API datastructures and query host devices for information.
Aspect DeviceCapabilities: Enumeration of host API devices is initiated from here
Aspect FreeResources: If an error is encountered under way we have to free each resource allocated in this function, this happens with the usual "error" label.
| PaError PaUtil_InitializeDeviceInfo | ( | PaDeviceInfo * | deviceInfo, | |
| const char * | name, | |||
| PaHostApiIndex | hostApiIndex, | |||
| int | maxInputChannels, | |||
| int | maxOutputChannels, | |||
| PaTime | defaultLowInputLatency, | |||
| PaTime | defaultLowOutputLatency, | |||
| PaTime | defaultHighInputLatency, | |||
| PaTime | defaultHighOutputLatency, | |||
| double | defaultSampleRate, | |||
| PaUtilAllocationGroup * | allocations | |||
| ) |
1.4.7