PASDK-218:Fix Out IS audio frame copy (write & read)
authorFrank Livingston <frank-livingston@ti.com>
Mon, 3 Jul 2017 23:29:46 +0000 (18:29 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Mon, 3 Jul 2017 23:29:46 +0000 (18:29 -0500)
pasdk/common/aspOutInitSync_common.c
pasdk/common/aspOutInitSync_common.h
pasdk/test_arm/framework/aspOutInitSync_slave.c
pasdk/test_arm/framework/audioStreamDecodeProc.c
pasdk/test_dsp/framework/aspOutInitSync_master.c

index 7723ab24bca1f16b24ceb763c58a3a3211d66989..5dd4b0b18b594bd455d4b72788865d252b500283 100644 (file)
@@ -95,3 +95,18 @@ Int outIsCtlInit(
 #endif
 }
 
+// Copy audio frame
+// (***) FL: Note similar functionality present in CB, check usage there.
+Void outIsCpyAf(
+    PAF_AudioFrame *pSrcAf,
+    PAF_AudioFrame *pDstAf
+)
+{
+    // Write AF members written by CPL_setAudioFrame_();
+    pDstAf->sampleDecode                       = pSrcAf->sampleDecode;
+    PAF_PROCESS_COPY(pDstAf->sampleProcess, pSrcAf->sampleProcess);
+    pDstAf->sampleRate                         = pSrcAf->sampleRate;
+    pDstAf->sampleCount                        = pSrcAf->sampleCount;
+    pDstAf->channelConfigurationRequest        = pSrcAf->channelConfigurationRequest;
+    pDstAf->channelConfigurationStream         = pSrcAf->channelConfigurationStream;
+}
index 8dbff5bfbbab267736bd71b616ba094bffcdcf70..993972cdc05f2f0aed74622ab883595d493d7afb 100644 (file)
@@ -82,4 +82,11 @@ Int outIsCtlInit(
     PAF_AST_OutInitSyncInfo **pXOutIsInfo       // pointer to base address of output init-sync info array
 );
 
+// Copy audio frame
+// Note similar functionality present in CB, check usage there.
+Void outIsCpyAf(
+    PAF_AudioFrame *pSrcAf,
+    PAF_AudioFrame *pDstAf
+);
+
 #endif /* _ASP_OUT_INIT_SYNC_H_ */
index a0c778f3ef886933131c9deb5fb642a9c5849aa3..f5eb02137c320372690c030df0bb66a79addf80f 100644 (file)
@@ -51,7 +51,7 @@ Int outIsResetDecStageFlags(
 {
     IArg key;
     GateMP_Handle gateHandle;
-    PAF_AST_OutInitSyncInfo *pOutISI;
+    PAF_AST_OutInitSyncInfo *pOutIsi;
     Int8 i;
     
     // Get gate handle
@@ -64,12 +64,12 @@ Int outIsResetDecStageFlags(
     //
     
     // Get address of Output Init-Sync Info
-    pOutISI = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
+    pOutIsi = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
 
     // Reset flags
     for (i = 0; i < ASP_OUTIS_NUM_DEC_STAGES; i++)
     {
-        pOutISI->decStageOutInitSyncInfo[i].decFlag = 0;
+        pOutIsi->decStageOutInitSyncInfo[i].decFlag = 0;
     }
     
     // Leave the gate
@@ -88,8 +88,8 @@ Int outIsWriteDecStageFlag(
 {
     IArg key;
     GateMP_Handle gateHandle;
-    PAF_AST_OutInitSyncInfo *pOutISI;
-    PAF_AST_DecStageOutInitSyncInfo *pDecStageOutISI;
+    PAF_AST_OutInitSyncInfo *pOutIsi;
+    PAF_AST_DecStageOutInitSyncInfo *pDecStageOutIsi;
     
     // Get gate handle
     gateHandle = pOutIsCtl->gateHandle;
@@ -101,12 +101,12 @@ Int outIsWriteDecStageFlag(
     //
 
     // Get address of Output Init-Sync Info
-    pOutISI = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
+    pOutIsi = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
     // Get address of Decoder Output Init-Sync Info
-    pDecStageOutISI = &pOutISI->decStageOutInitSyncInfo[decStageIdx];
+    pDecStageOutIsi = &pOutIsi->decStageOutInitSyncInfo[decStageIdx];
 
     // Write flag value
-    pDecStageOutISI->decFlag = decFlag;
+    pDecStageOutIsi->decFlag = decFlag;
     
     // Leave the gate
     GateMP_leave(gateHandle, key);
@@ -126,8 +126,8 @@ Int outIsWriteDecStageFlagAndAf(
 {
     IArg key;
     GateMP_Handle gateHandle;
-    PAF_AST_OutInitSyncInfo *pOutISI;
-    PAF_AST_DecStageOutInitSyncInfo *pDecStageOutISI;
+    PAF_AST_OutInitSyncInfo *pOutIsi;
+    PAF_AST_DecStageOutInitSyncInfo *pDecStageOutIsi;
     
     // Get gate handle
     gateHandle = pOutIsCtl->gateHandle;
@@ -140,18 +140,18 @@ Int outIsWriteDecStageFlagAndAf(
     //
     
     // Get address of Output Init-Sync Info
-    pOutISI = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
+    pOutIsi = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
     // Get address of Decoder Output Init-Sync Info
-    pDecStageOutISI = &pOutISI->decStageOutInitSyncInfo[decStageIdx];
+    pDecStageOutIsi = &pOutIsi->decStageOutInitSyncInfo[decStageIdx];
 
-    // Write audio frame
     if (decFlag != 0)
     {
-        pDecStageOutISI->decAf = *pDecAfWrt;        
+        // Write audio frame to Out IS
+        outIsCpyAf(pDecAfWrt, &pDecStageOutIsi->decAf);
     }
 
     // Write flag value
-    pDecStageOutISI->decFlag = decFlag;
+    pDecStageOutIsi->decFlag = decFlag;
 
     // Leave the gate
     GateMP_leave(gateHandle, key);
index a0a4fe4a4ff425fc27660010071cbfd3f80cabba..636dacfaf4bd049efcfe39c259dece0300e6b0b1 100644 (file)
@@ -685,7 +685,6 @@ Void taskAsdpFxn(
                             if (errno)
                             {
                                 SW_BREAKPOINT; // debug
-                                return errno;
                             }
                             // debug
                             cbLog(pCbCtl, z, 1, "cbInitSourceSel");
index 124d25bf173104f2f2bf2fd7cb04b7938a3290de..a2588e77eec952cbb57fd040ff325e1a721ab1e4 100644 (file)
@@ -54,8 +54,8 @@ Int outIsReadDecStageFlag(
 {
     IArg key;
     GateMP_Handle gateHandle;
-    PAF_AST_OutInitSyncInfo *pOutISI;
-    PAF_AST_DecStageOutInitSyncInfo *pDecStageOutISI;
+    PAF_AST_OutInitSyncInfo *pOutIsi;
+    PAF_AST_DecStageOutInitSyncInfo *pDecStageOutIsi;
     
     // Get gate handle
     gateHandle = pOutIsCtl->gateHandle;
@@ -67,11 +67,11 @@ Int outIsReadDecStageFlag(
     //
 
     // Get address of Output Init-Sync Info
-    pOutISI = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
+    pOutIsi = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
     // Get address of Decoder Output Init-Sync Info
-    pDecStageOutISI = &pOutISI->decStageOutInitSyncInfo[decStageIdx];
+    pDecStageOutIsi = &pOutIsi->decStageOutInitSyncInfo[decStageIdx];
     // Read flag value
-    *pFlagVal = pDecStageOutISI->decFlag;
+    *pFlagVal = pDecStageOutIsi->decFlag;
     
     // Leave the gate
     GateMP_leave(gateHandle, key);
@@ -90,8 +90,8 @@ Int outIsReadDecStageFlagAndAf(
 {
     IArg key;
     GateMP_Handle gateHandle;
-    PAF_AST_OutInitSyncInfo *pOutISI;
-    PAF_AST_DecStageOutInitSyncInfo *pDecStageOutISI;
+    PAF_AST_OutInitSyncInfo *pOutIsi;
+    PAF_AST_DecStageOutInitSyncInfo *pDecStageOutIsi;
     
     
     // Get gate handle
@@ -105,18 +105,19 @@ Int outIsReadDecStageFlagAndAf(
     //
     
     // Get address of Output Init-Sync Info
-    pOutISI = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
+    pOutIsi = &((*pOutIsCtl->pXOutIsInfo)[outIsiIdx]);
     // Get address of Decoder Output Init-Sync Info
-    pDecStageOutISI = &pOutISI->decStageOutInitSyncInfo[decStageIdx];
+    pDecStageOutIsi = &pOutIsi->decStageOutInitSyncInfo[decStageIdx];
 
     // Read flag value
-    *pDecFlag = pDecStageOutISI->decFlag;    
+    *pDecFlag = pDecStageOutIsi->decFlag;
 
-    // Read audio frame
-    if (pDecStageOutISI->decFlag != 0)
+    if (pDecStageOutIsi->decFlag != 0)
     {
         // audio frame valid
-        *pDecAfRd = pDecStageOutISI->decAf;
+        
+        // Read audio frame from Out IS
+        outIsCpyAf(&pDecStageOutIsi->decAf, pDecAfRd);
     }
         
     // Leave the gate