examples/camera: fix build error and still capture logic

Add missing #include <sys/boardctl.h> in camera_bkgd.c to fix
implicit declaration of boardctl() and undeclared BOARDIOC_NX_START.

Also fix capture_num check in camera_main.c to only apply still
capture size enumeration when capture_type is STILL_CAPTURE.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3 2026-03-16 20:18:18 +08:00 committed by simbit18
parent 3a156581ca
commit 10056077f4
2 changed files with 2 additions and 1 deletions

View file

@ -33,6 +33,7 @@
#include <semaphore.h>
#include <errno.h>
#include <debug.h>
#include <sys/boardctl.h>
#include <arch/board/board.h>
#include <nuttx/nx/nx.h>

View file

@ -537,7 +537,7 @@ int main(int argc, FAR char *argv[])
* And all allocated memorys are VIDIOC_QBUFed.
*/
if (capture_num != 0)
if (capture_num != 0 && capture_type == V4L2_BUF_TYPE_STILL_CAPTURE)
{
/* Determine image size from connected image sensor name,
* because video driver does not support VIDIOC_ENUM_FRAMESIZES