PortAudio  2.0
Data Structures | Macros | Typedefs | Functions
pa_linux_pulseaudio_internal.h File Reference
#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"
#include "pa_ringbuffer.h"
#include "pa_debugprint.h"
#include <stdio.h>
#include <string.h>
#include <pulse/pulseaudio.h>

Go to the source code of this file.

Data Structures

struct  PaPulseAudio_HostApiRepresentation
 
struct  PaPulseAudio_Stream
 

Macros

#define PA_PULSEAUDIO_SET_LAST_HOST_ERROR(errorCode, errorText)   PaUtil_SetLastHostErrorInfo(paInDevelopment, errorCode, errorText)
 
#define PAPULSEAUDIO_MAX_DEVICECOUNT   1024
 
#define PAPULSEAUDIO_MAX_DEVICENAME   1024
 
#define PA_PULSEAUDIO_DEFAULT_MIN_LATENCY   0.010
 
#define PA_PULSEAUDIO_DEFAULT_MAX_LATENCY   0.080
 
#define PAPULSEAUDIO_FRAMESPERBUFFERUNSPEC   32
 
#define PULSEAUDIO_BUFFER_SIZE   (96100 * 4 * 2)
 
#define PA_PULSEAUDIO_IS_ERROR(pastream, errorCode)
 

Typedefs

typedef struct PaPulseAudio_Stream PaPulseAudio_Stream
 

Functions

void PaPulseAudio_ReleaseOperation (PaPulseAudio_HostApiRepresentation *hostapi, pa_operation **pulseaudioOperation)
 
void PaPulseAudio_Lock (pa_threaded_mainloop *mainloop)
 
void PaPulseAudio_UnLock (pa_threaded_mainloop *mainloop)
 
PaError PaPulseAudio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index)
 
void Terminate (struct PaUtilHostApiRepresentation *hostApi)
 
PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate)
 
PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, PaStream **s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, void *userData)
 
PaError IsStreamStopped (PaStream *s)
 
PaError IsStreamActive (PaStream *stream)
 
PaTime GetStreamTime (PaStream *stream)
 
double GetStreamCpuLoad (PaStream *stream)
 
PaPulseAudio_HostApiRepresentationPaPulseAudio_New (void)
 
void PaPulseAudio_Free (PaPulseAudio_HostApiRepresentation *ptr)
 
int PaPulseAudio_CheckConnection (PaPulseAudio_HostApiRepresentation *ptr)
 
void PaPulseAudio_CheckContextStateCb (pa_context *c, void *userdata)
 
void PaPulseAudio_ServerInfoCb (pa_context *c, const pa_server_info *i, void *userdata)
 
void PaPulseAudio_SinkListCb (pa_context *c, const pa_sink_info *l, int eol, void *userdata)
 
void PaPulseAudio_SourceListCb (pa_context *c, const pa_source_info *l, int eol, void *userdata)
 
void PaPulseAudio_StreamStateCb (pa_stream *s, void *userdata)
 
void PaPulseAudio_StreamStartedCb (pa_stream *s, void *userdata)
 
void PaPulseAudio_StreamUnderflowCb (pa_stream *s, void *userdata)
 
PaError PaPulseAudio_ConvertPortaudioFormatToPaPulseAudio_ (PaSampleFormat portaudiosf, pa_sample_spec *pulseaudiosf)
 

Macro Definition Documentation

#define PA_PULSEAUDIO_DEFAULT_MAX_LATENCY   0.080
#define PA_PULSEAUDIO_DEFAULT_MIN_LATENCY   0.010
#define PA_PULSEAUDIO_IS_ERROR (   pastream,
  errorCode 
)
Value:
if( !(pastream) || \
!(pastream)->context || \
!PA_CONTEXT_IS_GOOD( pa_context_get_state( (pastream)->context ) ) || \
( (pastream)->outputStream && \
!PA_STREAM_IS_GOOD( pa_stream_get_state( (pastream)->outputStream ) ) ) || \
( (pastream)->inputStream && \
!PA_STREAM_IS_GOOD( pa_stream_get_state( (pastream)->inputStream ) ) ) ) \
{ \
if( !(pastream) || \
( (pastream)->context && \
pa_context_get_state( (pastream)->context ) == PA_CONTEXT_FAILED ) || \
( (pastream)->outputStream && \
pa_stream_get_state( (pastream)->outputStream ) == PA_STREAM_FAILED ) || \
( (pastream)->inputStream && \
pa_stream_get_state( (pastream)->inputStream ) == PA_STREAM_FAILED ) ) \
{ \
return errorCode; \
} \
} \
if( !(pastream)->isActive || (pastream)->isStopped ) \
{ \
}
Definition: portaudio.h:144

Referenced by PaPulseAudio_ReadStreamBlock(), and PaPulseAudio_WriteStreamBlock().

#define PA_PULSEAUDIO_SET_LAST_HOST_ERROR (   errorCode,
  errorText 
)    PaUtil_SetLastHostErrorInfo(paInDevelopment, errorCode, errorText)
#define PAPULSEAUDIO_FRAMESPERBUFFERUNSPEC   32

Referenced by OpenStream().

#define PAPULSEAUDIO_MAX_DEVICECOUNT   1024
#define PAPULSEAUDIO_MAX_DEVICENAME   1024
#define PULSEAUDIO_BUFFER_SIZE   (96100 * 4 * 2)

Typedef Documentation

Function Documentation

double GetStreamCpuLoad ( PaStream stream)
PaTime GetStreamTime ( PaStream stream)
PaError IsFormatSupported ( struct PaUtilHostApiRepresentation hostApi,
const PaStreamParameters inputParameters,
const PaStreamParameters outputParameters,
double  sampleRate 
)
PaError IsStreamActive ( PaStream stream)
PaError IsStreamStopped ( PaStream s)
PaError OpenStream ( struct PaUtilHostApiRepresentation hostApi,
PaStream **  s,
const PaStreamParameters inputParameters,
const PaStreamParameters outputParameters,
double  sampleRate,
unsigned long  framesPerBuffer,
PaStreamFlags  streamFlags,
PaStreamCallback streamCallback,
void *  userData 
)

References PaPulseAudio_HostApiRepresentation::blockingStreamInterface, PaPulseAudio_Stream::bufferProcessor, PaPulseAudio_HostApiRepresentation::callbackStreamInterface, PaStreamParameters::channelCount, PaPulseAudio_HostApiRepresentation::context, PaPulseAudio_Stream::context, PaPulseAudio_Stream::cpuLoadMeasurer, PaStreamParameters::device, PaUtilHostApiRepresentation::deviceInfos, PaPulseAudio_Stream::framesPerHostCallback, PaPulseAudio_Stream::hostapi, PaStreamParameters::hostApiSpecificStreamInfo, PaPulseAudio_Stream::inputChannelCount, PaPulseAudio_Stream::inputDevice, PaPulseAudio_Stream::inputFrameSize, PaStreamInfo::inputLatency, PaPulseAudio_Stream::inputRing, PaPulseAudio_Stream::inputSampleSpec, PaPulseAudio_Stream::inputStream, PaPulseAudio_Stream::inputStreamName, PaPulseAudio_Stream::isActive, PaPulseAudio_Stream::isStopped, PaPulseAudio_HostApiRepresentation::mainloop, PaPulseAudio_Stream::mainloop, PaPulseAudio_Stream::maxFramesHostPerBuffer, PaPulseAudio_Stream::maxFramesPerBuffer, PaDeviceInfo::maxInputChannels, PaDeviceInfo::maxOutputChannels, OpenStream(), PaPulseAudio_Stream::outputChannelCount, PaPulseAudio_Stream::outputDevice, PaPulseAudio_Stream::outputFrameSize, PaStreamInfo::outputLatency, PaPulseAudio_Stream::outputSampleSpec, PaPulseAudio_Stream::outputStream, PaPulseAudio_Stream::outputStreamName, PA_DEBUG, Pa_GetSampleSize(), paFloat32, paFramesPerBufferUnspecified, paIncompatibleHostApiSpecificStreamInfo, paInsufficientMemory, paInvalidChannelCount, paInvalidDevice, paInvalidFlag, paNoError, paPlatformSpecificFlags, PaPulseAudio_BlockingInitRingBuffer(), PaPulseAudio_ConvertPortaudioFormatToPaPulseAudio_(), PAPULSEAUDIO_FRAMESPERBUFFERUNSPEC, PaPulseAudio_Lock(), PaPulseAudio_StreamStartedCb(), PaPulseAudio_StreamStateCb(), PaPulseAudio_StreamUnderflowCb(), PaPulseAudio_UnLock(), paUnanticipatedHostError, paUseHostApiSpecificDeviceSpecification, PaUtil_AllocateZeroInitializedMemory(), PaUtil_FreeMemory(), PaUtil_GetBufferProcessorInputLatencyFrames(), PaUtil_GetBufferProcessorOutputLatencyFrames(), PaUtil_InitializeBufferProcessor(), PaUtil_InitializeCpuLoadMeasurer(), PaUtil_InitializeStreamRepresentation(), PaUtil_SelectClosestAvailableFormat(), paUtilUnknownHostBufferSize, PaPulseAudio_Stream::pulseaudioIsActive, PaPulseAudio_Stream::pulseaudioIsStopped, PaStreamParameters::sampleFormat, PaStreamInfo::sampleRate, PaUtilStreamRepresentation::streamInfo, PaPulseAudio_Stream::streamRepresentation, PaStreamParameters::suggestedLatency, and PaPulseAudio_Stream::suggestedLatencyUSecs.

Referenced by OpenStream(), PaPulseAudio_Initialize(), PaSndio_Initialize(), PaWasapi_Initialize(), PaWinMme_Initialize(), and PaWinWdm_Initialize().

int PaPulseAudio_CheckConnection ( PaPulseAudio_HostApiRepresentation ptr)
void PaPulseAudio_CheckContextStateCb ( pa_context *  c,
void *  userdata 
)
PaError PaPulseAudio_ConvertPortaudioFormatToPaPulseAudio_ ( PaSampleFormat  portaudiosf,
pa_sample_spec *  pulseaudiosf 
)
void PaPulseAudio_Free ( PaPulseAudio_HostApiRepresentation ptr)
PaError PaPulseAudio_Initialize ( PaUtilHostApiRepresentation **  hostApi,
PaHostApiIndex  index 
)
void PaPulseAudio_Lock ( pa_threaded_mainloop *  mainloop)
PaPulseAudio_HostApiRepresentation* PaPulseAudio_New ( void  )
void PaPulseAudio_ReleaseOperation ( PaPulseAudio_HostApiRepresentation hostapi,
pa_operation **  pulseaudioOperation 
)
void PaPulseAudio_ServerInfoCb ( pa_context *  c,
const pa_server_info *  i,
void *  userdata 
)
void PaPulseAudio_SinkListCb ( pa_context *  c,
const pa_sink_info *  l,
int  eol,
void *  userdata 
)
void PaPulseAudio_SourceListCb ( pa_context *  c,
const pa_source_info *  l,
int  eol,
void *  userdata 
)
void PaPulseAudio_StreamStartedCb ( pa_stream *  s,
void *  userdata 
)

References PaPulseAudio_Stream::mainloop.

Referenced by OpenStream().

void PaPulseAudio_StreamStateCb ( pa_stream *  s,
void *  userdata 
)

References PA_DEBUG, and PA_PULSEAUDIO_SET_LAST_HOST_ERROR.

Referenced by OpenStream().

void PaPulseAudio_StreamUnderflowCb ( pa_stream *  s,
void *  userdata 
)
void PaPulseAudio_UnLock ( pa_threaded_mainloop *  mainloop)
void Terminate ( struct PaUtilHostApiRepresentation hostApi)