Commit Graph

6285 Commits (copilot/generate-release-notes-overview)

Author SHA1 Message Date
Isaac Connor eae89025ee refactor: rename RTSP2WebStream to StreamChannel
Rename applies to Go2RTC, Janus, and RTSP2Web streaming options.
Update enum values from Primary/Secondary to Restream/CameraDirectPrimary/CameraDirectSecondary.

- Add db migration zm_update-1.37.79.sql to rename column and migrate data
- Update C++ enum StreamChannelOption and member stream_channel
- Update PHP getStreamChannelOptions() method
- Update all JavaScript references
- Auto-select CameraDirectPrimary when Restream option becomes disabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:37:08 -05:00
Isaac Connor d89f2e59db refactor: rename Janus_Use_RTSP_Restream to Restream
Rename Janus-specific restream fields to be more generic since they are
now used by Go2RTC and RTSP2Web as well:
- Janus_Use_RTSP_Restream → Restream
- Janus_RTSP_User → RTSP_User

Update visibility logic so the Restream checkbox appears when RTSPServer
is enabled AND any streaming service (Janus, Go2RTC, or RTSP2Web) is
selected, rather than only when Janus is enabled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:47:37 -05:00
Isaac Connor 07f307e155 Make warning about subscription ending a debug 2026-01-31 18:04:49 -05:00
Isaac Connor 37fda1a8dc Add zm_rtsp_server_fifo_av1_source 2026-01-31 16:19:38 -05:00
Isaac Connor d5531180f4 Add av1 support 2026-01-31 12:43:03 -05:00
Isaac Connor 7b55f762c7 fix: prevent underflow and type mismatch in H264 fifo source
- Add early return in findMarker() when size < 3 to prevent unsigned
  underflow in loop condition (size-2 with size_t)
- Change remainingSize from int to size_t in extractFrame() to match
  the unsigned types used in the calculation
- Update Debug format specifier from %d to %zu for size_t
- Change Info to Debug for "No marker found" log message

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:30:40 -05:00
Isaac Connor a62d5fcbf7 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-01-30 15:27:49 -05:00
Ben Dailey f44d9e866b fix: resolve ONVIF reconnection failures and use-after-free bug
Two issues fixed:

1. Null soap context on retry: After a failed subscription attempt,
   soap_free() was called but the context was never recreated. Added
   InitSoapContext() to reinitialize the soap context, proxy, and
   endpoint when needed.

2. Use-after-free in Renew/PullMessages: soap_end() frees all gSOAP
   allocated memory including response.SubscriptionReference.Address.
   Subsequent calls to Renew() used the freed pointer, causing DNS
   errors on valid IP addresses. Added subscription_address_ member
   to cache the address before soap_end() is called.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:14:45 -05:00
Isaac Connor d180867da7 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-01-30 15:11:17 -05:00
Isaac Connor 73f8f56c71 Info to debug 2026-01-30 15:11:15 -05:00
Isaac Connor 981c6d685e fix: improve crash backtrace on ARM and fix misleading signal info
- Add optional libunwind support for better stack traces on ARM
  (glibc's backtrace() doesn't work well on ARM due to missing
  frame pointers)
- Fix misleading signal info: si_pid/si_uid/si_status are only
  valid for SIGCHLD, not for SIGSEGV/SIGBUS - they were showing
  garbage values (the fault address misinterpreted as PID)
- Add human-readable fault descriptions for SIGSEGV, SIGBUS,
  SIGFPE, and SIGILL signals
- Use clearer terminology in error messages

To enable libunwind on ARM: apt install libunwind-dev

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:09:02 -05:00
Isaac Connor a6e91a4699 feat: add SPS/PPS extraction to RTSP server for correct video dimensions
Extract H264 SPS/PPS and H265 VPS/SPS/PPS from video stream and pass
to xop sources for inclusion in SDP sprop-parameter-sets. This allows
RTSP clients like go2rtc to properly decode video with correct
dimensions.

Also adds auth_hash refresh support to go2rtc manager to prevent
authentication timeout after 2 hours.

Changes:
- zm_rtsp_server_fifo_h264_source.cpp: Re-enable SPS/PPS extraction
- zm_rtsp_server_fifo_video_source.h: Add xop source pointers
- zm_rtsp_server.cpp: Connect FIFO sources to xop sources
- zm_monitor_go2rtc.cpp: Add periodic auth_hash refresh
- zm_monitor.h: Add refresh tracking members to Go2RTCManager
- dep/RtspServer: Update xop H264/H265Source with sprop support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 15:07:15 -05:00
Isaac Connor 40e8b81143 fix: multiple issues in zm_rtsp_server_fifo_source
- Fix inverted logic in ReadRun(): was returning when NOT stopping,
  now correctly returns when stopping or terminating
- Remove redundant "1 and" condition in WriteRun NAL size check
- Add input validation for content length parsing using strtoul
  with bounds checking to prevent overflow/invalid data issues
- Store m_rtspServer by value instead of reference to prevent
  potential dangling reference if original shared_ptr changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:49:53 -05:00
Isaac Connor b76a7c9640 fix: add null checks for y_image before dereferencing in Analyse
When analysis_image is set to ANALYSISIMAGE_YCHANNEL but in_frame is
not populated (e.g., LocalCamera which captures directly to image),
get_y_image() returns nullptr. The code was dereferencing this null
pointer in DetectMotion and Blend calls, causing a segfault.

Now checks if y_image is valid before use and skips the operation
with a debug message if unavailable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:29:04 -05:00
Isaac Connor e01467126d fix: add gSOAP memory cleanup to prevent runtime memory growth
Add soap_destroy() and soap_end() calls after SOAP operations in:
- WaitForMessage(): after PullMessages processing
- Renew(): after Renew response processing (all return paths)
- Subscribe(): after initial PullMessages call

Also clear initialized_count map and warned_initialized_repeat flag
when creating new subscription to prevent unbounded map growth.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:51:39 -05:00
Isaac Connor 6b5cae926b Make most Fatals into Errors 2026-01-29 18:50:42 -05:00
Isaac Connor 5a0a53f72c Reload db config on reload 2026-01-29 17:30:43 -05:00
Isaac Connor d0bde9882b On reload, need to actually close the fd so that we can reopen it 2026-01-29 17:30:32 -05:00
Isaac Connor 6ef2950d21 refactor: consolidate GSOAP ifdefs in ONVIF class
- Wrap all GSOAP-dependent code in a single #ifdef WITH_GSOAP block
- Move GSOAP-specific members and methods inside the conditional
- Provide minimal stubs (constructor, destructor, start) for non-GSOAP builds
- Remove unnecessary stub methods for private members that can't be called
- Code now compiles cleanly with or without GSOAP support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:36:51 -05:00
Isaac Connor e7618f3caf Add arm 32 and 64bit support to backtrace 2026-01-28 16:10:37 -05:00
Isaac Connor 2033b5eb73 Update Storage DiskSpace once event has been finalized. As we decrement DIskSpace on event deletion, we were getting negative DIskSpace in the Storage table. 2026-01-28 15:15:59 -05:00
Isaac Connor 1d23bd297f Warn about too slow send_packet only if debug is on 2026-01-28 14:51:15 -05:00
Isaac Connor 687003f67d Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-01-27 15:17:35 -05:00
Isaac Connor 141df0a912 Only do y_image stuff if we have a decoded in_frame 2026-01-27 15:17:29 -05:00
Isaac Connor bb5ebe8f7e
Merge pull request #4573 from BHMSD-bdailey/ONVIFHonorTerminationTime
feat: add per-topic alarm expiry using PullMessagesResponse Terminati…
2026-01-27 12:54:07 -05:00
Isaac Connor aa0a899c59 Test for soap in set_credentials 2026-01-27 11:51:51 -05:00
Isaac Connor 0f917ae1ed refactor: restructure Decode() and fix PacketQueue locking issues
Monitor::Decode():
- Reorganize into 5 clear phases with descriptive comments
- Phase 1: Receive decoded frame from decoder
- Phase 2: Get and send new packet to decoder
- Phase 3: Convert decoded frame to Image
- Phase 4: Prepare Y-channel for analysis
- Phase 5: Process RGB image (deinterlace, rotate, privacy, timestamp)
- Extract applyOrientation() and applyDeinterlacing() helper functions
- Keep slow send_packet detection timing for diagnostics

PacketQueue locking fixes:
- Move lock acquisition before accessing shared state in queuePacket()
- Keep lock held while iterating in stop()
- Add lock to addStream()
- Remove duplicate packet_counts allocation in clear()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 11:18:50 -05:00
Isaac Connor 7194008fe6 Set decoded=true in error case when de-interlacing 2026-01-27 10:36:03 -05:00
Isaac Connor 5c402ccab4 Add wait parameter to increment_it. Sometimes we should wait and sometimes not. 2026-01-27 09:30:28 -05:00
Isaac Connor da13e5f1a7 Clean up error case return code 2026-01-27 09:00:01 -05:00
Isaac Connor ae97d4bd4b Make incremement at end a debug. 2026-01-27 08:05:04 -05:00
Isaac Connor b0e966c56b Put locking debugging back at level 4 2026-01-27 08:04:35 -05:00
Isaac Connor f8256a1d0e ONly generate y_image if we are doing analysing. 2026-01-27 07:57:43 -05:00
Ben Dailey 2dc48e4335 feat: add per-topic alarm expiry using PullMessagesResponse TerminationTime
Cameras like Reolink send alarm=true but never send the corresponding
false, causing alarms to stick indefinitely. Use the TerminationTime
from PullMessagesResponse to auto-expire stale per-topic alarms.

- Add AlarmEntry struct with value and termination_time fields
- Extract TerminationTime from each PullMessagesResponse and attach
  it to alarm entries; refresh on re-trigger so active alarms persist
- Sweep expired alarms after processing messages and on poll timeout
- Add expire_alarms option (default: true) to disable via onvif_options
- Fix TOCTOU race: remove unsynchronized alarms.empty() check before
  acquiring mutex in the timeout sweep path
- Simplify SetNoteSet with C++17 structured bindings
- Add Catch2 tests for alarm expiry logic (mirrored struct to avoid
  gSOAP header dependency)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 05:52:31 -05:00
Isaac Connor 8eee695e63 Cleanup return values, kill dead code and duplicated checks 2026-01-26 18:28:59 -05:00
Isaac Connor 46ebe10d73 Fix missing increment_it 2026-01-26 18:01:04 -05:00
Isaac Connor 179d544e3a Fix opening the v4l device on camera object instantiation (including in zms). Fix behaviour when ondemand pause/playing. 2026-01-26 18:00:53 -05:00
Isaac Connor 70c4d7bacd Remove ::decode which is no good. Move hw transfer stuff to transfer_hwframe and needs_hw_transfer 2026-01-26 15:11:38 -05:00
Isaac Connor 5ecb5fdb1c Need to call trasnfer_hwframe in case we are using hwaccel. 2026-01-26 15:11:05 -05:00
Isaac Connor c743c00e78 Change default pull_timeout_seconds to 1 to improve shutdown speed 2026-01-26 15:10:33 -05:00
Isaac Connor 94702b8932 Codecs can return EAGAIN. We have to queue and wait for it to start giving us decoded frames. 2026-01-26 14:56:18 -05:00
Isaac Connor 107863f228 Move init to constructor. start() now just fires off Run and returns immediately. Run will do the subscribing 2026-01-26 14:40:51 -05:00
Isaac Connor 2eebda8c64 Cleanup hw_pix_fmt and get_hw_format 2026-01-26 14:40:10 -05:00
Isaac Connor 91f5333e7d Cleanup access to y_image using get_y_image(). 2026-01-26 13:18:32 -05:00
Isaac Connor 31c76557be Return a y-image for any suitable format that has a y-plane. Specifically this allows NV12 to work. 2026-01-26 13:18:14 -05:00
Isaac Connor 12ffa835c7 Merge in code to iterate through available codecs and try each one. 2026-01-26 13:17:25 -05:00
Isaac Connor b79f8b7b51 Add get_y-image 2026-01-26 12:54:31 -05:00
Isaac Connor edb09314b5 The correct codec name is hevc not h265 2026-01-26 11:56:12 -05:00
Isaac Connor 0a0e29c99b Add get_fps_string to return a string of the fps content to be used later for Debug output. Convert dump_stream to build a string first before Debug 2026-01-26 11:47:21 -05:00
Isaac Connor d604dd69b6 Implement libjpeg_to_ffmpeg_qv 2026-01-26 11:46:47 -05:00