You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/03/13 01:52:50 UTC
(nuttx-apps) branch master updated: camera_example: modify initialize interface after v4l2 refactor
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang 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 a00ba19eb camera_example: modify initialize interface after v4l2 refactor
a00ba19eb is described below
commit a00ba19eb4fc92e516e0f7fff5075f389c34f142
Author: shizhenghui <sh...@xiaomi.com>
AuthorDate: Tue Dec 5 16:46:30 2023 +0800
camera_example: modify initialize interface after v4l2 refactor
Signed-off-by: shizhenghui <sh...@xiaomi.com>
---
examples/camera/camera_main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/examples/camera/camera_main.c b/examples/camera/camera_main.c
index 81c7f8d79..759ffc572 100644
--- a/examples/camera/camera_main.c
+++ b/examples/camera/camera_main.c
@@ -35,6 +35,7 @@
#include <unistd.h>
#include <nuttx/video/video.h>
+#include <nuttx/video/v4l2_cap.h>
#include "camera_fileutil.h"
#include "camera_bkgd.h"
@@ -59,6 +60,8 @@
#define APP_STATE_UNDER_CAPTURE (1)
#define APP_STATE_AFTER_CAPTURE (2)
+#define CAMERA_DEV_PATH "/dev/video10"
+
/****************************************************************************
* Private Types
****************************************************************************/
@@ -500,7 +503,7 @@ int main(int argc, FAR char *argv[])
/* Initialize video driver to create a device file */
- ret = video_initialize("/dev/video");
+ ret = capture_initialize(CAMERA_DEV_PATH);
if (ret != 0)
{
printf("ERROR: Failed to initialize video: errno = %d\n", errno);
@@ -758,7 +761,7 @@ exit_this_app:
free_buffer(buffers_still, STILL_BUFNUM);
exit_without_cleaning_buffer:
- video_uninitialize("/dev/video");
+ capture_uninitialize(CAMERA_DEV_PATH);
exit_without_cleaning_videodriver:
#ifdef CONFIG_EXAMPLES_CAMERA_OUTPUT_LCD