The per-monitor media FIFOs (video_fifo_{id}.{codec} /
audio_fifo_{id}.{codec}) are fully replaced by the monitor stream
socket; their only in-tree consumer, zm_rtsp_server, was ported in the
previous commits. Removes:
- the Fifo writer instance API (open/close/write/writePacket, the
O_NONBLOCK silent-drop path and the 1MB F_SETPIPE_SZ kernel buffer
per pipe); the class keeps only the static fifo-creation helpers
still used by the diagnostic image pipes
- fifo creation in PrimeCapture (including the codec-name-as-file-
extension discovery hack), the write call sites in Capture (including
the extradata-before-every-keyframe rewrite - extradata travels in
the stream socket HELLO), and the Close()/destructor teardown
- the GetVideoFifoPath/GetAudioFifoPath accessors
The shared memory fifo path fields are retired separately in the next
commit. zm_fifo_debug and zm_fifo_stream (diagnostic pipes) are
unrelated features and unchanged.
BREAKING CHANGE: external consumers of the media FIFOs must move to
the stream socket (PATH_SOCKS/stream_{monitor_id}.sock, see
zm_stream_socket_protocol.h).
Tests: full suite passes via ctest; all binaries build clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zm_eventstream.cpp:
- Fix null pointer dereference when video_file or scheme column is NULL
- Fix out-of-bounds array access in CMD_SEEK handler when curr_frame_id
decrements to 0
- Fix setStreamStart calling wrong loadInitialEventData overload (event_id
was being truncated and used as monitor_id)
zm_fifo.cpp:
- Fix close(-1) call when file creation fails
- Fix use of uninitialized raw_fd when on_blocking_abort is false
- Reset outfile and raw_fd in close() to prevent use-after-close
zm_monitor.cpp:
- Fix shm_id being zeroed before use in shmctl() call
Remove all uses of deprecated av_init_packet() and switch any stack
based AVPackets to unique_ptrs allocated with av_packet_alloc().
Ensure that all code paths call av_packet_unref() after use to reset
before next usage.
With this commit a unified structure for includes is introduced.
The general rules:
* Only include what you need
* Include wherever possible in the cpp and forward-declare in the header
The includes are sorted in a local to global fashion. This means for the include order:
0. If cpp file: The corresponding h file and an empty line
1. Includes from the project sorted alphabetically
2. System/library includes sorted alphabetically
3. Conditional includes
Adds fifo options for diagnostic images for much lower impact diagnostics mode. Diagnostic images are only written when there is a client listening for them (otherwise they are skipped). Also added a json stream for the detection data so you can see in real time the pixels or blobs detected for the motion. This allows for easy real time stream of both delta and reference images (as video streams) along with the detection numbers.