summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e24e00e)
raw | patch | inline | side by side (parent: e24e00e)
author | Frank Livingston <frank-livingston@ti.com> | |
Fri, 23 Jun 2017 01:02:34 +0000 (20:02 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Fri, 23 Jun 2017 01:02:34 +0000 (20:02 -0500) |
pasdk/common/aspDecOpCircBuf_common.c | patch | blob | history | |
pasdk/common/aspDecOpCircBuf_common.h | patch | blob | history |
index 39dc3128f1920d7621ef9b29612f3b21d2bb69b0..193e04fc926dad70b151ac9bebcb2136dba97aa3 100644 (file)
return ASP_DECOP_CB_SOK;
}
+// Get circular buffer statistics
+Int cbGetStats(
+ PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
+ Int8 cbIdx, // decoder output circular buffer index
+ PAF_AST_DecOpCircBufStats *pCbStats // decoder output circular buffer statistics
+
+)
+{
+ IArg key;
+ GateMP_Handle gateHandle;
+ PAF_AST_DecOpCircBuf *pCb;
+
+ // Get gate handle
+ gateHandle = pCbCtl->gateHandle;
+ // Enter gate
+ key = GateMP_enter(gateHandle);
+
+ // Get circular buffer base pointer
+ pCb = &(*pCbCtl->pXDecOpCb)[cbIdx];
+
+ // Invalidate circular buffer configuration.
+ Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ // Populate statistics
+ pCbStats->readAfWriterInactiveCnt = pCb->readAfWriterInactiveCnt;
+ pCbStats->wrtAfReaderInactiveCnt = pCb->wrtAfReaderInactiveCnt;
+ pCbStats->wrtAfZeroSampsCnt = pCb->wrtAfZeroSampsCnt;
+ pCbStats->errUndCnt = pCb->errUndCnt;
+ pCbStats->errOvrCnt = pCb->errOvrCnt;
+
+ // Leave the gate
+ GateMP_leave(gateHandle, key);
+
+ return ASP_DECOP_CB_SOK;
+}
+
+
// Output log of circular buffer control variables (debug)
Int cbLog(
PAF_AST_DecOpCircBufCtl *pCbCtl,
index cc4a7fc4baaea83b001b4379dcd391aae939213c..a5fb33d660f7f520dc300212ed6b8346fd3fb78c 100644 (file)
#define ASP_DECODE_CB_GATE_NAME ( "AspDecOpCbGate" ) // name of GateMP used for circular buffer shared memory protection
#define ASP_DECODE_CB_GATE_REGION_ID ( 0 ) // IPC shared region ID used for CB gate allocation
-
// Decoder output circular buffer
typedef struct PAF_AST_DecOpCircBuf
{
#endif
} PAF_AST_DecOpCircBuf;
+// Decoder output circular buffer statistics
+typedef struct PAF_AST_DecOpCircBufStats
+{
+ Int32 readAfWriterInactiveCnt; // count of read audio frames with inactive writer & not draining
+ Int32 wrtAfReaderInactiveCnt; // count of write audio frames with inactive reader
+ Int32 wrtAfZeroSampsCnt; // count of write audio frames with zero samples
+ Int32 errUndCnt; // read error underflow count
+ Int32 errOvrCnt; // write error overflow count
+} PAF_AST_DecOpCircBufStats;
+
// Decoder output circular buffer control
typedef struct PAF_AST_DecOpCircBufCtl
{
Int8 cbIdx
);
+// Get circular buffer statistics
+Int cbGetStats(
+ PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
+ Int8 cbIdx, // decoder output circular buffer index
+ PAF_AST_DecOpCircBufStats *pCbStats // decoder output circular buffer statistics
+
+);
+
// Output log of circular buffer control variables (debug)
Int cbLog(
PAF_AST_DecOpCircBufCtl *pCbCtl,
char *locInfo
);
+
#endif /* _ASP_DECOP_CB_COMMON_H_ */