summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9149522)
raw | patch | inline | side by side (parent: 9149522)
author | Frank Livingston <frank-livingston@ti.com> | |
Wed, 28 Jun 2017 21:42:47 +0000 (16:42 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Wed, 28 Jun 2017 21:42:47 +0000 (16:42 -0500) |
pasdk/test_dsp/framework/audioStreamOutProc.c | patch | blob | history | |
pasdk/test_dsp/framework/audioStreamOutProc.h | patch | blob | history |
diff --git a/pasdk/test_dsp/framework/audioStreamOutProc.c b/pasdk/test_dsp/framework/audioStreamOutProc.c
index ded055aa6133bae549d84fefffb3117c0082ae3b..80b7bbaf5f7dbd7cc6043b82190dbfe94bddc5e5 100644 (file)
#define __TASK_NAME__ "TaskAsop"
-/* FL: Check if at least one output selected */
+/* Check if at least one output selected */
static Int checkOutSel(
const PAF_ASOT_Params *pP,
PAF_ASOT_Config *pAsotCfg,
Int *pOutSel
);
-/* FL: Check if at least one output sio changed */
+/* Check if at least one output sio changed */
static Int checkOutSio(
const PAF_ASOT_Params *pP,
PAF_ASOT_Config *pAsotCfg,
Int *pOutSioUpdate
);
+// Reset audio frame pointers to original values
+static Void resetAfPointers(
+ const PAF_ASOT_Params *pP,
+ PAF_AST_Stream *xStr
+);
+
+// Reset audio frame meta data elements
+static Void resetAfMetadata(
+ const PAF_ASOT_Params *pP,
+ PAF_AST_Stream *xStr
+);
+
+
LINNO_DEFN(TaskAsop); /* Line number macros */
ERRNO_DEFN(TaskAsop); /* Error number macros */
Int errno; /* error number */
Int zMS;
Int loopCount = 0; // used to stop trace to see startup behavior.
+ Int outSel;
Log_info0("Enter taskAsopFxn()");
TRACE_VERBOSE1("TaskAsip: AS%d: running", as+z);
}
- errno = 0;
+ errno = 0; // reset error indicator
for (;;)
{
- Int outSel;
-
loopCount++;
TRACE_GEN2("TaskAsop (begin Main loop %d) (errno 0x%x)", loopCount, errno);
TRACE_VERBOSE1("TaskAsop: AS%d: ... sleeping ...", as+zMS);
Task_sleep(1);
+ // select output devices
TRACE_GEN1("TaskAsop: AS%d: Output device selection ...", as+zMS);
errno = pP->fxns->selectDevices(pP, pQ, pAsotCfg);
if (errno)
continue;
}
- // if no output selected skip any remaining processing
+ // if no output selected skip remaining processing
errno = checkOutSel(pP, pAsotCfg, &outSel);
if (errno)
{
}
TRACE_VERBOSE0("TaskAsop: calling outputProcessing.");
- errno = pP->fxns->decodeProcessing(pP, pQ, pAsotCfg, -1);
+ errno = pP->fxns->decodeProcessing(pP, pQ, pAsotCfg);
if (errno)
{
TRACE_TERSE1("TaskAsop: outputProcessing returns 0x%x, continue", errno);
PAF_ASOT_decodeProcessing(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
- PAF_ASOT_Config *pAsotCfg,
- Int sourceSelect
+ PAF_ASOT_Config *pAsotCfg
)
{
PAF_AST_Config *pAstCfg;
- Int z; /* decode counter */
Int errno; /* error number */
Int getVal;
enum { INIT, STREAM, ENCODE, FINAL, QUIT } state;
// Reset audio frame pointers to original values
// (may be needed if error occurred).
- for (z=STREAM1; z < STREAMN; z++)
- {
- Int ch;
- for (ch=PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++)
- {
- if (pAstCfg->xStr[z].audioFrameChannelPointers[ch])
- {
- pAstCfg->xStr[z].audioFrameChannelPointers[ch] =
- pAstCfg->xStr[z].origAudioFrameChannelPointers[ch];
- }
- }
- }
-
+ resetAfPointers(pP, pAstCfg->xStr);
// Reset audio frame meta data elements
- {
- Int i;
-
- for (z=STREAM1; z < STREAMN; z++)
- {
- pAstCfg->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
- pAstCfg->xStr[z].pAudioFrame->numPrivateMetadata = 0;
- pAstCfg->xStr[z].pAudioFrame->bsMetadata_offset = 0;
- pAstCfg->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
+ resetAfMetadata(pP, pAstCfg->xStr);
- for (i=0; i<pP->pMetadataBufStatus->NumBuf; i++)
- {
- pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
- pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
- }
- }
- }
-
- errno = pP->fxns->decodeInit(pP, pQ, pAsotCfg, sourceSelect);
+ errno = pP->fxns->decodeInit(pP, pQ, pAsotCfg);
if (errno)
{
TRACE_VERBOSE1("PAF_ASOT_decodeProcessing: INIT, errno 0x%x. break after decodeInit", errno);
// (***) FL: do we need this?
// AF pointers come from CB read, any resets occur in Decoder AF.
+ //
// Reset audio frame pointers to original values
// (may have been adjusted by ARC or the like).
- for (z=STREAM1; z < STREAMN; z++)
- {
- Int ch;
- for (ch=PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++)
- {
- if (pAstCfg->xStr[z].audioFrameChannelPointers[ch])
- {
- pAstCfg->xStr[z].audioFrameChannelPointers[ch] =
- pAstCfg->xStr[z].origAudioFrameChannelPointers[ch];
- }
- }
- }
+ resetAfPointers(pP, pAstCfg->xStr);
- //
// (***) FL: update output (setCheckRateX)
// Contained in INFO2 in combined FSM.
errno = pP->fxns->decodeInfo2(pP, pQ, pAsotCfg, frame, block);
PAF_ASOT_decodeInit(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
- PAF_ASOT_Config *pAsotCfg,
- Int sourceSelect
+ PAF_ASOT_Config *pAsotCfg
)
{
PAF_AST_Config *pAstCfg;
return 0;
} //PAF_ASOT_streamChainFunction
-/* FL: Check if at least one output selected */
+/* Check if at least one output selected */
static Int checkOutSel(
const PAF_ASOT_Params *pP,
PAF_ASOT_Config *pAsotCfg,
return 0;
}
-/* FL: Check if at least one output sio changed */
+/* Check if at least one output sio changed */
static Int checkOutSio(
const PAF_ASOT_Params *pP,
PAF_ASOT_Config *pAsotCfg,
return 0;
}
+
+// Reset audio frame pointers to original values
+static Void resetAfPointers(
+ const PAF_ASOT_Params *pP,
+ PAF_AST_Stream *xStr
+)
+{
+ Int z;
+ Int ch;
+
+ // Reset audio frame pointers to original values
+ for (z = STREAM1; z < STREAMN; z++)
+ {
+ for (ch = PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++)
+ {
+ if (xStr[z].audioFrameChannelPointers[ch])
+ {
+ xStr[z].audioFrameChannelPointers[ch] =
+ xStr[z].origAudioFrameChannelPointers[ch];
+ }
+ }
+ }
+}
+
+// Reset audio frame meta data elements
+static Void resetAfMetadata(
+ const PAF_ASOT_Params *pP,
+ PAF_AST_Stream *xStr
+)
+{
+ Int z;
+ Int i;
+
+ for (z = STREAM1; z < STREAMN; z++)
+ {
+ xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
+ xStr[z].pAudioFrame->numPrivateMetadata = 0;
+ xStr[z].pAudioFrame->bsMetadata_offset = 0;
+ xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
+
+ for (i = 0; i < pP->pMetadataBufStatus->NumBuf; i++)
+ {
+ xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
+ xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
+ }
+ }
+}
diff --git a/pasdk/test_dsp/framework/audioStreamOutProc.h b/pasdk/test_dsp/framework/audioStreamOutProc.h
index b3580ae2925791df39b4a2efa4e60f4ccc8f0e82..47661ddb36dca37aa777ec106308d5b4026ecb1f 100644 (file)
//Int (*passProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
//Int (*passProcessingCopy) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
//Int (*autoProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, ALG_Handle);
- Int (*decodeProcessing) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+
+ //Int (*decodeProcessing) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+ Int (*decodeProcessing) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
+
//Int (*decodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
Int (*encodeCommand) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
- Int (*decodeInit) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+
+ //Int (*decodeInit) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+ Int (*decodeInit) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
+
//Int (*decodeInfo) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
Int (*decodeInfo1) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
Int (*decodeInfo2) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
PAF_ASOT_decodeProcessing(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
- PAF_ASOT_Config *pAsotCfg,
- Int sourceSelect
+ PAF_ASOT_Config *pAsotCfg
);
// Purpose: Decoding Function for processing Encode Commands.
PAF_ASOT_decodeInit(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
- PAF_ASOT_Config *pAsotCfg,
- Int sourceSelect
+ PAF_ASOT_Config *pAsotCfg
);
// Purpose: Decoding Function for processing information in a manner that