Merge branch 'dev_pasdk_frank_pasdk516AsotRefactoring' into dev_pasdk_pasdk29Integration
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / audioStreamInpProc.h
index fbe294659b70d0e228d6aab60bf16107632bca97..a9b791c0a7d075aa293241a4f81588cd9c092123 100644 (file)
@@ -195,6 +195,11 @@ enum {
 
 enum {
     ASIT_NO_ERR,
 
 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,
     ASIT_ERR_AUTO_DETECION,
     ASIT_ERR_NO_MATCHING_SOURCE,
     ASIT_ERR_SWITCH_TO_PCM,
@@ -202,6 +207,7 @@ enum {
     ASIT_ERR_MCASP_CFG,
     ASIT_ERR_INPUT_CFG,
     ASIT_ERR_DECODE_INIT,
     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,
     ASIT_ERR_DECODE_COMMAND,
     ASIT_ERR_DECODE_INFO1,
     ASIT_ERR_DECODE_INFO2,
@@ -210,9 +216,26 @@ enum {
     ASIT_ERR_DECODE_COMPLETE,
     ASIT_ERR_DECODE_MSG,
     ASIT_ERR_DECODE_QUIT,
     ASIT_ERR_DECODE_COMPLETE,
     ASIT_ERR_DECODE_MSG,
     ASIT_ERR_DECODE_QUIT,
+    ASIP_ERR_DECODE_ABORT,
+    ASIT_ERR_EVENTS,
     ASIT_ERR_ABORT
 };
 
     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
 #define DEC_MSGMSK_INPDATA   0x1
 #define DEC_MSGMSK_INFOACK   0x2
 #define DEC_MSGMSK_DECACK    0x4
@@ -245,17 +268,18 @@ typedef struct PAF_AST_InpIO {
     //uint32_t numXferInterm;
     uint32_t numInputOverrun;
     uint32_t numUnderflow;
     //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;
     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           buffReadComplete;
     bool           swapData;
+    bool           firstTimeInit;
 } PAF_AST_IoInp;
 
 // Decoder structure
 } PAF_AST_IoInp;
 
 // Decoder structure
@@ -264,7 +288,9 @@ typedef struct asipDecProc_s {
     Int frame;
     Int block;
 
     Int frame;
     Int block;
 
+    Int majorAuFound;
     Int initDone;
     Int initDone;
+    Int decodeAckDelayed;
 } asipDecProc_t;
 
 // Audio Stream Input Task (ASIT) configuration
 } asipDecProc_t;
 
 // Audio Stream Input Task (ASIT) configuration
@@ -573,7 +599,7 @@ static inline Int sharedMemReadInt(volatile XDAS_Int32 *address, Int gateIdx)
 #endif
 }
 
 #endif
 }
 
-Int asipUpdateInputStatus(const void *pRxParams, PAF_InpBufStatus *pStatus,
+Int asitUpdateInputStatus(const void *pRxParams, PAF_InpBufStatus *pStatus,
                           PAF_InpBufConfig *pInpBuf);
 /*
 Int asipDecodeInit(
                           PAF_InpBufConfig *pInpBuf);
 /*
 Int asipDecodeInit(
@@ -581,18 +607,28 @@ Int asipDecodeInit(
         PAF_ASIT_Config *pAsitCfg,
         Int sourceSelect);
 */
         PAF_ASIT_Config *pAsitCfg,
         Int sourceSelect);
 */
-Int asipDecodeProcessing(
+/*Int asipDecodeProcessing(
         const PAF_ASIT_Params *pP,
         const PAF_ASIT_Patchs *pQ,
         PAF_ASIT_Config *pAsitCfg,
         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 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);
 Int getFrameLengthSourceSel(
         const PAF_ASIT_Params *pP,
         Int8 sourceSelect);