Commit Graph

94 Commits

Author SHA1 Message Date
Peter Keresztes Schmidt
e1fe53338c BaseStream: Convert internals to std::chrono 2021-06-13 11:29:59 +02:00
Peter Keresztes Schmidt
6c68397249 Time: Convert some timeval operations to std::chrono
Also remove now defunct timeval helper methods.
2021-06-07 23:53:53 +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
Peter Keresztes Schmidt
a9ad5c5eee Build: Promote libavcodec to a required dependency
FFmpeg is an integral component of ZM. Promote the appropriate libraries to required dependencies.
This reduces the possible build configurations greatly and thus maintenance burden.
2021-06-05 14:25:54 +02: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
4f4a1a4565 if sendTextFrame fails, just exit. 2021-05-03 16:27:37 -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
77055ee1cc Remove unused code 2021-04-20 16:18:50 -04:00
Isaac Connor
e373e871da Fix memleak caused by loadMonitor that is already loaded 2021-04-12 15:59:31 -04:00
Isaac Connor
7adeb87041 fix logic that would leak mem by called loadMonitor repeatedly 2021-04-12 15:59:31 -04:00
Peter Keresztes Schmidt
9f643ddd00 MonitorStream: Actually use the MAX_SLEEP_USEC variable meant for this class 2021-04-11 14:39:08 +02:00
Isaac Connor
fe17d7bb23 Add checks for aliveness of monitor in streaming. If decoding disabled can't view stream. 2021-03-16 20:09:14 -04:00
Isaac Connor
028f2dd626 Debug extra error log and code style 2021-03-16 13:27:27 -04: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
6a47780f60 Fix a warning reported by -Wextra
/home/peterke/DEV/zoneminder/src/zm_monitor.h: In member function ‘Monitor::TriggerState Monitor::GetTriggerState() const’:
/home/peterke/DEV/zoneminder/src/zm_monitor.h:499:76: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
  499 |   TriggerState GetTriggerState() const { return (TriggerState)(trigger_data?trigger_data->trigger_state:TRIGGER_CANCEL); }
      |                                                                ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-02-27 01:27:58 +01:00
Isaac Connor
6c013f0e65 Put back includes needed on FreeBSD. Fixes #3165 2021-02-22 08:03:10 -05:00
Isaac Connor
59cdf971fa convert last_read_index and last_write_index to int32_t so that we can have -1 as a value in other functions. 2021-02-16 14:43:52 -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
09d8dbb460 spacing 2021-02-02 23:19:53 -05:00
Isaac Connor
c0a2286dee Code style 2021-01-08 15:49:21 -05:00
Isaac Connor
48d9b4d5a5 Remove unused variables 2020-12-23 18:50:52 -05:00
Isaac Connor
50e1e4391a Include capture_fps and analysis_fps in status 2020-12-09 15:00:29 -05:00
Isaac Connor
b261fbb397 Merge branch 'master' into zma_to_thread 2020-12-07 16:26:26 -05:00
Isaac Connor
4f178e47bc Break early after setting zm_terminate so that zms quits faster. Use a basic assignment instead of memcpy for last_frame_timestamp 2020-11-19 16:39:53 -05:00
Isaac Connor
df783f4835 Merge branch 'master' into zma_to_thread 2020-11-12 12:53:55 -05:00
Isaac Connor
a857f677a6 cppcheck fixes, mostly %d->%u 2020-11-02 12:45:48 -05:00
Isaac Connor
a39a656373 Merge branch 'master' into zma_to_thread 2020-09-29 11:02:40 -04:00
Isaac Connor
77b978ed26 Handle non-connected monitor in processCmd. Quit when zm_terminate in checkInitiialized loop 2020-09-02 17:22:39 -04:00
Isaac Connor
43e1ac2ad4 Send Text frame when unable to connect to the monitor. 2020-09-02 16:35:27 -04:00
Peter Keresztes Schmidt
8f980a1168 Convert NULL/0 to nullptr
The 0 -> nullptr changes should definitely improve readability.
2020-08-26 22:03:40 +02:00
Andrew Bauer
ccda2b3707 EPIPE sets zm_terminate so no need to check 2020-08-18 09:37:21 -05:00
Andrew Bauer
62d687adfa dont warn or error for EPIPE errno's 2020-08-18 09:30:06 -05:00
Isaac Connor
5fb56c9f57 Merge branch 'master' into zma_to_thread 2020-08-07 17:52:43 -04:00
Isaac Connor
2f57ccc9b9 Merge branch 'release-1.34' 2020-07-29 16:27:01 -04:00
Isaac Connor
4ed0ad26a7 bail early if fwrite fails 2020-07-29 14:01:52 -04:00
Isaac Connor
859428db51 remove debug 2020-07-24 15:42:53 -04:00
Isaac Connor
f4a0f91d7f nothing 2020-07-24 15:27:05 -04:00
Isaac Connor
869860bb26 Merge branch 'master' into zma_to_thread 2020-07-21 17:49:39 -04:00
Isaac Connor
7575afc8d5 Merge branch 'master' into zma_to_thread 2020-07-21 17:38:32 -04:00
Isaac Connor
e675c8373e Merge branch 'release-1.34' 2020-07-07 16:15:56 -04:00
Isaac Connor
c79c65e72e spacing fixes 2020-07-07 16:14:57 -04:00
Isaac Connor
4ff341a0f5 Merge branch 'master' into zma_to_thread 2020-05-02 18:03:42 -04:00
Isaac Connor
17356a7b3a Use a BOUNDARY define to construct boundary strings. Get rid of code that kills zms when the frame rate drops too low, as dying doesn't help, and some cameras just have a really low frame rate. 2020-04-14 17:01:12 -04:00
Isaac Connor
9193ef4a62 Send the first frame twice to fix low framerate display in Chrome 2020-04-14 16:44:03 -04:00
Isaac Connor
f065daf940 spacing, move some variables deeper in scope, merge fprintf calls 2019-12-29 16:46:30 -05:00
Isaac Connor
09fcbad666 Merge branch 'master' into zma_to_thread 2019-11-30 14:59:39 -05:00
Isaac Connor
b787682fa9 Fix play from pause when not buffering. When change of zoom, send two paused images so that response is instant. Fix some misplaced line feeds. 2019-09-26 13:51:13 -04:00
Isaac Connor
396be10d6f Merge branch 'master' into zma_to_thread 2019-08-22 12:57:00 -04:00
Isaac Connor
90cb5d018a Fix 2673 (#2675)
* Change MaxFPS to DECIMAL(5,3) to handle values like 1/60 = 0.017

* When fps < 1 we may need to wait longer than 10s.  Also, we cannot sleep for a long time, because we may need to send a keep alive or check the command queue. So limit the sleep to 1s

* Bump version

* Update MaxFPS to Decimal(5,3)

* Fix missing ;
2019-07-31 11:42:38 -04:00
Isaac Connor
4b8a2a94e3 reduce frame send time too slow to a warning instead of error 2019-06-05 10:12:56 -04:00