Browse Source

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.
master
kevin 11 years ago
parent
commit
58f2040529
2 changed files with 8 additions and 2 deletions
  1. 6
    1
      cmRtSys.c
  2. 2
    1
      cmRtSys.h

+ 6
- 1
cmRtSys.c View File

6
 #include "cmCtx.h"
6
 #include "cmCtx.h"
7
 #include "cmMem.h"
7
 #include "cmMem.h"
8
 #include "cmMallocDebug.h"
8
 #include "cmMallocDebug.h"
9
+#include "cmTime.h"
9
 #include "cmAudioPort.h"
10
 #include "cmAudioPort.h"
10
 #include "cmAudioNrtDev.h"
11
 #include "cmAudioNrtDev.h"
11
 #include "cmAudioPortFile.h"
12
 #include "cmAudioPortFile.h"
294
   //   1) Buffers associated with disabled input/output channels will be set to NULL in iChArray[]/oChArray[].
295
   //   1) Buffers associated with disabled input/output channels will be set to NULL in iChArray[]/oChArray[].
295
   //   2) Buffers associated with channels marked for pass-through will be set to NULL in oChArray[].
296
   //   2) Buffers associated with channels marked for pass-through will be set to NULL in oChArray[].
296
   //   3) All samples returned in oChArray[] buffers will be set to zero.
297
   //   3) All samples returned in oChArray[] buffers will be set to zero.
297
-  cmApBufGetIO(cp->ss.args.inDevIdx, cp->ctx.iChArray, cp->ctx.iChCnt, cp->ss.args.outDevIdx, cp->ctx.oChArray, cp->ctx.oChCnt  );
298
+  cmApBufGetIO(cp->ss.args.inDevIdx,  cp->ctx.iChArray, cp->ctx.iChCnt, &cp->ctx.iTimeStamp, 
299
+               cp->ss.args.outDevIdx, cp->ctx.oChArray, cp->ctx.oChCnt, &cp->ctx.oTimeStamp  );
298
 
300
 
299
 
301
 
300
   // calling this function results in callbacks to _cmRtSysNetRecv()
302
   // calling this function results in callbacks to _cmRtSysNetRecv()
605
   {
607
   {
606
     _cmRtCfg_t* cp = p->ssArray + i;
608
     _cmRtCfg_t* cp = p->ssArray + i;
607
 
609
 
610
+    cmApBufOnPortEnable(cp->ss.args.inDevIdx,enableFl);
611
+    cmApBufOnPortEnable(cp->ss.args.outDevIdx,enableFl);
612
+
608
     if( enableFl )
613
     if( enableFl )
609
     {
614
     {
610
       cp->cmdId = kNoCmdId;
615
       cp->cmdId = kNoCmdId;

+ 2
- 1
cmRtSys.h View File

201
                                        // output (playback) buffers
201
                                        // output (playback) buffers
202
     cmSample_t**        oChArray;      // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
202
     cmSample_t**        oChArray;      // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
203
     unsigned            oChCnt;        // count of output channels (ele's in oChArray[])
203
     unsigned            oChCnt;        // count of output channels (ele's in oChArray[])
204
-
204
+    cmTimeSpec_t        oTimeStamp;
205
                                        // input (recording) buffers
205
                                        // input (recording) buffers
206
     cmSample_t**        iChArray;      // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
206
     cmSample_t**        iChArray;      // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
207
     unsigned            iChCnt;        // count of input channels (ele's in iChArray[])
207
     unsigned            iChCnt;        // count of input channels (ele's in iChArray[])
208
+    cmTimeSpec_t        iTimeStamp;          
208
     
209
     
209
   } cmRtSysCtx_t;
210
   } cmRtSysCtx_t;
210
 
211
 

Loading…
Cancel
Save