From 09b0353592a1f21a3eb940adc23aa058c34419ec Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 28 May 2021 13:54:20 -0400 Subject: [PATCH] Actually close the camera in localcamera::Close --- src/zm_local_camera.cpp | 6 ++++++ src/zm_local_camera.h | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp index 3ff3608c0..0679a5c5e 100644 --- a/src/zm_local_camera.cpp +++ b/src/zm_local_camera.cpp @@ -705,6 +705,12 @@ LocalCamera::~LocalCamera() { } // end LocalCamera::~LocalCamera +int LocalCamera::Close() { + if (device_prime && capture) + Terminate(); + return 0; +}; + void LocalCamera::Initialise() { Debug(3, "Opening video device %s", device.c_str()); //if ( (vid_fd = open( device.c_str(), O_RDWR|O_NONBLOCK, 0 )) < 0 ) diff --git a/src/zm_local_camera.h b/src/zm_local_camera.h index 6c64e39d6..7bbb285ac 100644 --- a/src/zm_local_camera.h +++ b/src/zm_local_camera.h @@ -153,8 +153,7 @@ public: int PreCapture() override; int Capture(std::shared_ptr &p) override; int PostCapture() override; - int Close() override { return 0; }; - + int Close() override; static bool GetCurrentSettings(const char *device, char *output, int version, bool verbose); };