|
@@ -175,11 +175,20 @@ public:
|
|
|
|
|
|
|
|
~ScopedCameraOperationLock()
|
|
~ScopedCameraOperationLock()
|
|
|
{
|
|
{
|
|
|
- if (m_acquired) xSemaphoreGiveRecursive(m_mutex);
|
|
|
|
|
|
|
+ release();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool acquired() const { return m_acquired; }
|
|
bool acquired() const { return m_acquired; }
|
|
|
|
|
|
|
|
|
|
+ void release()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (m_acquired)
|
|
|
|
|
+ {
|
|
|
|
|
+ xSemaphoreGiveRecursive(m_mutex);
|
|
|
|
|
+ m_acquired = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private:
|
|
private:
|
|
|
SemaphoreHandle_t m_mutex;
|
|
SemaphoreHandle_t m_mutex;
|
|
|
bool m_acquired;
|
|
bool m_acquired;
|
|
@@ -234,8 +243,21 @@ public:
|
|
|
|
|
|
|
|
~ScopedCameraCaptureIndicators()
|
|
~ScopedCameraCaptureIndicators()
|
|
|
{
|
|
{
|
|
|
- if (m_flashLed) m_camera.SetCaptureFlashActive(false);
|
|
|
|
|
- if (m_statusLed) m_camera.SetCaptureStatusLedActive(false);
|
|
|
|
|
|
|
+ release();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ void release()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (m_flashLed)
|
|
|
|
|
+ {
|
|
|
|
|
+ m_camera.SetCaptureFlashActive(false);
|
|
|
|
|
+ m_flashLed = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (m_statusLed)
|
|
|
|
|
+ {
|
|
|
|
|
+ m_camera.SetCaptureStatusLedActive(false);
|
|
|
|
|
+ m_statusLed = false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ScopedCameraCaptureIndicators(const ScopedCameraCaptureIndicators &) = delete;
|
|
ScopedCameraCaptureIndicators(const ScopedCameraCaptureIndicators &) = delete;
|