diff --git a/capturevpedisplay.c b/capturevpedisplay.c
index 15a308887b874ac963046d5090a52b9833e06c43..0b86d3b19923268769e671e5c18ae2adbc7aac1d 100644 (file)
--- a/capturevpedisplay.c
+++ b/capturevpedisplay.c
fmt.fmt.pix.width = width;
fmt.fmt.pix.height = height;
fmt.fmt.pix.pixelformat = fourcc;
+ fmt.fmt.pix.field = V4L2_FIELD_ALTERNATE;
ret = ioctl(vipfd, VIDIOC_S_FMT, &fmt);
if (ret < 0)
* @return: buf.index int
*****************************************************************************
*/
-int vip_dqbuf()
+int vip_dqbuf(struct vpe * vpe)
{
int ret;
struct v4l2_buffer buf;
if (ret < 0)
pexit("vip: DQBUF failed: %s\n", strerror(errno));
- dprintf("vip: DQBUF index = %d\n", buf.index);
+ dprintf("vip: DQBUF idx = %d, field = %s\n", buf.index,
+ buf.field == V4L2_FIELD_TOP? "Top" : "Bottom");
+ vpe->field = buf.field;
return buf.index;
}
vpe->field = V4L2_FIELD_ANY;
while (1)
{
- index = vip_dqbuf();
+ index = vip_dqbuf(vpe);
vpe_input_qbuf(vpe, index);
for (i = 1; i <= NUMBUF; i++) {
/** To star deinterlace, minimum 3 frames needed */
if (vpe->deint && count != 3) {
- index = vip_dqbuf();
+ index = vip_dqbuf(vpe);
vpe_input_qbuf(vpe, index);
} else {
stream_ON(vpe->fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);