This commit is contained in:
capitalistspz 2025-03-28 21:27:38 +00:00
parent 95f5295e0c
commit 791e358bf7
2 changed files with 3 additions and 2 deletions

View file

@ -12,6 +12,7 @@ CameraManager::CameraManager()
m_nv12Buffer(CAMERA_PITCH * CAMERA_HEIGHT * 3 / 2), m_nv12Buffer(CAMERA_PITCH * CAMERA_HEIGHT * 3 / 2),
m_refCount(0) m_refCount(0)
{ {
// Set default device if it exists
if (Cap_getDeviceCount(m_ctx) > 0) if (Cap_getDeviceCount(m_ctx) > 0)
m_device = 0; m_device = 0;
} }
@ -21,7 +22,7 @@ CameraManager::~CameraManager()
Cap_releaseContext(m_ctx); Cap_releaseContext(m_ctx);
} }
void CameraManager::SetDevice(unsigned deviceNo) void CameraManager::SetDevice(uint32 deviceNo)
{ {
std::scoped_lock lock(m_mutex); std::scoped_lock lock(m_mutex);
if (m_device == deviceNo) if (m_device == deviceNo)

View file

@ -19,7 +19,7 @@ class CameraManager : public Singleton<CameraManager>
CameraManager(); CameraManager();
~CameraManager(); ~CameraManager();
void SetDevice(unsigned deviceNo); void SetDevice(uint32 deviceNo);
bool Open(bool weak); bool Open(bool weak);
void Close(); void Close();