Skip to content

Fix a whole slew of problems#66

Merged
davidnewhall merged 2 commits intomainfrom
dn2_level_2
Mar 3, 2026
Merged

Fix a whole slew of problems#66
davidnewhall merged 2 commits intomainfrom
dn2_level_2

Conversation

@davidnewhall
Copy link
Copy Markdown
Collaborator

  • Fixed command encoding bugs:
    • CameraArmMode values now serialize correctly as "0" / "1" in Toggle* camera methods.
  • Fixed PTZ behavior to match SecuritySpy spec:
    • Preset() now sends command 12-19.
    • PresetSave() now sends command 112-119.
    • PTZ capability bitmask updated so 16 = speed control, 32 = continuous movement, and added HasSpeed.
  • Fixed nil-safety and refresh hardening:
    • GetJPEG(nil) no longer panics.
    • Refresh() now handles nil PTZ safely and missing schedule/override IDs without unsafe assumptions.
  • Fixed transport behavior:
    • Post("++audio", ...) now correctly sets Content-Type: audio/g711-ulaw only for audio endpoint.
  • Hardened event lifecycle and concurrency:
    • Reworked watch/stop lifecycle with cancellation + waitgroup, idempotent stop/start behavior.
    • Removed close-driven event channel shutdown race.
    • Added synchronization around runtime watcher fields.
    • Improved scanner reconnect loop and scanner error handling.
    • Made event parsing robust for short/optional-info lines and corrected trigger parsing precedence.
  • Improved timeout/context behavior:
    • Get() / GetClient() now use bounded contexts.
    • Improved timeout fallback logic.
    • Added context-aware stream APIs:
      • StreamMJPGContext
      • StreamH264Context
      • StreamG711Context
    • Stream methods now use timeout-free clients for long-lived media streams.

@davidnewhall davidnewhall merged commit 7404811 into main Mar 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant