dm8127 dsp edma 拷貝資料
edma簡介
http://blog.sina.com.cn/s/blog_4512a68501000ah4.html
http://blog.sina.com.cn/s/blog_4512a68501000ah3.html
/* FD link copy frames */
/* ===================================================================
* @func FdLink_copyFrames
*
* @desc Function does the following
*
* @modif This function modifies the following structures
*
* @inputs This function takes the following inputs
* <argument name>
* Description of usage
* <argument name>
* Description of usage
*
* @outputs <argument name>
* Description of usage
*
* @return Return value of this function if any
* ==================================================================
*/
Int32 FdLink_copyFrames(FdLink_Obj * pObj)
{
Int32 status;
Int32 frameId;
UInt32 edmaWidth, edmaHeight;
FVID2_Frame *pEmptyFrame;
FVID2_Frame *pFullFrame;
FVID2_FrameList frameList;
System_LinkInQueParams *pInQueParams;
/* Get the full frames from the previous link */
pInQueParams = &pObj->createArgs.inQueParams;
System_getLinksFullFrames(pInQueParams->prevLinkId,
pInQueParams->prevLinkQueId, &frameList);
if (frameList.numFrames)
{
for (frameId = 0; frameId < frameList.numFrames; frameId++)
{
/* Post Frame Sync SWOSD sem */
SwosdLink_postFrameSyncSem(pObj->createArgs.swOsdId);
/* Get the FD empty bufs if any */
status =
Utils_bufGetEmptyFrame(&pObj->outFrameQue, &pEmptyFrame,
BIOS_NO_WAIT);
if ((status == FVID2_SOK) && (pEmptyFrame != NULL))
{
pFullFrame = frameList.frames[frameId];
/* copy the frame */
edmaWidth = pObj->algHndl.fdWidth;
edmaHeight = pObj->algHndl.fdHeight;
pEmptyFrame->timeStamp = pFullFrame->timeStamp;
<span style="color:#ff0000;"> /* copy only Y plane as FD works only on Y plane */
DM81XX_EDMA3_setParams(FD_LINK_EDMA3_CH_ID, // chId
FD_LINK_EDMA3_QUEUE_ID, // dmaQueue
(UInt32) pFullFrame->addr[0][0], // srcAddr
(UInt32) pEmptyFrame->addr[0][0], // dstAddr
edmaWidth, // edmaWidth
edmaHeight, // edmaHeight
edmaWidth, // srcLineOffset
edmaWidth); // dstLineOffset
/* Trigger the edma transfer */
DM81XX_EDMA3_triggerTransfer(FD_LINK_EDMA3_CH_ID);
</span> /* put the buffer into full queue */
status = Utils_bufPutFullFrame(&pObj->outFrameQue, pEmptyFrame);
UTILS_assert(status == FVID2_SOK);
}
}
/* Put the full buffers bacl to previous link */
System_putLinksEmptyFrames(pInQueParams->prevLinkId,
pInQueParams->prevLinkQueId, &frameList);
}
return FVID2_SOK;
}
Int32 VaLink_algCopyFrames(VaLink_Obj *pObj)
{
Int32 status;
Int32 ret = FVID2_EFAIL;
Int32 frameId;
UInt32 edmaWidth, edmaHeight;
FVID2_Frame *pEmptyFrame;
FVID2_Frame *pFullFrame;
FVID2_FrameList frameList;
System_LinkInQueParams *pInQueParams;
VaLink_algObj *pAlgObj = &pObj->algObj;
/* Get the full frames from the previous link */
pInQueParams = &pObj->createArgs.inQueParams;
System_getLinksFullFrames(pInQueParams->prevLinkId,
pInQueParams->prevLinkQueId, &frameList);
if (frameList.numFrames)
{
for (frameId = 0; frameId < frameList.numFrames; frameId++)
{
if(Utils_doSkipFrame(&pAlgObj->frameSkipContext) == FALSE)
{
/* Get the VA empty bufs if any */
status = Utils_bufGetEmptyFrame(&pObj->outFrameQue, &pEmptyFrame,BIOS_NO_WAIT);
if ((status == FVID2_SOK) && (pEmptyFrame != NULL))
{
pFullFrame = frameList.frames[frameId];
/* copy the frame */
edmaWidth = pObj->inQueInfo.chInfo[0].width;
edmaHeight = pObj->inQueInfo.chInfo[0].height;
/* copy Y plane */
<span style="color:#ff0000;">DM81XX_EDMA3_setParams(VA_LINK_EDMA3_CH_ID,</span> // chId
VA_LINK_EDMA3_QUEUE_ID, // dmaQueue
(UInt32)pFullFrame->addr[0][0], // srcAddr
(UInt32)pEmptyFrame->addr[0][0], // dstAddr
edmaWidth, // edmaWidth
edmaHeight, // edmaHeight
edmaWidth, // srcLineOffset
edmaWidth); // dstLineOffset
<span style="color:#ff0000;">/* Trigger the edma transfer */
DM81XX_EDMA3_triggerTransfer(VA_LINK_EDMA3_CH_ID);
</span> pEmptyFrame->timeStamp = pFullFrame->timeStamp;
/* put the buffer into full queue */
status = Utils_bufPutFullFrame(&pObj->outFrameQue, pEmptyFrame);
UTILS_assert(status == FVID2_SOK);
ret = FVID2_SOK;
}
}
}
/* Put the full buffers bacl to previous link */
System_putLinksEmptyFrames(pInQueParams->prevLinkId,
pInQueParams->prevLinkQueId, &frameList);
}
return ret;
}
相關文章
- DM8127如何利用EDMA搬移資料
- js資料型別賦值,淺拷貝,深拷貝JS資料型別賦值
- JavaScript資料型別AND深拷貝和淺拷貝的不歸路JavaScript資料型別
- vue深拷貝淺拷貝Vue
- python 指標拷貝,淺拷貝和深拷貝Python指標
- 一文搞懂Java引用拷貝、淺拷貝、深拷貝Java
- jquery之物件拷貝深拷貝淺拷貝案例講解jQuery物件
- C++拷貝建構函式(深拷貝,淺拷貝)C++函式
- iOS深拷貝和淺拷貝iOS
- JS深拷貝與淺拷貝JS
- Java深拷貝和淺拷貝Java
- 物件深拷貝和淺拷貝物件
- javascript 淺拷貝VS深拷貝JavaScript
- JavaScript 深度拷貝和淺拷貝JavaScript
- JavaScript深拷貝和淺拷貝JavaScript
- js 淺拷貝和深拷貝JS
- js 深拷貝和淺拷貝JS
- JavaScript淺拷貝和深拷貝JavaScript
- js深拷貝和淺拷貝JS
- js 深拷貝 vs 淺拷貝JS
- 淺談深拷貝與淺拷貝?深拷貝幾種方法。
- 深究cp拷貝資料夾時`/`的用法
- 資料型別、記憶體與拷貝資料型別記憶體
- hadoop叢集遠端拷貝資料Hadoop
- C++淺拷貝和深拷貝C++
- 深拷貝、淺拷貝與Cloneable介面
- 賦值、淺拷貝與深拷貝賦值
- 實現物件淺拷貝、深拷貝物件
- Python淺拷貝與深拷貝Python
- go slice深拷貝和淺拷貝Go
- JavaScript之深拷貝和淺拷貝JavaScript
- js的深拷貝和淺拷貝JS
- 聊聊物件深拷貝和淺拷貝物件
- ECMAScript-淺拷貝和深拷貝
- python深拷貝與淺拷貝Python
- js之淺拷貝和深拷貝JS
- 深度解析深拷貝和淺拷貝
- Objective C淺拷貝和深拷貝Object