⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bcc_feed.c

📁 Sample code for use on smp 863x processor.
💻 C
字号:
#include "bcc.h"#include "rmdef/rmdef.h"#define BCC_MAX_RUN	(255)#define CC_FEED_ENABLE	DISABLERMstatus bcc_feed(struct bcc *pbcc, struct RUA *pRUA, RMuint64 preroll){	RMstatus status = RM_OK;	RMbool keep_feeding = TRUE;	RMuint8 counter = 0;		while (keep_feeding)	{		if (pbcc->CCentry_consumed)		{			RMDBGLOG((CC_FEED_ENABLE, "Previous entry consumed, getting a new one.\n"));			status = rmbcc_get_next_entry(pbcc->bcc_parser, &pbcc->plast_CCentry);			if (RM_ERRORENDOFFILE == status)			{				RMDBGLOG((CC_FEED_ENABLE, "At end of file, no more entries to get.\n"));				keep_feeding = FALSE;			}			else			{				/* Not a hack (!): offsetting PTS by the preroll value */				if (pbcc->plast_CCentry.Pts <= preroll)				{					pbcc->plast_CCentry.Pts = 0;				}				else				{					pbcc->plast_CCentry.Pts -= preroll;				}				RMDBGLOG((CC_FEED_ENABLE, "Got new entry\n"));				pbcc->CCentry_consumed = FALSE;			}		}		/* else, an entry should already be available in pbcc->plast_CCentry */		if (! pbcc->CCentry_consumed)		{			status = RUASetProperty(pRUA, pbcc->ccfifo_id, RMCCFifoPropertyID_CCEntry,				&pbcc->plast_CCentry, sizeof pbcc->plast_CCentry, 0);			if (RM_PENDING != status)			{				RMDBGLOG((CC_FEED_ENABLE, 					"Entry successfully dumped into the FIFO.\n"));				pbcc->CCentry_consumed = TRUE;				counter += 1;			}			else			{				RMDBGLOG((CC_FEED_ENABLE, "FIFO full, keeping entry for later.\n"));				keep_feeding = FALSE;			}		}		if (counter >= BCC_MAX_RUN) keep_feeding = FALSE;	}	RMDBGLOG((ENABLE, "Fed %u entries to the FIFO.\n", counter));	return status;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -