本文整理汇总了C++中PaUtil_FreeMemory函数的典型用法代码示例。如果您正苦于以下问题:C++ PaUtil_FreeMemory函数的具体用法?C++ PaUtil_FreeMemory怎么用?C++ PaUtil_FreeMemory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PaUtil_FreeMemory函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PaUtil_DiscardHighSpeedLog
void PaUtil_DiscardHighSpeedLog( LogHandle hLog )
{
PaHighPerformanceLog* pLog = (PaHighPerformanceLog*)hLog;
assert(pLog->magik == kMagik);
PaUtil_FreeMemory(pLog->data);
PaUtil_FreeMemory(pLog);
}
开发者ID:AFilli,项目名称:Second-Law,代码行数:7,代码来源:pa_trace.c
示例2: PaUtil_DestroyAllocationGroup
void PaUtil_DestroyAllocationGroup( PaUtilAllocationGroup* group )
{
struct PaUtilAllocationGroupLink *current = group->linkBlocks;
struct PaUtilAllocationGroupLink *next;
while( current )
{
next = current->next;
PaUtil_FreeMemory( current->buffer );
current = next;
}
PaUtil_FreeMemory( group );
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:14,代码来源:pa_allocation.c
示例3: PaUtil_CreateAllocationGroup
PaUtilAllocationGroup* PaUtil_CreateAllocationGroup( void )
{
PaUtilAllocationGroup* result = 0;
struct PaUtilAllocationGroupLink *links;
links = AllocateLinks( PA_INITIAL_LINK_COUNT_, 0, 0 );
if( links != 0 )
{
result = (PaUtilAllocationGroup*)PaUtil_AllocateMemory( sizeof(PaUtilAllocationGroup) );
if( result )
{
result->linkCount = PA_INITIAL_LINK_COUNT_;
result->linkBlocks = &links[0];
result->spareLinks = &links[1];
result->allocations = 0;
}
else
{
PaUtil_FreeMemory( links );
}
}
return result;
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:25,代码来源:pa_allocation.c
示例4: AudioInputProc
// This is not for input-only streams, this is for streams where the input device is different from the output device
static OSStatus AudioInputProc( AudioDeviceID inDevice,
const AudioTimeStamp* inNow,
const AudioBufferList* inInputData,
const AudioTimeStamp* inInputTime,
AudioBufferList* outOutputData,
const AudioTimeStamp* inOutputTime,
void* inClientData)
{
PaMacClientData *clientData = (PaMacClientData *)inClientData;
PaStreamCallbackTimeInfo *timeInfo = InitializeTimeInfo(inNow, inInputTime, inOutputTime);
PaUtil_BeginCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer );
AudioBuffer const *inputBuffer = &inInputData->mBuffers[0];
unsigned long frameCount = inputBuffer->mDataByteSize / (inputBuffer->mNumberChannels * sizeof(Float32));
CopyInputData(clientData, inInputData, frameCount);
PaStreamCallbackResult result = clientData->callback(clientData->inputBuffer, clientData->outputBuffer, frameCount, timeInfo, paNoFlag, clientData->userData);
PaUtil_EndCpuLoadMeasurement( &clientData->stream->cpuLoadMeasurer, frameCount );
if( result == paComplete || result == paAbort )
Pa_StopStream(clientData->stream);
PaUtil_FreeMemory( timeInfo );
return noErr;
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:26,代码来源:pa_mac_core_old.c
示例5: PaUtil_GroupFreeMemory
void PaUtil_GroupFreeMemory( PaUtilAllocationGroup* group, void *buffer )
{
struct PaUtilAllocationGroupLink *current = group->allocations;
struct PaUtilAllocationGroupLink *previous = 0;
if( buffer == 0 )
return;
/* find the right link and remove it */
while( current )
{
if( current->buffer == buffer )
{
if( previous )
{
previous->next = current->next;
}
else
{
group->allocations = current->next;
}
current->buffer = 0;
current->next = group->spareLinks;
group->spareLinks = current;
break;
}
previous = current;
current = current->next;
}
PaUtil_FreeMemory( buffer ); /* free the memory whether we found it in the list or not */
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:35,代码来源:pa_allocation.c
示例6: KSFilterPinPropertyIdentifiersInclude
static int KSFilterPinPropertyIdentifiersInclude(
HANDLE deviceHandle, int pinId, unsigned long property, const GUID *identifierSet, unsigned long identifierId )
{
KSMULTIPLE_ITEM* item = NULL;
KSIDENTIFIER* identifier;
int i;
int result = 0;
if( WdmGetPinPropertyMulti( deviceHandle, pinId, property, &item) != paNoError )
return 0;
identifier = (KSIDENTIFIER*)(item+1);
for( i = 0; i < (int)item->Count; i++ )
{
if( !memcmp( (void*)&identifier[i].Set, (void*)identifierSet, sizeof( GUID ) ) &&
( identifier[i].Id == identifierId ) )
{
result = 1;
break;
}
}
PaUtil_FreeMemory( item );
return result;
}
开发者ID:0K7mGXj9thSA,项目名称:testrepositoryforjulius,代码行数:27,代码来源:pa_win_wdmks_utils.c
示例7: Terminate
static void
Terminate(struct PaUtilHostApiRepresentation *hostApi)
{
PaSndioHostApiRepresentation *sndioHostApi;
sndioHostApi = (PaSndioHostApiRepresentation *)hostApi;
free(sndioHostApi->audiodevices);
PaUtil_FreeMemory(hostApi);
}
开发者ID:netzbasis,项目名称:openbsd-ports,代码行数:8,代码来源:pa_sndio.c
示例8: CloseStream
/*
When CloseStream() is called, the multi-api layer ensures that
the stream has already been stopped or aborted.
*/
static PaError CloseStream( PaStream* s )
{
PaError result = paNoError;
PaJackStream *stream = (PaJackStream*)s;
PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation );
PaUtil_FreeMemory( stream );
return result;
}
开发者ID:andreipaga,项目名称:audacity,代码行数:14,代码来源:pa_jack.c
示例9: CleanUp
static void CleanUp(PaMacCoreHostApiRepresentation *macCoreHostApi)
{
if( macCoreHostApi->allocations )
{
PaUtil_FreeAllAllocations( macCoreHostApi->allocations );
PaUtil_DestroyAllocationGroup( macCoreHostApi->allocations );
}
PaUtil_FreeMemory( macCoreHostApi );
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:10,代码来源:pa_mac_core_old.c
示例10: Terminate
static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
{
PaJackHostApiRepresentation *jackHostApi = (PaJackHostApiRepresentation*)hostApi;
jack_client_close( jackHostApi->jack_client );
if( jackHostApi->deviceInfoMemory )
{
PaUtil_FreeAllAllocations( jackHostApi->deviceInfoMemory );
PaUtil_DestroyAllocationGroup( jackHostApi->deviceInfoMemory );
}
PaUtil_FreeMemory( jackHostApi );
}
开发者ID:andreipaga,项目名称:audacity,代码行数:14,代码来源:pa_jack.c
示例11: CloseStream
/*
When CloseStream() is called, the multi-api layer ensures that
the stream has already been stopped or aborted.
*/
static PaError CloseStream( PaStream* s )
{
PaError result = paNoError;
PaSkeletonStream *stream = (PaSkeletonStream*)s;
/*
IMPLEMENT ME:
- additional stream closing + cleanup
*/
PaUtil_TerminateBufferProcessor( &stream->bufferProcessor );
PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation );
PaUtil_FreeMemory( stream );
return result;
}
开发者ID:Excalibur201010,项目名称:sharpsdr,代码行数:20,代码来源:pa_skeleton.c
示例12: Terminate
static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
{
PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi;
/*
IMPLEMENT ME:
- clean up any resourced not handled by the allocation group
*/
if( skeletonHostApi->allocations )
{
PaUtil_FreeAllAllocations( skeletonHostApi->allocations );
PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations );
}
PaUtil_FreeMemory( skeletonHostApi );
}
开发者ID:Excalibur201010,项目名称:sharpsdr,代码行数:17,代码来源:pa_skeleton.c
示例13: CheckFormat
static OSStatus CheckFormat(AudioDeviceID macCoreDeviceId, const PaStreamParameters *parameters, double sampleRate, int isInput)
{
UInt32 propSize = sizeof(AudioStreamBasicDescription);
AudioStreamBasicDescription *streamDescription = PaUtil_AllocateMemory(propSize);
streamDescription->mSampleRate = sampleRate;
streamDescription->mFormatID = 0;
streamDescription->mFormatFlags = 0;
streamDescription->mBytesPerPacket = 0;
streamDescription->mFramesPerPacket = 0;
streamDescription->mBytesPerFrame = 0;
streamDescription->mChannelsPerFrame = 0;
streamDescription->mBitsPerChannel = 0;
streamDescription->mReserved = 0;
OSStatus result = AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamFormatSupported, &propSize, streamDescription);
PaUtil_FreeMemory(streamDescription);
return result;
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:19,代码来源:pa_mac_core_old.c
示例14: GetStreamTime
static PaTime GetStreamTime( PaStream *s )
{
OSStatus err;
PaTime result;
PaMacCoreStream *stream = (PaMacCoreStream*)s;
AudioTimeStamp *timeStamp = PaUtil_AllocateMemory(sizeof(AudioTimeStamp));
if (stream->inputDevice != kAudioDeviceUnknown) {
err = AudioDeviceGetCurrentTime(stream->inputDevice, timeStamp);
}
else {
err = AudioDeviceGetCurrentTime(stream->outputDevice, timeStamp);
}
result = err ? 0 : timeStamp->mSampleTime;
PaUtil_FreeMemory(timeStamp);
return result;
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:19,代码来源:pa_mac_core_old.c
示例15: CloseStream
static PaError
CloseStream(PaStream *stream)
{
PaSndioStream *s = (PaSndioStream *)stream;
DPR("CloseStream:\n");
if (!s->stopped)
StopStream(stream);
if (s->mode & SIO_REC)
free(s->rbuf);
if (s->mode & SIO_PLAY)
free(s->wbuf);
sio_close(s->hdl);
PaUtil_TerminateStreamRepresentation(&s->base);
PaUtil_TerminateBufferProcessor(&s->bufproc);
PaUtil_FreeMemory(s);
return paNoError;
}
开发者ID:Bluerise,项目名称:bitrig-ports,代码行数:20,代码来源:pa_sndio.c
示例16: PaUtil_InitializeHighSpeedLog
int PaUtil_InitializeHighSpeedLog( LogHandle* phLog, unsigned maxSizeInBytes )
{
PaHighPerformanceLog* pLog = (PaHighPerformanceLog*)PaUtil_AllocateMemory(sizeof(PaHighPerformanceLog));
if (pLog == 0)
{
return paInsufficientMemory;
}
assert(phLog != 0);
*phLog = pLog;
pLog->data = (char*)PaUtil_AllocateMemory(maxSizeInBytes);
if (pLog->data == 0)
{
PaUtil_FreeMemory(pLog);
return paInsufficientMemory;
}
pLog->magik = kMagik;
pLog->size = maxSizeInBytes;
pLog->refTime = PaUtil_GetTime();
return paNoError;
}
开发者ID:AFilli,项目名称:Second-Law,代码行数:21,代码来源:pa_trace.c
示例17: GetChannelInfo
static PaError GetChannelInfo(PaDeviceInfo *deviceInfo, AudioDeviceID macCoreDeviceId, int isInput)
{
UInt32 propSize;
PaError err = paNoError;
UInt32 i;
int numChannels = 0;
AudioBufferList *buflist;
err = conv_err(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, NULL));
buflist = PaUtil_AllocateMemory(propSize);
err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, buflist));
if (!err) {
for (i = 0; i < buflist->mNumberBuffers; ++i) {
numChannels += buflist->mBuffers[i].mNumberChannels;
}
if (isInput)
deviceInfo->maxInputChannels = numChannels;
else
deviceInfo->maxOutputChannels = numChannels;
int frameLatency;
propSize = sizeof(UInt32);
err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyLatency, &propSize, &frameLatency));
if (!err) {
double secondLatency = frameLatency / deviceInfo->defaultSampleRate;
if (isInput) {
deviceInfo->defaultLowInputLatency = secondLatency;
deviceInfo->defaultHighInputLatency = secondLatency;
}
else {
deviceInfo->defaultLowOutputLatency = secondLatency;
deviceInfo->defaultHighOutputLatency = secondLatency;
}
}
}
PaUtil_FreeMemory(buflist);
return err;
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:40,代码来源:pa_mac_core_old.c
示例18: WdmGetPinPropertyMulti
static PaError WdmGetPinPropertyMulti(
HANDLE handle,
unsigned long pinId,
unsigned long property,
KSMULTIPLE_ITEM** ksMultipleItem)
{
unsigned long multipleItemSize = 0;
KSP_PIN ksPProp;
DWORD bytesReturned;
*ksMultipleItem = 0;
ksPProp.Property.Set = KSPROPSETID_Pin;
ksPProp.Property.Id = property;
ksPProp.Property.Flags = KSPROPERTY_TYPE_GET;
ksPProp.PinId = pinId;
ksPProp.Reserved = 0;
if( DeviceIoControl( handle, IOCTL_KS_PROPERTY, &ksPProp.Property,
sizeof(KSP_PIN), NULL, 0, &multipleItemSize, NULL ) == 0 && GetLastError() != ERROR_MORE_DATA )
{
return paUnanticipatedHostError;
}
*ksMultipleItem = (KSMULTIPLE_ITEM*)PaUtil_AllocateMemory( multipleItemSize );
if( !*ksMultipleItem )
{
return paInsufficientMemory;
}
if( DeviceIoControl( handle, IOCTL_KS_PROPERTY, &ksPProp, sizeof(KSP_PIN),
(void*)*ksMultipleItem, multipleItemSize, &bytesReturned, NULL ) == 0 || bytesReturned != multipleItemSize )
{
PaUtil_FreeMemory( ksMultipleItem );
return paUnanticipatedHostError;
}
return paNoError;
}
开发者ID:0K7mGXj9thSA,项目名称:testrepositoryforjulius,代码行数:39,代码来源:pa_win_wdmks_utils.c
示例19: PaUtil_FreeAllAllocations
void PaUtil_FreeAllAllocations( PaUtilAllocationGroup* group )
{
struct PaUtilAllocationGroupLink *current = group->allocations;
struct PaUtilAllocationGroupLink *previous = 0;
/* free all buffers in the allocations list */
while( current )
{
PaUtil_FreeMemory( current->buffer );
current->buffer = 0;
previous = current;
current = current->next;
}
/* link the former allocations list onto the front of the spareLinks list */
if( previous )
{
previous->next = group->spareLinks;
group->spareLinks = group->allocations;
group->allocations = 0;
}
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:23,代码来源:pa_allocation.c
示例20: OpenStream
//.........这里部分代码省略.........
JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0 );
}
for( i = 0; i < outputChannelCount; i++ )
{
sprintf( port_string, "out_%d", i );
stream->local_output_ports[i] = jack_port_register(
jackHostApi->jack_client, port_string,
JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 );
}
/* look up the jack_port_t's for the remote ports. We could do
* this at stream start time, but doing it here ensures the
* name lookup only happens once. */
if( inputChannelCount > 0 )
{
/* ... remote output ports (that we input from) */
sprintf( regex_pattern, "%s:.*", hostApi->deviceInfos[ inputParameters->device ]->name );
jack_ports = jack_get_ports( jackHostApi->jack_client, regex_pattern,
NULL, JackPortIsOutput);
for( i = 0; i < inputChannelCount && jack_ports[i]; i++ )
{
stream->remote_output_ports[i] = jack_port_by_name(
jackHostApi->jack_client, jack_ports[i] );
}
if( i < inputChannelCount )
{
/* we found fewer ports than we expected */
return paInternalError;
}
free( jack_ports ); // XXX: this doesn't happen if we exit prematurely
}
if( outputChannelCount > 0 )
{
/* ... remote input ports (that we output to) */
sprintf( regex_pattern, "%s:.*", hostApi->deviceInfos[ outputParameters->device ]->name );
jack_ports = jack_get_ports( jackHostApi->jack_client, regex_pattern,
NULL, JackPortIsInput);
for( i = 0; i < outputChannelCount && jack_ports[i]; i++ )
{
stream->remote_input_ports[i] = jack_port_by_name(
jackHostApi->jack_client, jack_ports[i] );
}
if( i < outputChannelCount )
{
/* we found fewer ports than we expected */
return paInternalError;
}
free( jack_ports ); // XXX: this doesn't happen if we exit prematurely
}
result = PaUtil_InitializeBufferProcessor(
&stream->bufferProcessor,
inputChannelCount,
inputSampleFormat,
paFloat32, /* hostInputSampleFormat */
outputChannelCount,
outputSampleFormat,
paFloat32, /* hostOutputSampleFormat */
sampleRate,
streamFlags,
framesPerBuffer,
jack_max_buffer_size,
paUtilFixedHostBufferSize,
streamCallback,
userData );
if( result != paNoError )
goto error;
stream->is_running = FALSE;
stream->t0 = -1;/* set the first time through the callback*/
stream->total_frames_sent = 0;
jack_set_process_callback( jackHostApi->jack_client, JackCallback, stream );
*s = (PaStream*)stream;
return result;
error:
if( stream )
{
if( stream->stream_memory )
{
PaUtil_FreeAllAllocations( stream->stream_memory );
PaUtil_DestroyAllocationGroup( stream->stream_memory );
}
PaUtil_FreeMemory( stream );
}
return result;
#undef MALLOC
#undef MEMVERIFY
}
开发者ID:andreipaga,项目名称:audacity,代码行数:101,代码来源:pa_jack.c
注:本文中的PaUtil_FreeMemory函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论