Browse Source

cmAudioSys.h/c : cmAudioSysCtx_t now have time stamps which are set in

the cmApBufGetIO() calls in _cmAsDspExecCallback().
_cmAudioSysEnable() now calls cmApBufOnPortEnable() to that cmApBuf() can
be aware to when audio streaming is starting and stopping.
master
kevin 11 years ago
parent
commit
a52909671f
2 changed files with 8 additions and 1 deletions
  1. 6
    1
      cmAudioSys.c
  2. 2
    0
      cmAudioSys.h

+ 6
- 1
cmAudioSys.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"
276
   //   1) Buffers associated with disabled input/output channels will be set to NULL in iChArray[]/oChArray[].
277
   //   1) Buffers associated with disabled input/output channels will be set to NULL in iChArray[]/oChArray[].
277
   //   2) Buffers associated with channels marked for pass-through will be set to NULL in oChArray[].
278
   //   2) Buffers associated with channels marked for pass-through will be set to NULL in oChArray[].
278
   //   3) All samples returned in oChArray[] buffers will be set to zero.
279
   //   3) All samples returned in oChArray[] buffers will be set to zero.
279
-  cmApBufGetIO(cp->ss.args.inDevIdx, cp->ctx.iChArray, cp->ctx.iChCnt, cp->ss.args.outDevIdx, cp->ctx.oChArray, cp->ctx.oChCnt  );
280
+  cmApBufGetIO(cp->ss.args.inDevIdx,  cp->ctx.iChArray, cp->ctx.iChCnt, &cp->ctx.iTimeStamp, 
281
+               cp->ss.args.outDevIdx, cp->ctx.oChArray, cp->ctx.oChCnt, &cp->ctx.oTimeStamp  );
280
 
282
 
281
   // call the application provided DSP process
283
   // call the application provided DSP process
282
   cp->ctx.audioRateFl = true;
284
   cp->ctx.audioRateFl = true;
554
   {
556
   {
555
     _cmAsCfg_t* cp = p->ssArray + i;
557
     _cmAsCfg_t* cp = p->ssArray + i;
556
 
558
 
559
+    cmApBufOnPortEnable(cp->ss.args.inDevIdx,enableFl);
560
+    cmApBufOnPortEnable(cp->ss.args.outDevIdx,enableFl);
561
+    
557
     if( enableFl )
562
     if( enableFl )
558
     {
563
     {
559
 
564
 

+ 2
- 0
cmAudioSys.h View File

179
                                        // output (playback) buffers
179
                                        // output (playback) buffers
180
     cmSample_t**        oChArray;      // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
180
     cmSample_t**        oChArray;      // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
181
     unsigned            oChCnt;        // count of output channels (ele's in oChArray[])
181
     unsigned            oChCnt;        // count of output channels (ele's in oChArray[])
182
+    cmTimeSpec_t        oTimeStamp;
182
 
183
 
183
                                        // input (recording) buffers
184
                                        // input (recording) buffers
184
     cmSample_t**        iChArray;      // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
185
     cmSample_t**        iChArray;      // each ele is a ptr to buffer with cfg.dspFramesPerCycle samples
185
     unsigned            iChCnt;        // count of input channels (ele's in iChArray[])
186
     unsigned            iChCnt;        // count of input channels (ele's in iChArray[])
187
+    cmTimeSpec_t        iTimeStamp;
186
     
188
     
187
   } cmAudioSysCtx_t;
189
   } cmAudioSysCtx_t;
188
 
190
 

Loading…
Cancel
Save