Isaac Connor
e86dd7eb32
move curl init and cleanup into zmc
2022-06-07 18:19:00 -04:00
Isaac Connor
27bc8d9764
Stop the dbQueue before closing logs. Since dbQueue.stop() join's the dbQueue thread, it should not log after we return.
2022-05-18 19:00:40 -04:00
Isaac Connor
cf31db0bad
Merge branch 'master' into replace_function_concept
2022-02-27 14:05:34 -05:00
Isaac Connor
133553e630
Revert "Merge pull request #3119 from Carbenium/fmt"
...
This reverts commit 90d930c7c3 , reversing
changes made to 0bcb9d276f .
2022-02-27 14:05:14 -05:00
Isaac Connor
e33b41745d
Merge branch 'master' into replace_function_concept
2022-02-27 14:04:01 -05:00
Isaac Connor
cad57df0bb
Merge branch 'master' into fmt
2022-02-26 13:56:20 -05:00
Isaac Connor
a250567e74
add sleeping when no viewers and in ondemand mode
2022-01-01 17:54:47 -05:00
Isaac Connor
6bd04de5f6
Merge branch 'master' into multistream
2021-12-31 17:53:36 -05:00
Isaac Connor
b4511a8fc3
Merge branch 'master' of github.com:ZoneMinder/zoneminder
2021-12-10 16:20:54 -05:00
Isaac Connor
c42b75a252
must clear the monitors array before terminating log.
2021-12-10 16:20:44 -05:00
Isaac Connor
1cddac4efd
remove remaining signal blocking cruft, add ignoring sigchld so that anything we spawn doesn't become a zombie.
2021-11-29 18:34:19 -05:00
Isaac Connor
a2ae63cefe
Merge branch 'master' into fmt
2021-11-16 15:10:45 -05:00
Isaac Connor
93055f44e8
Merge UpdateCaptureFPS and UpdateAnalysisFPS into UpdateFPS and call it from zmc after capture.
2021-11-03 17:03:29 -04:00
Isaac Connor
3770306817
Add logic to skip capturing if Capturing()==Ondemand
2021-10-25 16:53:18 -04:00
Peter Keresztes Schmidt
6e96cbe14a
Misc: Merge ZM_HAS_V4L with ZM_HAS_V4L2
2021-09-08 00:19:08 +02:00
Peter Keresztes Schmidt
65656de6ce
db: Adjust the query methods to accept std::strings
2021-07-06 10:20:46 +02:00
Peter Keresztes Schmidt
c60b577aec
Convert more char array buffers to std::string
...
Remove now unused ZM_SQL_*SIZE defines
2021-07-06 10:20:46 +02:00
Peter Keresztes Schmidt
f675afc3f2
zmc: Convert internals to std::chrono
2021-06-13 23:22:51 +02:00
Peter Keresztes Schmidt
707975e567
Monitor: Convert API to std::chrono
2021-06-13 23:22:49 +02:00
Peter Keresztes Schmidt
7474294ac3
Time: Remove DELTA_TIMEVAL macro and replace usage with proper std::chrono::duration operations
2021-06-06 16:41:36 +02:00
Isaac Connor
5a8fa9efc9
Remove dead code and useless debug
2021-05-12 18:54:07 -04:00
Isaac Connor
2cf6ad8089
Switch ZMPacket * to a shared_ptr<ZMPacket>. This is so that in LockedPacket we can unlock and then notify and be confident that packet_ won't have been deleted. Change ZMPacket->timestamp to be a timeval instead of timeval *. This might not have been necessary but I like it. No longer cuse the ZMPacket object to wrap the shared image buffers and timestamps. Use a vector for image_buffers.
2021-05-08 21:14:20 -04:00
Isaac Connor
8f27db5d6f
Do not stop dbQueue in logTerm. dbQueue is not just for logging.
2021-05-04 14:22:02 -04:00
Isaac Connor
bf72bb2a22
Increase sleep after prime failure up to a minute.
2021-05-03 10:38:01 -04:00
Isaac Connor
59b1927ad6
do dbQUeue.stop in logTerm so we don't have to have an extra line in every executable
2021-05-01 14:49:33 -04:00
Peter Keresztes Schmidt
68bedfe48f
Fix logging format string mismatches
...
* Remove SZFMTD format macro and use %zu instead for size_t. %zu is understood by every compiler nowadays.
2021-04-30 00:26:24 +02:00
Isaac Connor
76080cb857
add a stop function to dbQueue to clear out the queue before we kill log.
2021-04-23 09:25:07 -04:00
Isaac Connor
1f48dbbf6c
Use %u instead of %d for monitor id
2021-04-20 17:15:39 -04:00
Isaac Connor
c479c6d68f
Must disconnect on error/reload to avoid memleak. Remove waiting 5 second on failure/reload.
2021-04-17 12:50:26 -04:00
Isaac Connor
4255f78602
Use monitor->Importance in passing severity of log message about failed to Prime Capture
2021-04-11 12:59:18 -04:00
Peter Keresztes Schmidt
b5f3682d4e
utils: some more reshuffling/grouping and formatting
2021-04-04 01:18:34 +02:00
Isaac Connor
2b34d09b84
Move analysis_thread into Monitor. Don't do extra gettimeofday if no delays are set. Fix status update on terminate
2021-03-17 12:49:50 -04:00
Isaac Connor
b5f45b0987
fix alignment of help
2021-03-11 13:16:44 -05:00
Isaac Connor
46bf765f80
Set heartbeat on startup. Fix logic in ShmValid
2021-03-08 18:31:01 -05:00
Peter Keresztes Schmidt
d9568a98c0
Drop zm_thread which has been replaced by STL implementations
2021-03-04 10:55:46 +01:00
Peter Keresztes Schmidt
e18750bb79
logger: Pass std::string as ID during logInit
2021-03-01 22:43:02 +01:00
Peter Keresztes Schmidt
6dc132df27
zmc: Use fmt to construct the log ID
2021-03-01 22:43:02 +01:00
Isaac Connor
3ce4b3e657
Keep capture_delay in useconds instead of msecs. Fix fps by adding back in the previous sleep_time. Fix crash due to capture_image not being asigned for local cameras
2021-02-25 16:58:54 -05:00
Isaac Connor
224fcd2cd3
Merge branch 'master' of github.com:ZoneMinder/zoneminder
2021-02-25 14:58:45 -05:00
Isaac Connor
8aeb4ab758
Switch db_mutex to a std::mutex. Use modern locking with it. Use zmDbDo or dbQueue.push where appropriate. code cleanup.
2021-02-25 12:26:26 -05:00
Isaac Connor
381b7e1b25
Don't disconnect/reconnect while PrimeCapture is failing. Don't sleep if there is failure in capturing and zm_terminate is set.
2021-02-24 10:29:26 -05:00
Isaac Isaac
3eb67fa2fc
We have to Prime every monitor not just the first one.
2021-02-23 13:12:40 -05:00
Isaac Connor
0b0df96271
Merge branch 'master' of github.com:ZoneMinder/zoneminder
2021-02-18 16:05:10 -05:00
Isaac Connor
519e39b4f4
Reloading has to stop other threads while we are re-initing the logs. So move it down
2021-02-17 10:07:36 -05:00
Peter Keresztes Schmidt
c0151caa64
Monitor: Signal by making the camera a unique_ptr the ownership relation
...
In addition we get RAII and thus automatic destruction of the camera when the monitor is destructed.
Monitor API change: getCamera -> LoadCamera
If additional properties of the camera are needed externally they should be exposed directly via Monitor.
2021-02-11 19:22:22 +01:00
Peter Keresztes Schmidt
35514649c9
Monitor: Make audio and video streams directly accessible
...
Also remove Camera::getId() which returend the monitor ID. Since a camera is owned by an monitor, there is no need for this. Also it causes a circular include.
2021-02-11 19:22:22 +01:00
Peter Keresztes Schmidt
ede811df50
zmc: Simplify Monitor's shutdown procedure
...
disconnect() is already called in the destructor. Since `monitors` goes out of scope all instances will get automatically destructed. There is no need to manually call disconnect().
2021-02-11 19:22:22 +01:00
Peter Keresztes Schmidt
0a665c0710
Monitor: Close the associated camera when closing the monitor
...
The camera is owned by the monitor. There is no reason to keep the camera open, when the owner is closed.
2021-02-11 19:22:22 +01: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
Isaac Connor
fab7efa003
Fix PrimeCapture on local cams. We need to be able to call it for each monitor
2021-02-09 20:29:37 -05:00