Commit Graph

29 Commits

Author SHA1 Message Date
Isaac Connor a56d78bb04 Don't sleep if Analyse returns false and we are terminating 2021-02-16 10:39:04 -05:00
Peter Keresztes Schmidt 42484e6434 zmc: Fix a deadlock on shutdown/reconnection
First stop the analysis threads, then close the monitors and thus drain the packet queues before trying to join the analysis threads since they might hang while waiting for the next packet to arrive.
2021-02-11 15:48:22 +01:00
Peter Keresztes Schmidt 0380bee130 AnalysisThread: Make the class un-movable
We depend on an unchanged value of "this" after the creation of the thread otherwise undefined values would be accessed within the std::thread.
2021-02-09 23:54:50 +01:00
Peter Keresztes Schmidt 888ddc5d63 AnalysisThread: Sprinkle some more std::chrono 2021-02-09 12:26:53 +01:00
Peter Keresztes Schmidt 3ba8ff604f AnalysisThread: Use std::this_thread::sleep_for instead of usleep 2021-02-09 12:26:53 +01:00
Peter Keresztes Schmidt b22dbd4788 AnalysisThread: Move it over to std::thread 2021-02-09 12:26:53 +01:00
Peter Keresztes Schmidt f43507dce0 Use the power of smart pointers to manage Monitor instances 2021-02-07 21:20:45 +01:00
Peter Keresztes Schmidt eef0da8f19 Remove references to <csignal> from AnalysisThread
The removed block_set member was unused.
2021-02-04 18:02:08 +01:00
Peter Keresztes Schmidt 0dbc39ee25 Cleanup and reorganize includes
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
2021-02-04 18:02:01 +01:00
Isaac Connor c9641063ca Don't need to get_ref_image anymore. It will block waiting for a capture packet and the ref image will be set by capture thread 2021-01-07 09:36:18 -05:00
Isaac Connor 019f02e9de remove old sigblocking code 2020-12-30 21:21:41 -05:00
Isaac Connor 9b916a15a2 Only get ref image if we are doing motion detection. 2020-12-27 11:55:14 -05:00
Isaac Connor 8a2d4c7512 Debug the start of thread run in analysisthread. Sleep for appropriate amount of time. 2020-12-15 15:57:40 -05:00
Isaac Connor 697f9a50fe Terminate thread also when zm_terminate is true 2020-12-09 12:21:31 -05:00
Isaac Connor d21c04e5dc add Debug 2020-09-25 16:19:31 -04:00
Isaac Connor b5e0745ac7 Merge branch 'storageareas' into zma_to_thread 2018-02-14 13:56:03 -05:00
Isaac Connor af37eeeeed fix int64 = int*int multiply 2017-12-08 15:17:45 -05:00
Isaac Connor 0865201e1e seems to work 2017-12-01 07:26:34 -05:00
Isaac Connor 556c4d8851 debug 2017-11-30 16:10:30 -05:00
Isaac Connor 6e4abf83d0 wip 2017-11-28 08:29:03 -05:00
Isaac Connor d1886b5536 wip 2017-11-27 14:57:24 -05:00
APHW2 MFGENG 1809921b46 turnoff debug 2017-11-14 08:53:08 -08:00
APHW2 MFGENG 043e44d273 fix, must clear the frame 2017-11-13 14:24:28 -08:00
Isaac Connor 50d3b168fa wip 2017-11-12 11:50:07 -05:00
APHW2 MFGENG 626af8d2fb wip 2017-11-10 10:10:51 -08:00
APHW2 MFGENG d15d36f389 rework, compiles, won't open h264 2017-11-09 11:50:20 -08:00
Isaac Connor 94ab00aebd continue cleanup of Monitor instantiation 2017-10-07 11:30:41 -04:00
Isaac Connor b30e8953dd starting to rough in adding a frame to zmpacket 2017-09-04 16:36:34 -04:00
Isaac Connor 0f6d18eaca add analysis_thread 2017-09-04 15:29:40 -04:00