diff --git a/system/nxcamera/nxcamera.c b/system/nxcamera/nxcamera.c index 006a899be..ed68caf53 100644 --- a/system/nxcamera/nxcamera.c +++ b/system/nxcamera/nxcamera.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,25 @@ * Private Functions ****************************************************************************/ +/**************************************************************************** + * pan_display + ****************************************************************************/ + +static void pan_display(int fb_device, FAR struct fb_planeinfo_s *plane_info) +{ + struct pollfd pfd; + int ret; + pfd.fd = fb_device; + pfd.events = POLLOUT; + + ret = poll(&pfd, 1, 0); + + if (ret > 0) + { + ioctl(fb_device, FBIOPAN_DISPLAY, plane_info); + } +} + static int show_image(FAR struct nxcamera_s *pcam, FAR v4l2_buffer_t *buf) { #ifdef CONFIG_LIBYUV @@ -381,6 +401,11 @@ static void *nxcamera_loopthread(pthread_addr_t pvarg) goto err_out; } + if (pcam->display_pinfo.yres_virtual > pcam->display_vinfo.yres) + { + pan_display(pcam->display_fd, &pcam->display_pinfo); + } + ret = ioctl(pcam->capture_fd, VIDIOC_QBUF, (uintptr_t)&buf); if (ret < 0) {