Commit Graph

5642 Commits

Author SHA1 Message Date
Isaac Connor
b87c86621a Set zm_terminate on io error 2024-02-08 14:42:08 -05:00
Isaac Connor
79ce5cf80f When monitor is Decoding==None send a more informative text image saying so. Instead of simply returning, set zm_terminate and go through the normal flow so that comms thread and db threads terminate as well. Might fixes zms hangs 2024-02-08 10:58:58 -05:00
Isaac Connor
a64b24687c Add warnings when event_close_mode is weird. Fix monitor always being in close_mode=idle. Still do state changes even if packet is not video. Do not set state=ALARM when triggered, let the state machine do that. 2024-02-07 15:56:24 -05:00
Isaac Connor
22a2846218 Can't set alarm when triggering. Must be done by the state machine 2024-02-07 15:56:24 -05:00
Isaac Connor
593f6f1601 Add some more debugging to track down idle events not closing on alarm 2024-02-07 15:56:24 -05:00
Isaac Connor
ad232761e1 Spacing, cpplint 2024-02-07 15:56:24 -05:00
Isaac Connor
4993a55b14 Move declaration of zones down to where it is used 2024-02-07 15:56:24 -05:00
Isaac Connor
f92115b4fe Spacing 2024-02-07 15:56:23 -05:00
Isaac Connor
de7b915291 Increase the time jump to 20 seconds. 2024-02-06 15:59:08 -05:00
Isaac Connor
e159948d62 Handle state==TAPE when CLOSE_EVENT_MODE=IDLE 2024-02-05 17:39:05 -05:00
Isaac Connor
c9c2898912 Fix some spacing 2024-02-05 16:11:22 -05:00
Isaac Connor
63e57066c8 Always use a reorder_queue because an out of order packet may not have happened by the time we start recording, but may happen after. Reduce size to 1*keyframe interval as a test 2024-02-02 09:30:41 -05:00
Isaac Connor
afb05f40d9 Always wait to determine keyframe interval before we start recording. 2024-01-30 13:46:49 -05:00
Isaac Connor
5176529073 Only reference decoding_image_count in Ready() 2024-01-30 09:31:42 -05:00
Isaac Connor
5285c6e716 cpplint spacing changes. The real change is in Analysis we move the Ready check to only affect motion detection. This hopefully fixes the massive memory leak when Decoding=OnDemand 2024-01-30 09:31:28 -05:00
Isaac Connor
c6ff1e9748 Fix cppcheck complaint 2024-01-29 13:44:02 -05:00
Isaac Connor
0553450493 Fix syntax error 2024-01-29 13:42:56 -05:00
Isaac Connor
0295ef1252 Fix cppcheck complaint 2024-01-29 13:42:40 -05:00
Isaac Connor
2d73a083b5 curr_frame_id should never be 0. So set it to 1 instead 2024-01-29 13:30:17 -05:00
Isaac Connor
31091d0fd3 Handle out of bounds access to global_edges if it is empty 2024-01-29 13:12:30 -05:00
Isaac Connor
b869a6e5a9 Must always CLose in PrimeCapture because each OpenFfmpeg allocates structures. 2024-01-29 10:10:56 -05:00
Isaac Connor
c00d3ea061 Add score to debug in monitor link 2024-01-28 16:31:49 -05:00
Isaac Connor
7493230e03 Better debugging, of unsupported codec types and monitor link results 2024-01-27 18:32:22 -05:00
Isaac Connor
21743f71a1 Reset lastPTS on Close 2024-01-27 10:27:39 -05:00
Isaac Connor
543d3bdd98 Fix lastPTS assignment when not using a second input. Use a 10 sec max pts gap before fail to capture 2024-01-26 19:47:39 -05:00
Isaac Connor
4888019f1b Add detection for significant jump back in time in incoming packets 2024-01-26 18:16:24 -05:00
Dmitry Tsarevich
4965fd09a6 Log pipe size mutate / access errors
See `set pipe size failed` in Logs, but hard to guess why.

Now should be able to debug pipe size issues.
2024-01-26 05:07:05 +03:00
Isaac Connor
219d0b6eba When recording = onmotion, end event after post alarm count instead of section_length. 2024-01-24 13:00:31 -05:00
Isaac Connor
75f71e1a7e Fix memory leak in Config when reloading it after HUP 2024-01-23 16:56:51 -05:00
Isaac Connor
403c63af9b Use Duration instead of timestamp % section_length. Shorter code and actually works. Fixes #3806 2024-01-23 16:39:43 -05:00
Isaac Connor
f1aa08971f group->Name needs a c_str 2024-01-23 16:12:56 -05:00
Isaac Connor
6c4569924c include zm_group.h for group_permission 2024-01-23 16:12:36 -05:00
Isaac Connor
c59bd43460 Use new Group.MonitorIds() function to do the heavy lifting in LoadMonitorIds 2024-01-23 16:12:05 -05:00
Isaac Connor
aaa55b9776 Improve debug logging when failed to connect to db, and provide reason when fail to run query 2024-01-23 16:11:44 -05:00
Isaac Connor
8b0d77c41f Fix complains by cpplint. Switch to std::string for name. Add MonitorIds function which will recursively load monitors Ids from children groups. 2024-01-23 16:11:15 -05:00
Isaac Connor
5cc7ca28e5 Log a failure to init curl 2024-01-22 18:59:02 -05:00
Isaac Connor
d81b98da25 Set cause = LINKED_CAUSE regardless of whether we are in an event, as we may be ending an idle event to start a new one. Use MonitorLinkExpression.result to get score from the expression instead of just using 20. Imrpove logic around close events to prevent them from lasting too long 2024-01-22 14:25:57 -05:00
Isaac Connor
44862adb8a Implement MonitorLinkExpression::result so that we can return the score as well as simply a boolean value. 2024-01-22 14:25:57 -05:00
Isaac Connor
343d2294d4 Take post_event_frame count into consideration when closing events 2024-01-19 12:26:05 -05:00
Isaac Connor
39e03e6a3c Fix infinite loop in the event there is only the initial frame in the db. 2024-01-18 14:16:38 -05:00
Isaac Connor
7280329e6e Split long line 2024-01-17 17:09:43 -05:00
Isaac Connor
a0ecbdf0bf Rework state machine, separating the state machine from the code to start/stop event recording. Doing section_length < min_section_length at monitor load time instead of constantly during analysis. 2024-01-17 17:09:42 -05:00
Isaac Connor
08aefd881a Add decoding_image_count, use it in Ready() instead of image_count. Fix hanging processes due to event start/end command failing because it waits writing to db which isn't really open. Stop analysis thread in Pause. 2024-01-16 16:47:14 -05:00
Isaac Connor
219af38127 Fix use of deprecated pkt_duration 2024-01-16 16:41:05 -05:00
Isaac Connor
fba728d406 Must close events before closing camera because we use it's inputs_streams in videostore. 2024-01-16 09:48:38 -05:00
Isaac Connor
bae3ecca4f Monitor states have to start at 0 for string lookup 2024-01-11 17:18:54 -05:00
Isaac Connor
5da67339d0 Correct values for state to include Unknown 2024-01-11 17:18:23 -05:00
Isaac Connor
fe9abb96a1 Revert "Remove unknown as a state, as string lookup has to start at 0 and this breaks api."
This reverts commit e0a90319e7.
2024-01-11 17:17:25 -05:00
Isaac Connor
992cbc137f When not recording, fix never going back to idle state 2024-01-11 17:13:09 -05:00
Isaac Connor
e0a90319e7 Remove unknown as a state, as string lookup has to start at 0 and this breaks api. 2024-01-11 17:10:48 -05:00