This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 201a57440 system/nxcamera: add pan_display when it is not single
buffer.
201a57440 is described below
commit 201a57440c135c23cb71f7041ff8fc3f4580f282
Author: jianglianfang <[email protected]>
AuthorDate: Tue Aug 22 15:12:26 2023 +0800
system/nxcamera: add pan_display when it is not single buffer.
After optimizing the vync mechanism, it is necessary to use ioctl (display)
to refresh the display in dual buffer mode.
run nxcamera.
Signed-off-by: jianglianfang <[email protected]>
---
system/nxcamera/nxcamera.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
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 <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <poll.h>
#include <nuttx/queue.h>
#include <nuttx/video/video.h>
@@ -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)
{