类别:BufferProcessor
缓冲区处理器
类型 | 使用 | 成员 | 说明 |
建构子 | public | ||
解构子 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
资料 | public | ||
函式 | public | int inputChannelCount , CaSampleFormat userInputSampleFormat , CaSampleFormat hostInputSampleFormat , int outputChannelCount , CaSampleFormat userOutputSampleFormat , CaSampleFormat hostOutputSampleFormat , double sampleRate , CaStreamFlags streamFlags , CaUint32 framesPerUserBuffer , CaUint32 framesPerHostBuffer , CaHostBufferSizeMode hostBufferSizeMode , Conduit * conduit ) |
|
函式 | public | ||
函式 | public | ||
函式 | public | ||
函式 | public | ||
函式 | public | ||
函式 | public | ||
函式 | public | ||
函式 | public | ||
函式 | public | CaUint32 frameCount) |
|
函式 | public | CaUint32 channel, void * data , CaUint32 stride) |
|
函式 | public | int index , CaUint32 firstChannel , void * data , CaUint32 channelCount ) |
|
函式 | public | int index , CaUint32 channel , void * data ) |
|
函式 | public | ||
函式 | public | CaUint32 frameCount ) |
|
函式 | public | CaUint32 channel , void * data , CaUint32 stride ) |
|
函式 | public | int index , CaUint32 firstChannel , void * data , CaUint32 channelCount ) |
|
函式 | public | int index , CaUint32 channel , void * data ) |
|
函式 | public | CaUint32 frameCount ) |
|
函式 | public | CaUint32 frameCount ) |
|
函式 | public | ||
函式 | protected | ||
函式 | protected | ||
函式 | protected | ||
函式 | protected | ||
函式 | private | ||
函式 | private | CaChannelDescriptor * hic , CaChannelDescriptor * hoc , CaUint32 framesToProcess ) |
|
函式 | private | CaChannelDescriptor * hostInputChannels , CaUint32 framesToProcess ) |
|
函式 | private | CaChannelDescriptor * hostOutputChannels , CaUint32 framesToProcess ) |
|
函式 | private | int processPartialUserBuffers ) |
建议
外部程序不应使用这个类别,这是供应音讯底层的缓冲区处理器。C/C++定义
class BufferProcessor
{
public:
CaUint32 framesPerUserBuffer ;
CaUint32 framesPerHostBuffer ;
CaHostBufferSizeMode hostBufferSizeMode ;
int useNonAdaptingProcess ;
int userOutputSampleFormatIsEqualToHost ;
int userInputSampleFormatIsEqualToHost ;
CaUint32 framesPerTempBuffer ;
CaUint32 inputChannelCount ;
CaUint32 bytesPerHostInputSample ;
CaUint32 bytesPerUserInputSample ;
int userInputIsInterleaved ;
Converter * inputConverter ;
ZeroCopier * inputZeroer ;
CaUint32 outputChannelCount ;
CaUint32 bytesPerHostOutputSample ;
CaUint32 bytesPerUserOutputSample ;
int userOutputIsInterleaved ;
Converter * outputConverter ;
ZeroCopier * outputZeroer ;
CaUint32 initialFramesInTempInputBuffer ;
CaUint32 initialFramesInTempOutputBuffer ;
void * tempInputBuffer ;
void ** tempInputBufferPtrs ;
CaUint32 framesInTempInputBuffer ;
void * tempOutputBuffer ;
void ** tempOutputBufferPtrs ;
CaUint32 framesInTempOutputBuffer ;
int hostInputIsInterleaved ;
CaUint32 hostInputFrameCount [ 2 ] ;
CaChannelDescriptor * hostInputChannels [ 2 ] ;
int hostOutputIsInterleaved ;
CaUint32 hostOutputFrameCount [ 2 ] ;
CaChannelDescriptor * hostOutputChannels [ 2 ] ;
double samplePeriod ;
Dither dither ;
Conduit * conduit ;
explicit BufferProcessor (void) ;
virtual ~BufferProcessor (void) ;
virtual CaError Initialize (
int inputChannelCount ,
CaSampleFormat userInputSampleFormat ,
CaSampleFormat hostInputSampleFormat ,
int outputChannelCount ,
CaSampleFormat userOutputSampleFormat ,
CaSampleFormat hostOutputSampleFormat ,
double sampleRate ,
CaStreamFlags streamFlags ,
CaUint32 framesPerUserBuffer ,
CaUint32 framesPerHostBuffer ,
CaHostBufferSizeMode hostBufferSizeMode ,
Conduit * conduit ) ;
virtual void Terminate (void) ;
virtual void Reset (void) ;
virtual void Begin (Conduit * conduit) ;
virtual CaUint32 End (int * callbackResult = NULL) ;
virtual CaUint32 InputLatencyFrames (void) ;
virtual CaUint32 OutputLatencyFrames (void) ;
virtual bool isOutputEmpty (void) ;
virtual void setNoInput (void) ;
virtual void setInputFrameCount (int index ,
CaUint32 frameCount ) ;
virtual void setInputChannel (int index ,
CaUint32 channel ,
void * data ,
CaUint32 stride ) ;
virtual void setInterleavedInputChannels (
int index ,
CaUint32 firstChannel ,
void * data ,
CaUint32 channelCount ) ;
virtual void setNonInterleavedInputChannels (
int index ,
CaUint32 channel ,
void * data ) ;
virtual void setNoOutput (void) ;
virtual void setOutputFrameCount (int index ,
CaUint32 frameCount ) ;
virtual void setOutputChannel (int index ,
CaUint32 channel ,
void * data ,
CaUint32 stride ) ;
virtual void setInterleavedOutputChannels (
int index ,
CaUint32 firstChannel ,
void * data ,
CaUint32 channelCount ) ;
virtual void setNonInterleavedOutputChannel (
int index ,
CaUint32 channel ,
void * data ) ;
virtual CaUint32 CopyInput (void ** buffer ,
CaUint32 frameCount ) ;
virtual CaUint32 CopyOutput (const void ** buffer ,
CaUint32 frameCount ) ;
virtual CaUint32 ZeroOutput (CaUint32 frameCount ) ;
protected:
inline void Delete (void * memory)
{
if ( NULL != memory ) Allocator :: free ( memory ) ;
}
/* greatest common divisor - PGCD in French */
inline CaUint32 GCD( CaUint32 a, CaUint32 b )
{
return ( 0 == b ) ? a : GCD ( b , ( a % b ) ) ;
}
/* least common multiple - PPCM in French */
inline CaUint32 LCM( CaUint32 a , CaUint32 b )
{
return ( a * b ) / GCD ( a , b ) ;
}
CaUint32 FrameShift ( CaUint32 M , CaUint32 N ) ;
private:
void TempToHost (void) ;
CaUint32 NonAdapting (int * streamCallbackResult ,
CaChannelDescriptor * hic ,
CaChannelDescriptor * hoc ,
CaUint32 framesToProcess ) ;
CaUint32 AdaptingInputOnly (int * streamCallbackResult ,
CaChannelDescriptor * hostInputChannels ,
CaUint32 framesToProcess ) ;
CaUint32 AdaptingOutputOnly (int * streamCallbackResult ,
CaChannelDescriptor * hostOutputChannels ,
CaUint32 framesToProcess ) ;
CaUint32 Adapting (int * streamCallbackResult ,
int processPartialUserBuffers ) ;
};