当前位置: 首页>>代码示例>>C++>>正文


C++ CAStreamBasicDescription::IsInterleaved方法代码示例

本文整理汇总了C++中CAStreamBasicDescription::IsInterleaved方法的典型用法代码示例。如果您正苦于以下问题:C++ CAStreamBasicDescription::IsInterleaved方法的具体用法?C++ CAStreamBasicDescription::IsInterleaved怎么用?C++ CAStreamBasicDescription::IsInterleaved使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAStreamBasicDescription的用法示例。


在下文中一共展示了CAStreamBasicDescription::IsInterleaved方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sizeof

void				AUBufferList::Allocate(const CAStreamBasicDescription &format, UInt32 nFrames)
{
	UInt32 nStreams;
	if (format.IsInterleaved()) {
		nStreams = 1;
	} else {
		nStreams = format.mChannelsPerFrame;
	}

	// careful -- the I/O thread could be running!
	if (nStreams > mAllocatedStreams) {
		size_t theHeaderSize = sizeof(AudioBufferList) - sizeof(AudioBuffer);
		mPtrs = (AudioBufferList *)CA_realloc(mPtrs,
									SafeMultiplyAddUInt32(nStreams, sizeof(AudioBuffer), theHeaderSize));
		mAllocatedStreams = nStreams;
	}
	UInt32 bytesPerStream = SafeMultiplyAddUInt32(nFrames, format.mBytesPerFrame, 0xF) & ~0xF;
	UInt32 nBytes = SafeMultiplyAddUInt32(nStreams, bytesPerStream, 0);
	if (nBytes > mAllocatedBytes) {
		if (mExternalMemory) {
			mExternalMemory = false;
			mMemory = NULL;
		}
		mMemory = (Byte *)CA_realloc(mMemory, nBytes);
		mAllocatedBytes = nBytes;
	}
	mAllocatedFrames = nFrames;
	mPtrState = kPtrsInvalid;
}
开发者ID:63n,项目名称:ardour,代码行数:29,代码来源:AUBuffer.cpp

示例2: offsetof

void				AUBufferList::Allocate(const CAStreamBasicDescription &format, UInt32 nFrames)
{
	UInt32 nStreams;
	UInt32 channelsPerStream;
	if (format.IsInterleaved()) {
		nStreams = 1;
		channelsPerStream = format.mChannelsPerFrame;
	} else {
		nStreams = format.mChannelsPerFrame;
		channelsPerStream = 1;
	}

	// careful -- the I/O thread could be running!
	if (nStreams > mAllocatedStreams) {
		mPtrs = (AudioBufferList *)CA_realloc(mPtrs, offsetof(AudioBufferList, mBuffers) + nStreams * sizeof(AudioBuffer));
		mAllocatedStreams = nStreams;
	}
	UInt32 bytesPerStream = (nFrames * format.mBytesPerFrame + 0xF) & ~0xF;
	UInt32 nBytes = nStreams * bytesPerStream;	
	if (nBytes > mAllocatedBytes) {
		if (mExternalMemory) {
			mExternalMemory = false;
			mMemory = NULL;
		}
		mMemory = (Byte *)CA_realloc(mMemory, nBytes);
		mAllocatedBytes = nBytes;
	}
	mAllocatedFrames = nFrames;
	mPtrState = kPtrsInvalid;
}
开发者ID:EQ4,项目名称:JamomaMax,代码行数:30,代码来源:AUBuffer.cpp

示例3: GetFormat

OSStatus	CAAudioUnit::SetNumberChannels (AudioUnitScope	inScope,
										AudioUnitElement	inEl,
										UInt32				inChans)
{
			// set this as the output of the AU
	CAStreamBasicDescription desc;
	OSStatus result = GetFormat (inScope, inEl, desc);
		if (result) return result;
	desc.SetCanonical (inChans, desc.IsInterleaved());
	result = SetFormat (inScope, inEl, desc);
	return result;
}
开发者ID:63n,项目名称:ardour,代码行数:12,代码来源:CAAudioUnit.cpp


注:本文中的CAStreamBasicDescription::IsInterleaved方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。