(untested) measure IOProc time
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include "RageSoundDriver_CA.h"
|
#include "RageSoundDriver_CA.h"
|
||||||
#include "CAHelpers.h"
|
#include "CAHelpers.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
|
#include "RageTimer.h"
|
||||||
|
|
||||||
#include "CAAudioHardwareSystem.h"
|
#include "CAAudioHardwareSystem.h"
|
||||||
#include "CAAudioHardwareDevice.h"
|
#include "CAAudioHardwareDevice.h"
|
||||||
@@ -16,6 +17,10 @@
|
|||||||
|
|
||||||
static AudioConverter *gConverter;
|
static AudioConverter *gConverter;
|
||||||
|
|
||||||
|
/* temporary hack: */
|
||||||
|
static float g_fIOProcTime = 0;
|
||||||
|
static float g_iIOProcTimeSamples = 0;
|
||||||
|
|
||||||
static CString FormatToString( int fmt )
|
static CString FormatToString( int fmt )
|
||||||
{
|
{
|
||||||
char c[4];
|
char c[4];
|
||||||
@@ -219,6 +224,9 @@ RageSound_CA::~RageSound_CA()
|
|||||||
mOutputDevice->StopIOProc(GetData);
|
mOutputDevice->StopIOProc(GetData);
|
||||||
delete gConverter;
|
delete gConverter;
|
||||||
delete mOutputDevice;
|
delete mOutputDevice;
|
||||||
|
|
||||||
|
LOG->Info( "IOProc time: %f in %i calls, %f per call",
|
||||||
|
g_fIOProcTime, g_iIOProcTimeSamples, g_fIOProcTime/g_iIOProcTimeSamples );
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t RageSound_CA::GetPosition(const RageSoundBase *sound) const
|
int64_t RageSound_CA::GetPosition(const RageSoundBase *sound) const
|
||||||
@@ -243,6 +251,8 @@ OSStatus RageSound_CA::GetData(AudioDeviceID inDevice,
|
|||||||
const AudioTimeStamp *inOutputTime,
|
const AudioTimeStamp *inOutputTime,
|
||||||
void *inClientData)
|
void *inClientData)
|
||||||
{
|
{
|
||||||
|
RageTimer tm;
|
||||||
|
|
||||||
RageSound_CA *This = (RageSound_CA *)inClientData;
|
RageSound_CA *This = (RageSound_CA *)inClientData;
|
||||||
UInt32 dataPackets = outOutputData->mBuffers[0].mDataByteSize;
|
UInt32 dataPackets = outOutputData->mBuffers[0].mDataByteSize;
|
||||||
|
|
||||||
@@ -250,6 +260,10 @@ OSStatus RageSound_CA::GetData(AudioDeviceID inDevice,
|
|||||||
|
|
||||||
This->mDecodePos = int64_t(inOutputTime->mSampleTime);
|
This->mDecodePos = int64_t(inOutputTime->mSampleTime);
|
||||||
gConverter->FillComplexBuffer(dataPackets, *outOutputData, NULL);
|
gConverter->FillComplexBuffer(dataPackets, *outOutputData, NULL);
|
||||||
|
|
||||||
|
g_fIOProcTime += tm.GetDeltaTime();
|
||||||
|
++g_iIOProcTimeSamples;
|
||||||
|
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user