Commit Graph

831 Commits

Author SHA1 Message Date
Peter Keresztes Schmidt 3376b44290 Monitor: Fix a segfault when loading local cameras 2021-02-08 12:25:18 +01:00
Peter Keresztes Schmidt f43507dce0 Use the power of smart pointers to manage Monitor instances 2021-02-07 21:20:45 +01:00
Isaac Connor ace93e2422 fix event start packets getting deleted while writing because we don't have a lock on them. 2021-02-06 20:11:38 -05:00
Isaac Connor c28e1b09e5 Fix compile when using sysv shm 2021-02-06 20:11:38 -05:00
Isaac Connor 513739aeb5
Merge pull request #3127 from Carbenium/header-cleanup
Cleanup and reorganize includes
2021-02-04 12:52:04 -05: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 046e352304 improvements to fps reporting. In analysis, we report based on image packets processed, but the fps value is calculated based on the count of images we did motion detection on. We no longer count audio packets in capture fps reporting. 2021-02-04 11:50:01 -05:00
Isaac Connor c61e6a8c56 If there is an open event in disconnect close it. The idea is that by the time we get to the destructor we should be all shut down 2021-02-03 17:04:40 -05:00
Isaac Connor cb60b6c141 Fix bulk frame code and move it to event. Revert base score to 0. Fix cause of continuous events. Move GetState to .h 2021-02-03 16:57:44 -05:00
Isaac Connor be1db1ff20 Score should be a signed int 2021-02-03 09:08:06 -05:00
Isaac Connor 0958768ce5 Fix no bulk frames by setting score to -1 which means BULK. It will get changed to 0 or more by later code. Fixes #3121 2021-02-02 23:19:53 -05:00
Isaac Connor 38368a8b9d remove deprecated video_buffer_duration stuff. Fix loading monitor column order 2021-02-02 23:19:53 -05:00
Isaac Connor afa5e27d56 load RTSPServer column as well. start_it needs to be tracked by packetqueue. We no longer close the camera in Monitor::Close because we need to clear the packetqueue, then wait for threads to finish, THEN close camera. So that logic needs to move to zmc 2021-02-02 23:19:52 -05:00
Peter Keresztes Schmidt e09fa1bebf Remove includes of <cinttypes>
Instead of including <cinttypes> directly, zm_define.h should be used
to get the typedef'ed types as well.
2021-02-02 21:37:26 +01:00
Isaac Connor a5417cfe6c NULL=>nullptr. Update analysis_fps earlier on startup 2021-02-01 16:01:09 -05:00
Isaac Connor 0676c7cfb4 Use packetqueue::free_it to release iterators 2021-02-01 10:24:58 -05:00
Isaac Connor dd57d05f40 Convert packetqueue from a pointer to a packetqueue to a member packetqueue that is always available. Add methods to set packetqueue parameters. Emptying the queue is now in packetqueue::clear() 2021-01-31 21:31:33 -05:00
Isaac Connor e08060af3f Free linked monitors 2021-01-31 11:57:43 -05:00
Isaac Connor e084780123 Remove no longer used pre_event buffer and event_delete_thread 2021-01-31 10:09:03 -05:00
Isaac Connor 00114d32bc Minor code improvements ostly just being more specific about parenthesis 2021-01-30 20:35:10 -05:00
Isaac Connor b93aab6a11 turn off hwtransfer direct to image. Too compliated for now with not enough benefit 2021-01-30 12:34:29 -05:00
Isaac Connor ac88567ee2 fix 2021-01-29 17:32:22 -05:00
Isaac Connor 5581cdafb6 must increment iterators in the packetqueue lock 2021-01-29 17:30:39 -05:00
Isaac Connor 7923e0c279 fix min_section_length not being honoured 2021-01-27 18:13:16 -05:00
Isaac Connor 1ca93c4211 accept packets with image as video 2021-01-27 12:49:54 -05:00
Isaac Connor 4dcce4ac95 Merge branch 'rtsp_server' 2021-01-26 14:22:10 -05:00
Isaac Connor e4831909d6 get_packet can return null if we are terminating 2021-01-26 12:22:26 -05:00
Isaac Connor f1686cfe9a When not capturing don't try to create mmap. Fixes #3112 2021-01-22 12:11:43 -05:00
Isaac Connor 66c78e5a9b Merge branch 'zma_to_thread' into rtsp_server 2021-01-19 13:43:25 -05:00
Isaac Connor 256080abb1 Fix crash of Reload() due to Load() clearing shared_data and mem_ptr. Load() shouldn't do these kinds of initialisations. 2021-01-19 09:44:53 -05:00
Isaac Connor 68b0f7e1b5 initialize packetqueue, analysis_it, storage and videostore in Monitor constructor initializer. Only delete packetqeuue if it has been created. 2021-01-15 14:42:26 -05:00
Isaac Connor 10e56df53c analysis_limit > cpature fps: only log a warning if we have actually been capturing for a while. If doing passthrough, need to start continuous event from last keyframe 2021-01-15 11:54:36 -05:00
Isaac Connor 164a0f5a44 Need to use get_packet so that packets getting written to event are locked. Because queuePacket might delete them. 2021-01-12 14:11:47 -05:00
Isaac Connor e8d06f702c Handle signal loss, improve debugging 2021-01-11 13:46:50 -05:00
Isaac Connor 46a8bb22fb get camera if we havn't already. Don't delete the timestamp in shared zmpackets because it is just a pointer to shmem. Set it to null instead so that ~ZMpacket doesn't try to free it 2021-01-11 13:46:50 -05:00
Isaac Connor 65fc5bf478 move code from Load for purpose==ANALYSIS because it will never run. Analysis is a thread now and must assume that PrimeCapture has already succeeded. 2021-01-11 13:46:50 -05:00
Isaac Connor da7a50c92d Rename H264PASSTHROUGH to just PASSTHROUGH. Start with last_signal set to true so that we don't have a signal change event on startup. Use new generic packetqueue functions 2021-01-11 13:46:50 -05:00
Isaac Connor e1f6f5984d Handle signal loss, improve debugging 2021-01-11 13:35:48 -05:00
Isaac Connor a6aefcf477 get camera if we havn't already. Don't delete the timestamp in shared zmpackets because it is just a pointer to shmem. Set it to null instead so that ~ZMpacket doesn't try to free it 2021-01-08 15:49:09 -05:00
Isaac Connor ff3bc981de move code from Load for purpose==ANALYSIS because it will never run. Analysis is a thread now and must assume that PrimeCapture has already succeeded. 2021-01-07 09:40:24 -05:00
Isaac Connor e93a895f28 Rename H264PASSTHROUGH to just PASSTHROUGH. Start with last_signal set to true so that we don't have a signal change event on startup. Use new generic packetqueue functions 2021-01-06 11:31:31 -05:00
Isaac Connor f61210c91f remove old code using image_buffer in zm_packets 2020-12-30 21:23:29 -05:00
Isaac Connor 284b9f963f Merge branch 'master' into zma_to_thread 2020-12-29 12:18:26 -05:00
Isaac Connor 197f9bdd9e indenting fix. Don't update reference image if not doing motion detection. Decouple the image buffer from the packetqueue. So always allocate a new image. Then copy decoded image to image buffer if required. 2020-12-27 12:00:18 -05:00
Isaac Connor ddf66bc9b5
Merge pull request #3100 from vertigeaux/share_frame_scores
save frame scores to SharedData for use with linked monitors
2020-12-24 11:08:25 -05:00
Isaac Connor 1ffc233593 Move some initialisation into MOnitor() initialisation. Update UpdateAnalysisFPS to use more doubles instead of integers to get better numbers. Move capture FPS updating to UpdateCaptureFPS and use doubles there too. remove some dead code and add some debugging 2020-12-23 18:50:07 -05:00
Isaac Connor fb2793d337 use nullptr instead of 0 when init'ing event 2020-12-23 09:11:33 -05:00
Isaac Connor a1917d83d0 Merge branch 'master' into zma_to_thread 2020-12-22 19:52:09 -05:00
Vertigeaux 1416cbb03c save frame scores to SharedData for use with linked monitors 2020-12-22 17:44:53 -06:00
Isaac Connor d6486d1a7e use nullptr instead of 0 when init'ing event 2020-12-22 15:44:07 -05:00