I was using a dm816 board. I capture a 1080i video through tvp7002 and demo saLoopBackScale returns error. So i modified this demo.
I masked follow source code in saLoopBackScale demo, because it's interlaced and the VIDIOC_S_CROP and VIDIOC_S_FMT retrun error.
capt.crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
capt.crop.c.left = 0;
capt.crop.c.top = 0;
capt.crop.c.width = capt.fmt.fmt.pix.width;
capt.crop.c.height = capt.fmt.fmt.pix.height;
if (ioctl(capt.fd, VIDIOC_S_CROP, &capt.crop)) {
perror("cap VIDIOC_S_CROP fail:");
exit(2);
}
capt.fmt_win.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
capt.fmt_win.fmt.win.w.left = 0;
capt.fmt_win.fmt.win.w.top = 0;
capt.fmt_win.fmt.win.w.width = 720;
capt.fmt_win.fmt.win.w.height = 480;
if (ioctl(capt.fd, VIDIOC_S_FMT, &capt.fmt_win)) {
perror("Setting cap window format failed\n");
exit(2);
}
After these, the demo works well. Now, i want to user scaler.I find in video outpud driver file ti81xxvin_main.c, there is a defalut ioctl---TISET_SCALAR_PARAMS may be can enable sacling. It can enable scaling and de-interlacing. But, the question is, the cmd arg :
struct ti81xxvid_scalarparam {
int scalar_enable;
int inframe_width;
int inframe_height;
int yframe_offset;
int yframe_size;
int yoffset_flag;
int chroma_offset;
void *scoutbuf;
};
what value should i set ? It's really good to provide an example.
Anybody can help me? Thanks.
My sdk is ti-ezsdk_dm816x-evm_5_05_02_00.