Isaac Connor
05043a37b1
include image index in debug
2022-01-19 12:27:16 -05:00
Isaac Connor
76fe20c69f
Only send analysis_frame if doing motion detection. Add debuging. Remove other debugging
2022-01-07 15:57:28 -05:00
Isaac Connor
df0a0c7853
Add CMD_ANALYZE_ON and OFF
2022-01-07 13:50:40 -05:00
Isaac Connor
58858d2d25
Include alarm_image in shared_mem
2022-01-07 13:12:44 -05:00
Isaac Connor
6d3c6330df
Fix freebsd build by fixing incorrect use of SystemTimePoint when we want TimePoint
2022-01-07 10:34:44 -05:00
Isaac Connor
5933aa8a6f
Use > 0.0 instead of boolean when testing maxfps
2021-12-28 15:34:31 -05:00
Isaac Connor
81048b6191
Reduce code
2021-12-17 13:29:30 -05:00
Isaac Connor
77793da70e
If no max_fps set we don't care how long it takes to send frame
2021-12-17 13:29:30 -05:00
Isaac Connor
60d2186ff4
Move from SystemTimePoint to SteadyTimePoint where possible. Implement MAXFPS command. Change the logic of calculating sleep time to make more sense. Get rid of frame_mod use in favour of calculating when then next frame should get sent and just waiting till then.
2021-12-16 16:35:20 -05:00
Isaac Connor
4edd5c1bf5
Don't alter maxfps. Just report that we are too slow. Don't use ZM_RATE_BASE in sleep time calculations it amplifies the sleep seconds by 100 times. Removing allows us to view a full framerate.
2021-12-15 16:57:17 -05:00
Isaac Connor
2529765df3
timestamp image before scaling. Fixes lack of scaling when TIMESTAMP_ON_CAPTURE
...
is off
2021-11-19 11:59:19 -05:00
Isaac Connor
c76e688f05
Don't exit(0) on QUIT. Instead set zm_terminate=true so that all the cleanup routines run.
2021-11-12 15:11:48 -05:00
Mike Dussault
d38a6adec4
No behavior change. Added non-const versions of Image::Buffer and fixed a few places that were casting away the constness.
2021-10-12 21:54:49 +00:00
Isaac Connor
a9379e5813
Need to increase frame_count or else frame_count%frame_mod will never == 0
2021-09-10 10:58:06 -04:00
Isaac Connor
328bd15360
Fix frame_count fps when paused
2021-08-30 18:06:05 -04:00
Isaac Connor
381fa0d08d
Fix viewing fps display by keeping track of last update time, last frame count and actually calculate it based on frames sent over a period of time.
2021-08-30 17:55:32 -04:00
Isaac Connor
848a537a0f
Fix zms giving 500 code instead of displaying error image due to not having sent the headers yet.
2021-08-23 18:10:31 -04:00
Peter Keresztes Schmidt
80b08a2075
Convert path buffers depending on PATH_MAX to std::string
2021-07-06 10:33:17 +02:00
Peter Keresztes Schmidt
6114d40593
misc: Replace usleep with std::this_thread::sleep_for
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
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