]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - pasdk/test_dsp/framework/audioStreamInpProc.h
Merge branch 'dev_pasdk_frank_pasdk516AsotRefactoring' into dev_pasdk_pasdk29Integration
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / audioStreamInpProc.h
index 58d0d9c92bcc9685129b543e7b9cafadf06199dc..a9b791c0a7d075aa293241a4f81588cd9c092123 100644 (file)
@@ -69,23 +69,16 @@ typedef struct PAF_ASIT_Fxns {
     Int (*autoProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, ALG_Handle);
     Int (*decodeProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);    
     Int (*decodeCommand) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
-    //Int (*encodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
     Int (*decodeInit) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
     Int (*decodeInfo) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
     Int (*decodeInfo1) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
     Int (*decodeInfo2) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
     //Int (*decodeCont) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
     Int (*decodeDecode) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int, Int);
-    //Int (*decodeStream) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
-    //Int (*decodeEncode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
     Int (*decodeFinalTest) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);    
     Int (*decodeComplete) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, ALG_Handle *, Int, Int);
     Int (*selectDevices) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
     Int (*sourceDecode) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);    
-    //Int (*startOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
-    //Int (*stopOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
-    //Int (*setCheckRateX) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
-    //Int (*streamChainFunction) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int, Int);
     Int (*deviceAllocate) (SIO_Handle *, int, int, int, Ptr);
     Int (*deviceSelect) (SIO_Handle *, int, int, Ptr);
     Int (*computeFrameLength) (Int, Int, Int);
@@ -202,6 +195,11 @@ enum {
 
 enum {
     ASIT_NO_ERR,
+    ASIT_ERR_IOBUFF_INIT,
+    ASIT_ERR_IODATA_INIT,
+    ASIT_ERR_IOPYH_INIT,
+    ASIT_ERR_INPDATA_PROC,
+    ASIT_ERR_INPBUF_UNDERFLOW,
     ASIT_ERR_AUTO_DETECION,
     ASIT_ERR_NO_MATCHING_SOURCE,
     ASIT_ERR_SWITCH_TO_PCM,
@@ -209,6 +207,7 @@ enum {
     ASIT_ERR_MCASP_CFG,
     ASIT_ERR_INPUT_CFG,
     ASIT_ERR_DECODE_INIT,
+    ASIT_ERR_DECODE,
     ASIT_ERR_DECODE_COMMAND,
     ASIT_ERR_DECODE_INFO1,
     ASIT_ERR_DECODE_INFO2,
@@ -217,9 +216,26 @@ enum {
     ASIT_ERR_DECODE_COMPLETE,
     ASIT_ERR_DECODE_MSG,
     ASIT_ERR_DECODE_QUIT,
+    ASIP_ERR_DECODE_ABORT,
+    ASIT_ERR_EVENTS,
     ASIT_ERR_ABORT
 };
 
+enum {
+    DEC_NO_ERR,
+    DEC_ERR_SOURCE_NONE,
+    DEC_ERR_ASPERR_ABORT,
+    DEC_ERR_ASPERR_QUIT,
+    DEC_ERR_WRONG_MSG,
+    DEC_ERR_INFO_SNDMSG,
+    DEC_ERR_INFO_ACKMSG,
+    DEC_ERR_DECODE_SNDMSG,
+    DEC_ERR_DECODE_ACKMSG,
+    DEC_ERR_DECODE_FINAL,
+    DEC_ERR_COMPLETE_MSG
+};
+
+
 #define DEC_MSGMSK_INPDATA   0x1
 #define DEC_MSGMSK_INFOACK   0x2
 #define DEC_MSGMSK_DECACK    0x4
@@ -252,17 +268,18 @@ typedef struct PAF_AST_InpIO {
     //uint32_t numXferInterm;
     uint32_t numInputOverrun;
     uint32_t numUnderflow;
-    uint32_t numAsipRestart;
-    uint32_t numAsipDecodeQuit;
+    uint32_t numAsitRestart;
+    uint32_t numAsitDecodeQuit;
     uint32_t numFrameReceived;
     uint32_t numPcmFrameReceived;
 
     size_t         phyXferSize;
     int_fast32_t   pcmSwitchHangOver;
     uint_least16_t asipState;
-    uint_least16_t asipProcState;
+    //uint_least16_t asipProcState;
     bool           buffReadComplete;
     bool           swapData;
+    bool           firstTimeInit;
 } PAF_AST_IoInp;
 
 // Decoder structure
@@ -271,7 +288,9 @@ typedef struct asipDecProc_s {
     Int frame;
     Int block;
 
+    Int majorAuFound;
     Int initDone;
+    Int decodeAckDelayed;
 } asipDecProc_t;
 
 // Audio Stream Input Task (ASIT) configuration
@@ -516,14 +535,6 @@ PAF_ASIT_sourceDecode(
     Int x
 );
 
-//   Purpose:   Decoding Function for terminating output.
-Int
-PAF_AST_stopOutput(
-    const PAF_ASIT_Params *pP, 
-    const PAF_ASIT_Patchs *pQ, 
-    PAF_ASIT_Config *pAsitCfg
-);
-
 //   Purpose:   Common Function for processing algorithm chains.
 Int
 PAF_AST_streamChainFunction(
@@ -588,7 +599,7 @@ static inline Int sharedMemReadInt(volatile XDAS_Int32 *address, Int gateIdx)
 #endif
 }
 
-Int asipUpdateInputStatus(const void *pRxParams, PAF_InpBufStatus *pStatus,
+Int asitUpdateInputStatus(const void *pRxParams, PAF_InpBufStatus *pStatus,
                           PAF_InpBufConfig *pInpBuf);
 /*
 Int asipDecodeInit(
@@ -596,18 +607,28 @@ Int asipDecodeInit(
         PAF_ASIT_Config *pAsitCfg,
         Int sourceSelect);
 */
-Int asipDecodeProcessing(
+/*Int asipDecodeProcessing(
         const PAF_ASIT_Params *pP,
         const PAF_ASIT_Patchs *pQ,
         PAF_ASIT_Config *pAsitCfg,
-        Int sourceSelect);
+        Int sourceSelect);*/
+Int asitDecodeProcessing(const PAF_ASIT_Params *pP,
+                         const PAF_ASIT_Patchs *pQ,
+                         PAF_ASIT_Config       *pAsitCfg,
+                         UInt asitEvents);
 
-/*
 Int decDecodeInit(
         const PAF_ASIT_Params *pP,
         PAF_ASIT_Config *pAsitCfg,
         Int sourceSelect);
-*/        
+
+Int decDecodeFsm(
+        const PAF_ASIT_Params *pP,
+        const PAF_ASIT_Patchs *pQ,
+        PAF_ASIT_Config *pAsitCfg,
+        Int sourceSelect,
+        UInt decMsg);
+
 Int getFrameLengthSourceSel(
         const PAF_ASIT_Params *pP,
         Int8 sourceSelect);