Update to portaudio SVN rev 1762

Disable portaudio backend for wdmks (fixes debug build on windows)
This commit is contained in:
Shawn Hoffman 2011-10-23 18:17:50 -07:00
parent 7bac36d455
commit 78832cb4ea
6 changed files with 88 additions and 58 deletions

Binary file not shown.

View File

@ -1,7 +1,7 @@
#ifndef PA_ASIO_H
#define PA_ASIO_H
/*
* $Id: pa_asio.h 1592 2011-02-04 10:41:58Z rossb $
* $Id: pa_asio.h 1667 2011-05-02 15:49:20Z rossb $
* PortAudio Portable Real-Time Audio Library
* ASIO specific extensions
*
@ -52,23 +52,30 @@ extern "C"
#endif /* __cplusplus */
/** Retrieve legal latency settings for the specificed device, in samples.
/** Retrieve legal native buffer sizes for the specificed device, in sample frames.
@param device The global index of the device about which the query is being made.
@param minLatency A pointer to the location which will recieve the minimum latency value.
@param maxLatency A pointer to the location which will recieve the maximum latency value.
@param preferredLatency A pointer to the location which will recieve the preferred latency value.
@param granularity A pointer to the location which will recieve the granularity. This value
determines which values between minLatency and maxLatency are available. ie the step size,
if granularity is -1 then available latency settings are powers of two.
@param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
@param maxBufferSizeFrames A pointer to the location which will receive the maximum buffer size value.
@param preferredBufferSizeFrames A pointer to the location which will receive the preferred buffer size value.
@param granularity A pointer to the location which will receive the "granularity". This value determines
the step size used to compute the legal values between minBufferSizeFrames and maxBufferSizeFrames.
If granularity is -1 then available buffer size values are powers of two.
@see ASIOGetBufferSize in the ASIO SDK.
@todo This function should be renamed to PaAsio_GetAvailableBufferSizes.
No reason to use a wildly different name from the ASIO version.
@note: this function used to be called PaAsio_GetAvailableLatencyValues. There is a
#define that maps PaAsio_GetAvailableLatencyValues to this function for backwards compatibility.
*/
PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device,
long *minLatency, long *maxLatency, long *preferredLatency, long *granularity );
PaError PaAsio_GetAvailableBufferSizes( PaDeviceIndex device,
long *minBufferSizeFrames, long *maxBufferSizeFrames, long *preferredBufferSizeFrames, long *granularity );
/** Backwards compatibility alias for PaAsio_GetAvailableBufferSizes
@see PaAsio_GetAvailableBufferSizes
*/
#define PaAsio_GetAvailableLatencyValues PaAsio_GetAvailableBufferSizes
/** Display the ASIO control panel for the specified device.

View File

@ -53,7 +53,7 @@ extern "C" {
#endif
/*
/**
* A pointer to a paMacCoreStreamInfo may be passed as
* the hostApiSpecificStreamInfo in the PaStreamParameters struct
* when opening a stream or querying the format. Use NULL, for the
@ -65,17 +65,17 @@ typedef struct
unsigned long size; /**size of whole structure including this header */
PaHostApiTypeId hostApiType; /**host API for which this data is intended */
unsigned long version; /**structure version */
unsigned long flags; /* flags to modify behaviour */
SInt32 const * channelMap; /* Channel map for HAL channel mapping , if not needed, use NULL;*/
unsigned long channelMapSize; /* Channel map size for HAL channel mapping , if not needed, use 0;*/
unsigned long flags; /** flags to modify behaviour */
SInt32 const * channelMap; /** Channel map for HAL channel mapping , if not needed, use NULL;*/
unsigned long channelMapSize; /** Channel map size for HAL channel mapping , if not needed, use 0;*/
} PaMacCoreStreamInfo;
/*
/**
* Functions
*/
/* Use this function to initialize a paMacCoreStreamInfo struct
/** Use this function to initialize a paMacCoreStreamInfo struct
* using the requested flags. Note that channel mapping is turned
* off after a call to this function.
* @param data The datastructure to initialize
@ -83,14 +83,14 @@ typedef struct
*/
void PaMacCore_SetupStreamInfo( PaMacCoreStreamInfo *data, unsigned long flags );
/* call this after pa_SetupMacCoreStreamInfo to use channel mapping as described in notes.txt.
/** call this after pa_SetupMacCoreStreamInfo to use channel mapping as described in notes.txt.
* @param data The stream info structure to assign a channel mapping to
* @param channelMap The channel map array, as described in notes.txt. This array pointer will be used directly (ie the underlying data will not be copied), so the caller should not free the array until after the stream has been opened.
* @param channelMapSize The size of the channel map array.
*/
void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const SInt32 * const channelMap, unsigned long channelMapSize );
/*
/**
* Retrieve the AudioDeviceID of the input device assigned to an open stream
*
* @param s The stream to query.
@ -99,7 +99,7 @@ void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const SInt32 * const
*/
AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s );
/*
/**
* Retrieve the AudioDeviceID of the output device assigned to an open stream
*
* @param s The stream to query.
@ -108,7 +108,7 @@ AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s );
*/
AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s );
/*
/**
* Returns a statically allocated string with the device's name
* for the given channel. NULL will be returned on failure.
*
@ -124,28 +124,28 @@ AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s );
*/
const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input );
/*
/**
* Flags
*/
/*
/**
* The following flags alter the behaviour of PA on the mac platform.
* they can be ORed together. These should work both for opening and
* checking a device.
*/
/* Allows PortAudio to change things like the device's frame size,
/** Allows PortAudio to change things like the device's frame size,
* which allows for much lower latency, but might disrupt the device
* if other programs are using it, even when you are just Querying
* the device. */
#define paMacCoreChangeDeviceParameters (0x01)
/* In combination with the above flag,
/** In combination with the above flag,
* causes the stream opening to fail, unless the exact sample rates
* are supported by the device. */
#define paMacCoreFailIfConversionRequired (0x02)
/* These flags set the SR conversion quality, if required. The wierd ordering
/** These flags set the SR conversion quality, if required. The wierd ordering
* allows Maximum Quality to be the default.*/
#define paMacCoreConversionQualityMin (0x0100)
#define paMacCoreConversionQualityMedium (0x0200)
@ -153,26 +153,26 @@ const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input )
#define paMacCoreConversionQualityHigh (0x0400)
#define paMacCoreConversionQualityMax (0x0000)
/*
/**
* Here are some "preset" combinations of flags (above) to get to some
* common configurations. THIS IS OVERKILL, but if more flags are added
* it won't be.
*/
/*This is the default setting: do as much sample rate conversion as possible
/**This is the default setting: do as much sample rate conversion as possible
* and as little mucking with the device as possible. */
#define paMacCorePlayNice (0x00)
/*This setting is tuned for pro audio apps. It allows SR conversion on input
/**This setting is tuned for pro audio apps. It allows SR conversion on input
and output, but it tries to set the appropriate SR on the device.*/
#define paMacCorePro (0x01)
/*This is a setting to minimize CPU usage and still play nice.*/
/**This is a setting to minimize CPU usage and still play nice.*/
#define paMacCoreMinimizeCPUButPlayNice (0x0100)
/*This is a setting to minimize CPU usage, even if that means interrupting the device. */
/**This is a setting to minimize CPU usage, even if that means interrupting the device. */
#define paMacCoreMinimizeCPU (0x0101)
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /** __cplusplus */
#endif /* PA_MAC_CORE_H */
#endif /** PA_MAC_CORE_H */

View File

@ -59,15 +59,14 @@ extern "C"
typedef struct PaWinDirectSoundStreamInfo{
unsigned long size; /**< sizeof(PaWinDirectSoundStreamInfo) */
PaHostApiTypeId hostApiType; /**< paDirectSound */
unsigned long version; /**< 1 */
unsigned long version; /**< 2 */
unsigned long flags;
/* low-level latency setting support
TODO ** NOT IMPLEMENTED **
These settings control the number and size of host buffers in order
to set latency. They will be used instead of the generic parameters
to Pa_OpenStream() if flags contains the paWinDirectSoundUseLowLevelLatencyParameters
Control the size of host buffers in order to set latency. They will
be used instead of the generic parameters to Pa_OpenStream() if
flags contains the paWinDirectSoundUseLowLevelLatencyParameters
flag.
If PaWinDirectSoundStreamInfo structures with paWinDirectSoundUseLowLevelLatencyParameters
@ -76,9 +75,8 @@ typedef struct PaWinDirectSoundStreamInfo{
two must be a multiple of the smaller, otherwise a
paIncompatibleHostApiSpecificStreamInfo error will be returned from
Pa_OpenStream().
unsigned long framesPerBuffer;
*/
unsigned long framesPerBuffer; /* NOT IMPLEMENTED see http://www.portaudio.com/trac/ticket/129 */
/*
support for WAVEFORMATEXTENSIBLE channel masks. If flags contains

View File

@ -1,7 +1,7 @@
#ifndef PORTAUDIO_H
#define PORTAUDIO_H
/*
* $Id: portaudio.h 1594 2011-02-05 14:33:29Z rossb $
* $Id: portaudio.h 1745 2011-08-25 17:44:01Z rossb $
* PortAudio Portable Real-Time Audio Library
* PortAudio API Header File
* Latest version available at: http://www.portaudio.com/
@ -450,15 +450,15 @@ typedef struct PaDeviceInfo
{
int structVersion; /* this is struct version 2 */
const char *name;
PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/
PaHostApiIndex hostApi; /**< note this is a host API index, not a type id*/
int maxInputChannels;
int maxOutputChannels;
/* Default latency values for interactive performance. */
/** Default latency values for interactive performance. */
PaTime defaultLowInputLatency;
PaTime defaultLowOutputLatency;
/* Default latency values for robust non-interactive applications (eg. playing sound files). */
/** Default latency values for robust non-interactive applications (eg. playing sound files). */
PaTime defaultHighInputLatency;
PaTime defaultHighOutputLatency;
@ -640,11 +640,15 @@ typedef unsigned long PaStreamFlags;
/**
Timing information for the buffers passed to the stream callback.
Time values are expressed in seconds and are synchronised with the time base used by Pa_GetStreamTime() for the associated stream.
@see PaStreamCallback, Pa_GetStreamTime
*/
typedef struct PaStreamCallbackTimeInfo{
PaTime inputBufferAdcTime;
PaTime currentTime;
PaTime outputBufferDacTime;
PaTime inputBufferAdcTime; /**< The time when the first sample of the input buffer was captured at the ADC input */
PaTime currentTime; /**< The time when the stream callback was invoked */
PaTime outputBufferDacTime; /**< The time when the first sample of the output buffer will output the DAC */
} PaStreamCallbackTimeInfo;
@ -697,9 +701,9 @@ typedef unsigned long PaStreamCallbackFlags;
*/
typedef enum PaStreamCallbackResult
{
paContinue=0,
paComplete=1,
paAbort=2
paContinue=0, /**< Signal that the stream should continue invoking the callback and processing audio. */
paComplete=1, /**< Signal that the stream should stop invoking the callback and finish once all output samples have played. */
paAbort=2 /**< Signal that the stream should stop invoking the callback and finish as soon as possible. */
} PaStreamCallbackResult;
@ -708,6 +712,28 @@ typedef enum PaStreamCallbackResult
They consume, process or generate audio in response to requests from an
active PortAudio stream.
When a stream is running, PortAudio calls the stream callback periodically.
The callback function is responsible for processing buffers of audio samples
passed via the input and output parameters.
The PortAudio stream callback runs at very high or real-time priority.
It is required to consistently meet its time deadlines. Do not allocate
memory, access the file system, call library functions or call other functions
from the stream callback that may block or take an unpredictable amount of
time to complete.
In order for a stream to maintain glitch-free operation the callback
must consume and return audio data faster than it is recorded and/or
played. PortAudio anticipates that each callback invocation may execute for
a duration approaching the duration of frameCount audio frames at the stream
sample rate. It is reasonable to expect to be able to utilise 70% or more of
the available CPU time in the PortAudio callback. However, due to buffer size
adaption and other factors, not all host APIs are able to guarantee audio
stability under heavy CPU load with arbitrary fixed callback buffer sizes.
When high callback CPU utilisation is required the most robust behavior
can be achieved by using paFramesPerBufferUnspecified as the
Pa_OpenStream() framesPerBuffer parameter.
@param input and @param output are either arrays of interleaved samples or;
if non-interleaved samples were requested using the paNonInterleaved sample
format flag, an array of buffer pointers, one non-interleaved buffer for
@ -719,11 +745,10 @@ typedef enum PaStreamCallbackResult
@param frameCount The number of sample frames to be processed by
the stream callback.
@param timeInfo The time in seconds when the first sample of the input
buffer was received at the audio input, the time in seconds when the first
sample of the output buffer will begin being played at the audio output, and
the time in seconds when the stream callback was called.
See also Pa_GetStreamTime()
@param timeInfo Timestamps indicating the ADC capture time of the first sample
in the input buffer, the DAC output time of the first sample in the output buffer
and the time the callback was invoked.
See PaStreamCallbackTimeInfo and Pa_GetStreamTime()
@param statusFlags Flags indicating whether input and/or output buffers
have been inserted or will be dropped to overcome underflow or overflow
@ -734,7 +759,7 @@ typedef enum PaStreamCallbackResult
@return
The stream callback should return one of the values in the
PaStreamCallbackResult enumeration. To ensure that the callback continues
::PaStreamCallbackResult enumeration. To ensure that the callback continues
to be called, it should return paContinue (0). Either paComplete or paAbort
can be returned to finish stream processing, after either of these values is
returned the callback will not be called again. If paAbort is returned the

Binary file not shown.