Admit onboard camera preview only after its acquisition producer is ready
This commit is contained in:
@@ -970,7 +970,9 @@ class XgridsK1CameraGateway:
|
||||
)
|
||||
return self.snapshot()
|
||||
|
||||
def open_delivery(self, generation: int) -> CameraProcessLease:
|
||||
def open_delivery(
|
||||
self, generation: int, *, require_recording: bool = False
|
||||
) -> CameraProcessLease:
|
||||
with self._lifecycle_lock:
|
||||
with self._lock:
|
||||
self._require_open_locked()
|
||||
@@ -978,6 +980,8 @@ class XgridsK1CameraGateway:
|
||||
raise ValueError("camera preview generation не активно")
|
||||
producer = self._producer
|
||||
recording_active = self._recording_root is not None
|
||||
if require_recording and (not recording_active or producer is None):
|
||||
raise RuntimeError("camera acquisition producer is not ready")
|
||||
if producer is None:
|
||||
# An acquisition owns its producer lifecycle. Once an epoch is
|
||||
# sealed, a disposable browser reconnect must not resurrect the
|
||||
|
||||
Reference in New Issue
Block a user