是这样的,我自行设计的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);
}
}