DM648 FVID_exchange失败的问题

2019-03-26 15:18发布

是这样的,我自行设计的DM648的图像处理系统,编解码方案是TVP5150*2和SAA7121,编解码芯片的驱动程序是基于实验室原有的DM642的配套驱动修改的。程序的主体是参照DVSDK中的例程video_preview写的,经过调试大部分代码已经调通,但是在最后FVID_exchange的位置,程序卡住了。经过调试发现,FVID_exchange调用的子函数mdSubmitChan的返回值是IOM_PENDING,函数中的注释解释道“This call will wait at GIO layer, when there will be new buffer available with driver, GIO layer callback will be called”,但是我的程序就卡在这个函数的结束了。请问这是什么问题呢?谢谢void video_preview(void) {
FVID_Frame *frameBuffPtr = NULL;
FVID_Handle disChan, capChan;int status = 0;
int i;
/* Assign EDMA driver handle to channel params */
vCapParamsChan.hEdma = hEdma;
vDisParamsChan.hEdma = hEdma;
/* allocate both capture and display frame buffers in external heap */
vCapParamsChan.segId = DDR2;
vDisParamsChan.segId = DDR2;
/*
* Setting num frame buffers to zero signals the video drivers to allow
* the application to own the buffers.
*/
vCapParamsChan.numFrmBufs = 0;
vDisParamsChan.numFrmBufs = 0;
/* create video input channel */
if (status == 0) {
capChan = FVID_create("/VP0CAPTURE/A/0", /* VP0, Channel A, External Decoder 0 */
IOM_INPUT, &status, (Ptr)&vCapParamsChan, NULL);
}
/* create video output channel, plane 0 */
if (status == 0) {
disChan = FVID_create("/VP1DISPLAY/SAA7105", IOM_OUTPUT, /* VP1, External Encoder 0 */
&status, (Ptr)&vDisParamsChan, NULL);
}
/* allocate and prime frame buffers for the capture channel */
if (status == 0) {
for (i=0; i < FRAME_BUFF_CNT && status == 0; i++) {
status = FVID_allocBuffer(capChan, &frameBuffPtr);
if (status == IOM_COMPLETED) {
status = FVID_queue(capChan, &frameBuffPtr);
}
}
}
/* allocate and prime frame buffers for the display channel */
if (status == 0) {
for (i=0; i < FRAME_BUFF_CNT && status == 0; i++) {
status = FVID_allocBuffer(disChan, &frameBuffPtr);
if (status == IOM_COMPLETED) {
status = FVID_queue(disChan, &frameBuffPtr);
}
}
}
/* configure the TVP5146 video decoder */
if (status == 0) {
/* configure video encoder & decoder */
FVID_control(disChan, VPORT_CMD_EDC_BASE + EDC_CONFIG,
(Ptr)&vDisParamsSAA7105);
FVID_control(capChan, VPORT_CMD_EDC_BASE + EDC_CONFIG,
(Ptr)&vCapParamsTVP51XX);
/* start capture & display operation */
FVID_control(disChan, VPORT_CMD_START, NULL);
FVID_control(capChan, VPORT_CMD_START, NULL);
}
/* grab first buffer from input queue */
if (status == 0) {
FVID_dequeue(disChan, &frameBuffPtr);
}
/* loop forever performing video capture and display */
while (status == 0) {
/* grab a fresh video input frame */
FVID_exchange(capChan, &frameBuffPtr);
/* display the video frame */
FVID_exchange(disChan, &frameBuffPtr);
}
}
此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
1条回答
电子微创意
1楼-- · 2019-03-26 18:47
< 帮忙顶一下

一周热门 更多>