summaryrefslogtreecommitdiffhomepage
path: root/video-ps3eye/module.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-09-03 22:34:18 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-09-03 22:34:30 +0200
commiteff4fbd1d77b84829ab0f9f14593b12246e3fcdd (patch)
treea647a8dc8272b9bfb1d22f33222ad34080ae3f30 /video-ps3eye/module.cpp
parent318616903f4f3540c74b1cccb84aa394b2a05f10 (diff)
video, video/ps3eye: allow setting camera's channel count
Diffstat (limited to 'video-ps3eye/module.cpp')
-rw-r--r--video-ps3eye/module.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/video-ps3eye/module.cpp b/video-ps3eye/module.cpp
index 25d82170..4279d68d 100644
--- a/video-ps3eye/module.cpp
+++ b/video-ps3eye/module.cpp
@@ -157,7 +157,7 @@ bool ps3eye_camera::start(info& args)
open = false;
fr = {};
- fr.channels = 1;
+ fr.channels = args.num_channels == 1 ? 1 : 3;
fr.channel_size = 1;
if (!args.width || args.width > 320)
@@ -175,6 +175,7 @@ bool ps3eye_camera::start(info& args)
ptr.in.framerate = (uint8_t)std::clamp(args.fps, 30, 187);
ptr.in.gain = (uint8_t)s.gain;
ptr.in.exposure = (uint8_t)s.exposure;
+ ptr.in.channels = args.num_channels == 1 ? 1 : 3;
sleep_ms = std::clamp(int(std::floor(450./ptr.in.framerate)), 1, 10);