INNER CODE UNIT · Python
_can_run_stream
yihong1120/Construction-Hazard-Detection · main.py:433
def _can_run_stream(
cfg: StreamConfig,
) -> bool:
"""Return whether capture and MediaMTX publishing should stay active.
Working hours are enforced inside the stream processor only for
violation records and notifications. Live capture and playback remain
available whenever recognition is enabled and the stream is valid.
"""
if not cfg.get('recognition_enabled', True):
return False
return not is_expired(cfg.get('expire_date'))
def start_process(self, cfg: StreamConfig) -> Process:
"""Launch a new child process to handle stream detection.
Args:
cfg (StreamConfig): Configuration for the stream.