void DTMF_MCU_ReadDataDone(kal_uint32 uDataWord)
{
   kal_brief_trace( TRACE_GROUP_AUD_PLAYBACK, MCU_DTMF_READ_DATA_DONE, uDataWord);
   if(DTMF_SW.pHandle)
   {
      rbReadDataDone(&DTMF_SW.RingBuffer, uDataWord<<1);
   }
}
Exemplo n.º 2
0
static void AVB_Process(void *pData)
{
   kal_int16 *pDstBuffer;
   kal_int8 *pSrcBuffer;
   kal_uint32 uSrcByte, uDstByte, uConsumeByte;
   kal_trace( TRACE_GROUP_SCO, L1AUDIO_AVB_PROC, AVB.uState, AVB.uSegment_W, AVB.uSegment_R);
   while(AVB.uSegment_W - AVB.uSegment_R < AVB_SEGMENT_NUMBER)
   {
      rbGetReadBuffer(&AVB.PCM, &pSrcBuffer, &uSrcByte);
      if(uSrcByte<4)
      {
         break;
      }
      uDstByte = (AVB_FRAME_SAMPLE-AVB.uSample_W)*2;
      pDstBuffer = AVB.pBuffer + (AVB.uSegment_W & AVB_SEGMENT_MASK) * AVB_FRAME_SAMPLE + AVB.uSample_W;
      uConsumeByte = BLI_Convert(AVB.pBLISRC, (kal_int16*)pSrcBuffer, &uSrcByte, pDstBuffer, &uDstByte);  
      rbReadDataDone(&AVB.PCM, uConsumeByte);
      AVB.uSample_W += uDstByte>>1;
      ASSERT(AVB.uSample_W <= AVB_FRAME_SAMPLE);
      if(AVB.uSample_W == AVB_FRAME_SAMPLE)
      {
         AVB.uSample_W = 0;
         AVB.uSegment_W++;
      }
      else
      {
         uDstByte = (AVB_FRAME_SAMPLE-AVB.uSample_W)*2;
         pDstBuffer = AVB.pBuffer + (AVB.uSegment_W & AVB_SEGMENT_MASK) * AVB_FRAME_SAMPLE + AVB.uSample_W;
         memset(pDstBuffer, 0, uDstByte);
      }
   }
   if(AVB.uState == AVB_STATE_FLUSH_TAIL)
   {
      rbGetReadBuffer(&AVB.PCM, &pSrcBuffer, &uSrcByte);
      if(uSrcByte<4)
      {
         if(AVB.uSample_W)
         {
            AVB.uSample_W = 0;
            AVB.uSegment_W++;
         }
         AVB.uState = AVB_STATE_FLUSH_PING;
      }
   }
}