- Change pull_timeout and subscription_timeout from std::string (ISO 8601)
to int (seconds) for simpler configuration and cleaner code
- Add deprecation warning when PT prefix is detected in option values
- Add FormatDurationSeconds() helper to construct ISO 8601 strings for SOAP
- Use zm_utils.h functions: Split(), PairSplit(), StartsWith()
- Remove unused parse_iso8601_duration_seconds() function
New option format: pull_timeout=5,subscription_timeout=300
Old format (deprecated): pull_timeout=PT5S,subscription_timeout=PT300S
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Increase ONVIF_RENEWAL_ADVANCE_SECONDS from 20s to 60s to give more
buffer time before subscription expiration
- Reduce default pull_timeout from PT10S to PT5S for more responsive
event polling
- Fix pull_timeout adjustment logic to dynamically construct the timeout
string based on ONVIF_RENEWAL_ADVANCE_SECONDS instead of hardcoding
- Update fallback timeout from PT8S to PT5S for consistency
- Clean up SOAP_STRINGS array formatting
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Convert alarmed and healthy from plain bool to std::atomic<bool> to
fix data races between the ONVIF polling thread and the analysis thread.
Changes:
- Rename alarmed -> alarmed_, healthy -> healthy_ (atomic naming convention)
- Use memory_order_acquire for loads, memory_order_release for stores
- Remove unnecessary mutex lock from isAlarmed() (atomic is sufficient)
- Add const qualifier to isAlarmed() and isHealthy() accessors
The alarms_mutex is retained for protecting the alarms map operations.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move ONVIF polling from shared Poll() loop (10s cadence) to dedicated
thread with 500ms cadence. This reduces worst-case ONVIF event latency
from ~10 seconds to ~500ms.
Changes:
- Add thread management to ONVIF class (thread_, terminate_, Run())
- Launch polling thread in start() after successful subscription
- Stop thread in destructor before SOAP cleanup
- Remove ONVIF handling from Monitor::Poll()
- Call onvif->start() immediately after creation in Monitor::connect()
- Increase default pull_timeout from PT5S to PT10S for better listening window
The ONVIF thread handles its own reconnection when unhealthy. Other
managers (Amcrest, RTSP2Web, Go2RTC, Janus) remain on 10s Poll() cadence.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add SharedData field and methods to track when analysis images are being
viewed, mirroring the existing last_viewed_time functionality. This allows
the analysis process to know if someone is actively viewing analysis images.
- Add last_analysis_viewed_time to SharedData struct
- Add getLastAnalysisViewed(), setLastAnalysisViewed(), hasAnalysisViewers()
- Update MonitorStream to set flag when streaming FRAME_ANALYSIS
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>