Recover camera capture and release mmap buffers before reconnecting

This commit is contained in:
zmv
2026-09-23 21:59:08 +08:00
parent 713bfd3672
commit a35e4a1754
16 changed files with 649 additions and 9 deletions
+19
View File
@@ -0,0 +1,19 @@
#pragma once
// Camera timeout tests exercise live capture only. Stub the unused replay API
// so the use-can Camera can be tested without OpenCV or a video decoder.
#include <stdexcept>
#include <string>
namespace cv {
constexpr int CAP_PROP_FRAME_WIDTH=3,CAP_PROP_FRAME_HEIGHT=4;
struct Mat {
int cols{},rows{};
unsigned char const* ptr(int)const {throw std::logic_error("Video replay is outside this test");}
};
class VideoCapture {
public:
bool isOpened()const{return false;}
bool open(std::string const&){throw std::logic_error("Video replay is outside this test");}
double get(int)const {throw std::logic_error("Video replay is outside this test");}
bool read(Mat&){throw std::logic_error("Video replay is outside this test");}
};
}