This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

在video_preview例程想使用ccs 3.3的view中的image来查看图像

Other Parts Discussed in Thread: TVP5151, TVP5158

平台是6437和ccs3.3以下是我的代码:

void main() {

printf("Video Preview Application\n");
fflush(stdout);

/* VPSS PinMuxing */
/* CI10SEL - No CI[1:0] */
/* CI32SEL - No CI[3:2] */
/* CI54SEL - No CI[5:4] */
/* CI76SEL - No CI[7:6] */
/* CFLDSEL - No C_FIELD */
/* CWENSEL - No C_WEN */
/* HDVSEL - CCDC HD and VD enabled */
/* CCDCSEL - CCDC PCLK, YI[7:0] enabled */
/* AEAW - EMIFA full address mode */
/* VPBECKEN - VPBECLK enabled */
/* RGBSEL - No digital outputs */
/* CS3SEL - LCD_OE/EM_CS3 disabled */
/* CS4SEL - CS4/VSYNC enabled */
/* CS5SEL - CS5/HSYNC enabled */
/* VENCSEL - VCLK,YOUT[7:0],COUT[7:0] enabled */
/* AEM - 8bEMIF + 8bCCDC + 8 to 16bVENC */
sysModuleRegs -> PINMUX0 &= (0x005482A3u);
sysModuleRegs -> PINMUX0 |= (0x005482A3u);

/* PCIEN = 0: PINMUX1 - Bit 0 */
sysModuleRegs -> PINMUX1 &= (0xFFFFFFFEu);
sysModuleRegs -> VPSSCLKCTL = (0x18u);

// Reset TVP5151
FI1206_GPIO_init();
FI1206_GPIO_setDir(GPIO03,0);
FI1206_GPIO_setOutput(GPIO03,0);
_waitusec( 800000 );
FI1206_GPIO_setOutput(GPIO03,1);
_waitusec( 800000 );

return;
}

/*
* ======== video_preview ========
*/
void video_preview(void) {

FVID_Frame *frameBuffTable[FRAME_BUFF_CNT];
FVID_Frame *frameBuffPtr;
GIO_Handle hGioVpfeCcdc;
GIO_Handle hGioVpbeVid0;
GIO_Handle hGioVpbeVenc;
int status = 0;
int result;
int i;
int standard;
int width;
int height;

/* Set video display/capture driver params to defaults */
PSP_VPFE_TVP5151_ConfigParams tvp5151Params = VID_PARAMS_TVP5151_DEFAULT;
PSP_VPFECcdcConfigParams vpfeCcdcConfigParams= VID_PARAMS_CCDC_DEFAULT_D1;
PSP_VPBEOsdConfigParams vpbeOsdConfigParams = VID_PARAMS_OSD_DEFAULT_D1;
PSP_VPBEVencConfigParams vpbeVencConfigParams;

standard = STANDARD_PAL;

/* Update display/capture params based on video standard (PAL/NTSC) */
if (standard == STANDARD_PAL) {
width = 720;
height = 576;
vpbeVencConfigParams.displayStandard = PSP_VPBE_DISPLAY_PAL_INTERLACED_COMPOSITE;
}
else {
width = 720;
height = 480;
vpbeVencConfigParams.displayStandard = PSP_VPBE_DISPLAY_NTSC_INTERLACED_COMPOSITE;
}
vpfeCcdcConfigParams.height = vpbeOsdConfigParams.height = height;
vpfeCcdcConfigParams.width = vpbeOsdConfigParams.width = width;
vpfeCcdcConfigParams.pitch = vpbeOsdConfigParams.pitch = width * 2;

/* init the frame buffer table */
for (i=0; i<FRAME_BUFF_CNT; i++) {
frameBuffTable[i] = NULL;
}

/* create video input channel */
if (status == 0) {
PSP_VPFEChannelParams vpfeChannelParams;
vpfeChannelParams.id = PSP_VPFE_CCDC;
vpfeChannelParams.params = (PSP_VPFECcdcConfigParams*)&vpfeCcdcConfigParams;
hGioVpfeCcdc = FVID_create("/VPFE0",IOM_INOUT,NULL,&vpfeChannelParams,NULL);
status = (hGioVpfeCcdc == NULL ? -1 : 0);
}

/* create video output channel, plane 0 */
if (status == 0) {
PSP_VPBEChannelParams vpbeChannelParams;
vpbeChannelParams.id = PSP_VPBE_VIDEO_0;
vpbeChannelParams.params = (PSP_VPBEOsdConfigParams*)&vpbeOsdConfigParams;
hGioVpbeVid0 = FVID_create("/VPBE0",IOM_INOUT,NULL,&vpbeChannelParams,NULL);
status = (hGioVpbeVid0 == NULL ? -1 : 0);
}

/* create video output channel, venc */
if (status == 0) {
PSP_VPBEChannelParams vpbeChannelParams;
vpbeChannelParams.id = PSP_VPBE_VENC;
vpbeChannelParams.params = (PSP_VPBEVencConfigParams *)&vpbeVencConfigParams;
hGioVpbeVenc = FVID_create("/VPBE0",IOM_INOUT,NULL,&vpbeChannelParams,NULL);
status = (hGioVpbeVenc == NULL ? -1 : 0);
}

/* configure the TVP5158 video decoder */
if (status == 0) {
result = FVID_control(hGioVpfeCcdc, VPFE_ExtVD_BASE+PSP_VPSS_EXT_VIDEO_DECODER_CONFIG, &tvp5151Params);
status = (result == IOM_COMPLETED ? 0 : -1);
}

/* allocate some frame buffers */
if (status == 0) {
for (i=0; i<FRAME_BUFF_CNT && status == 0; i++) {
result = FVID_allocBuffer(hGioVpfeCcdc, &frameBuffTable[i]);
status = (result == IOM_COMPLETED && frameBuffTable[i] != NULL ? 0 : -1);
}
}

/* prime up the video capture channel */
if (status == 0) {
FVID_queue(hGioVpfeCcdc, frameBuffTable[0]);
FVID_queue(hGioVpfeCcdc, frameBuffTable[1]);
FVID_queue(hGioVpfeCcdc, frameBuffTable[2]);
}

/* prime up the video display channel */
if (status == 0) {
FVID_queue(hGioVpbeVid0, frameBuffTable[3]);
FVID_queue(hGioVpbeVid0, frameBuffTable[4]);
FVID_queue(hGioVpbeVid0, frameBuffTable[5]);
}

/* grab first buffer from input queue */
if (status == 0) {
FVID_dequeue(hGioVpfeCcdc, &frameBuffPtr);
}

/* loop forever performing video capture and display */
while ( status == 0 ) {

/* grab a fresh video input frame */
FVID_exchange(hGioVpfeCcdc, &frameBuffPtr);

/* display the video frame */
FVID_exchange(hGioVpbeVid0, &frameBuffPtr);

}

我在最后的FVID_exchange处设断点想查看frameBuffPtr中的缓存帧但是不成功求指导