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 10 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,6 +6,7 @@
6 6
 #include "cmCtx.h"
7 7
 #include "cmMem.h"
8 8
 #include "cmMallocDebug.h"
9
+#include "cmTime.h"
9 10
 #include "cmAudioPort.h"
10 11
 #include "cmAudioNrtDev.h"
11 12
 #include "cmAudioPortFile.h"
@@ -294,7 +295,8 @@ void _cmRtDspExecCallback( _cmRtCfg_t* cp )
294 295
   //   1) Buffers associated with disabled input/output channels will be set to NULL in iChArray[]/oChArray[].
295 296
   //   2) Buffers associated with channels marked for pass-through will be set to NULL in oChArray[].
296 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 302
   // calling this function results in callbacks to _cmRtSysNetRecv()
@@ -605,6 +607,9 @@ cmRtRC_t _cmRtSysEnable( cmRt_t* p, bool enableFl )
605 607
   {
606 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 613
     if( enableFl )
609 614
     {
610 615
       cp->cmdId = kNoCmdId;

+ 2
- 1
cmRtSys.h View File

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

Loading…
Cancel
Save