From f109f3f569a65b30b7d0fd1dbd9dc1ad78664096 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 5 Apr 2022 21:01:31 +0200 Subject: [PATCH] Fix res factors --- cmd/camera.c | 4 ++-- csi_camera.sh | 5 +++++ opts/opts.h | 2 +- usb_camera.sh | 5 +++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 csi_camera.sh create mode 100755 usb_camera.sh diff --git a/cmd/camera.c b/cmd/camera.c index 3aa8ec3..11b5f9c 100644 --- a/cmd/camera.c +++ b/cmd/camera.c @@ -57,11 +57,11 @@ int camera_open(camera_t *camera) case V4L2_PIX_FMT_SRGGB10P: #if 1 - if (camera_configure_isp(camera, 1, 0) < 0) { + if (camera_configure_isp(camera, camera->options.high_res_factor, camera->options.low_res_factor) < 0) { goto error; } #else - if (camera_configure_legacy_isp(&camera, 1.3) < 0) { + if (camera_configure_legacy_isp(&camera, camera->options.high_res_factor) < 0) { goto error; } #endif diff --git a/csi_camera.sh b/csi_camera.sh new file mode 100755 index 0000000..87e4775 --- /dev/null +++ b/csi_camera.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -xeo pipefail +make +./camera_stream -camera-path /dev/v4l/by-path/*.csi-video-index0 "$@" diff --git a/opts/opts.h b/opts/opts.h index e3db6db..3b1759f 100644 --- a/opts/opts.h +++ b/opts/opts.h @@ -32,7 +32,7 @@ typedef struct options_s { #define OPTION_FORMAT_uint "%d" #define OPTION_FORMAT_hex "%08x" #define OPTION_FORMAT_bool "%d" -#define OPTION_FORMAT_float "%.1f" +#define OPTION_FORMAT_float "%f" #define OPTION_FORMAT_string "%s" #define DEFINE_OPTION(_section, _name, _type) \ diff --git a/usb_camera.sh b/usb_camera.sh new file mode 100755 index 0000000..8f65d99 --- /dev/null +++ b/usb_camera.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -xeo pipefail +make +./camera_stream -camera-path /dev/v4l/by-id/usb-*-video-index0 "$@"