Earlier edits rewrote these files with LF endings, which made the diff
show every line as changed. Content is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
- validate(): the settings-changed check was dead code after an early
return; it now runs first and reloads the module when the module_eve
row changes (e.g. from the Mojo_Web module settings).
- stopService() returned false with EVE_WORK_WITH_MEDIAMTX (m_bDetached
was only set by the picture server), so a reload stopped the streams
and never restarted them.
- Logo: computed position and state live in m_bLogoActive / m_nLogoX /
m_nLogoY instead of overwriting m_sEmbedVideoData (that made the struct
differ from the DB row and caused endless reloads). Logos without an
alpha channel no longer crash (whole picture drawn); ROI is checked.
- Time stamp: negative ts_x / ts_y are measured from the right / bottom
edge like label and logo; background box fits the text instead of the
fixed (490,60) corner.
- Font face and line type from the DB are sanitised before cv::putText
(an unsupported line type throws).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
- Move reusable MediaMtx code (logger, codecs, stream, httpp, recorder,
webrtc server) to lib/data/media/mtx; add ServerConf, MediaPath/
PathProvider and H264Feeder. Standalone Projects/MediaMtx builds against it.
- kernelModuleEmbedVideo hosts a WHEP server (:8889/stream_<node>/whep)
and one MediaPath per camera stream with fMP4 segment recording.
- streamHandler feeds each path either with camera H264 passthrough
(videoAVLIBSource / videoLive555AVLibSource forward encoded NALs) or
with re-encoded processed frames incl. overlays (streamLiveEncoder),
selected by module_eve.live_mode (optional columns, defaults apply).
- kernelHelperMediaMTX: external mediamtx.service is stopped, segment
indexing of the scratch folder is kept.
- live555 watch variable type deduced so old and new live555 build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
Field log: the PTZ re-init now keeps the camera and its stream (15:36),
but at 16:02:30 "Video Stalled" restarted the live555 stream, which cut
the recording. streamHandler::validate() (module factory, every ~5 s)
restarted the stream as soon as one validation saw no new frame, i.e.
after a single gap of ~5 s. That is normal now and then for a camera on
a mobile link.
- The stream is restarted after STREAM_STALL_CHECKS (3) validations in a
row without a new frame (~15 s): "Video Stalled (no frame for N s) -
restarting the stream". Shorter gaps are logged ("Video: no new frame
for N s (k/3)", "Video: frames again after N s").
- m_nValidatorFrameCounter is initialised (it was not).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
Continuous leaks:
- protocolParser: on package-pool overflow the oldest package was removed
but never freed while the newest (still pooled) one was freed. Every
packet a handler does not consume (e.g. other sensors on a shared bus)
leaked once the pool was full. Free the removed package, free pooled
packages in the destructor and getPackage(), use memmove for the
overlapping buffer shifts.
- SQLite_Connector::Query: loop only while sqlite3_step() returns
SQLITE_ROW. Looping until SQLITE_DONE spun forever allocating rows on
SQLITE_BUSY/ERROR. Set a busy timeout, close handles after a failed
open, fix escapeBinary() writing into uninitialised buffers.
- basicThread/basicDualThread: threads that ended by themselves were never
joined, leaking their stacks on every stream drop/restart. Always join
once (detach when called from the thread itself); check pthread_create
result correctly.
- curlRequest: free the header list; initialise m_pPostData and the
content type; curlRequestsManager deletes requests it cannot queue.
- kernelModuleModemManager: free the phonebook ID list on every reload.
- deviceNodeFactory: do not append the same pending node every cycle.
- streamHandler: free frames left in the encoding queue on destruction.
Heap corruption:
- kernelModuleFactory: module that failed to start was deleted twice.
- mojoRemoteClient: basicRing::push() returns an ID (may be 0), not a
bool; compare with -1. Fix packetExtractor and destructor leaks.
- utilizeBasicEvent: payloads are malloc'ed, release with free().
- videoAVLIBSource: avoid sws context double free, NULL check order.
- trim(): memmove for overlapping copy.
Smaller leaks: dropSession duplicate query, LRF upload data, report
backupper / fly hunter settings, Kafka consumer handle, BVMS uniq ID.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16