cmRtSys.h/c: cmRtSysCtx.h now have cmTimeSpec_t timestamps.

These timestamps are set in _cmRtDspExecCallback() by cmApBufGetIO().
_cmRtSysEnable() now calls cmApBufOnPortEnable() to allow cmApBuf to be
aware of the audio stream starting and stopping.
This commit is contained in:
kevin 2013-12-15 18:49:49 -05:00
parent a52909671f
commit 58f2040529
2 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,7 @@
#include "cmCtx.h"
#include "cmMem.h"
#include "cmMallocDebug.h"
#include "cmTime.h"
#include "cmAudioPort.h"
#include "cmAudioNrtDev.h"
#include "cmAudioPortFile.h"
@ -294,7 +295,8 @@ void _cmRtDspExecCallback( _cmRtCfg_t* cp )
// 1) Buffers associated with disabled input/output channels will be set to NULL in iChArray[]/oChArray[].
// 2) Buffers associated with channels marked for pass-through will be set to NULL in oChArray[].
// 3) All samples returned in oChArray[] buffers will be set to zero.
cmApBufGetIO(cp->ss.args.inDevIdx, cp->ctx.iChArray, cp->ctx.iChCnt, cp->ss.args.outDevIdx, cp->ctx.oChArray, cp->ctx.oChCnt );
cmApBufGetIO(cp->ss.args.inDevIdx, cp->ctx.iChArray, cp->ctx.iChCnt, &cp->ctx.iTimeStamp,
cp->ss.args.outDevIdx, cp->ctx.oChArray, cp->ctx.oChCnt, &cp->ctx.oTimeStamp );
// calling this function results in callbacks to _cmRtSysNetRecv()
@ -605,6 +607,9 @@ cmRtRC_t _cmRtSysEnable( cmRt_t* p, bool enableFl )
{
_cmRtCfg_t* cp = p->ssArray + i;
cmApBufOnPortEnable(cp->ss.args.inDevIdx,enableFl);
cmApBufOnPortEnable(cp->ss.args.outDevIdx,enableFl);
if( enableFl )
{
cp->cmdId = kNoCmdId;

View File

@ -201,10 +201,11 @@ extern "C" {
// output (playback) buffers
cmSample_t** oChArray; // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
unsigned oChCnt; // count of output channels (ele's in oChArray[])
cmTimeSpec_t oTimeStamp;
// input (recording) buffers
cmSample_t** iChArray; // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
unsigned iChCnt; // count of input channels (ele's in iChArray[])
cmTimeSpec_t iTimeStamp;
} cmRtSysCtx_t;