summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/module/camera.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-08-29 03:15:32 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-08-29 03:54:17 +0200
commite2405afeae0adfa32bde63a182e5f605ac8e8f16 (patch)
treeaa5f8ddcfd289cca521915a0487538e3cdf3f3b6 /tracker-pt/module/camera.cpp
parent48d1d1a06eb6acad0b0f436dcc73a19b408edb32 (diff)
tracker/pt, video/opencv: allow mjpeg media type
Diffstat (limited to 'tracker-pt/module/camera.cpp')
-rw-r--r--tracker-pt/module/camera.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tracker-pt/module/camera.cpp b/tracker-pt/module/camera.cpp
index 99bea617..62b23ea9 100644
--- a/tracker-pt/module/camera.cpp
+++ b/tracker-pt/module/camera.cpp
@@ -77,6 +77,7 @@ bool Camera::start(const pt_settings& s)
{
int fps = s.cam_fps, res_x = s.cam_res_x, res_y = s.cam_res_y;
QString name = s.camera_name;
+ bool use_mjpeg = s.use_mjpeg;
if (fps >= 0 && res_x >= 0 && res_y >= 0)
{
@@ -84,15 +85,17 @@ bool Camera::start(const pt_settings& s)
(int)cam_desired.fps != fps ||
cam_desired.res_x != res_x ||
cam_desired.res_y != res_y ||
+ cam_desired.use_mjpeg != use_mjpeg ||
!cap || !cap->is_open())
{
stop();
cam_desired.name = name;
- cam_desired.fps = fps;
+ cam_desired.fps = (f)fps;
cam_desired.res_x = res_x;
cam_desired.res_y = res_y;
cam_desired.fov = fov;
+ cam_desired.use_mjpeg = use_mjpeg;
cap = video::make_camera(name);
@@ -103,12 +106,15 @@ bool Camera::start(const pt_settings& s)
info.fps = fps;
info.width = res_x;
info.height = res_y;
+ info.use_mjpeg = use_mjpeg;
if (!cap->start(info))
goto fail;
cam_info = pt_camera_info();
cam_info.name = name;
+ cam_info.use_mjpeg = use_mjpeg;
+ cam_info.fov = (f)s.fov;
dt_mean = 0;
cv::Mat tmp;