Isaac Connor
cab4c24d06
Remove redundant notify_all, spelling mistake
2021-09-15 14:11:32 -04:00
Isaac Connor
ef74294d32
More properly fix the threading lock. Instead of waiting on a packet, release it and wait on the packetqueue.
2021-09-15 14:10:25 -04:00
Isaac Connor
31a6ab2224
notify anyone waiting in packetqueue before waiting on a packet in motion detection. Should fix decode lockup
2021-09-15 14:09:31 -04:00
Isaac Connor
132fc84c31
Spacing and fix the bogus setting shared_data->valid to false on disconnect. Other processes call disconnect. Only the capturing thread should set it to false.
2021-09-03 11:35:54 -04:00
Isaac Connor
1a6dc18a09
simplify test for being decoded. timestamping needs to be done as well
2021-06-08 14:05:23 -04:00
Isaac Connor
25bce3b8ca
Adjust debug logging
2021-06-08 14:04:44 -04:00
Isaac Connor
85b35cf82c
Use new get_packet_and_increment_it in decoder. Adjust some debugging levels
2021-06-08 14:04:35 -04:00
Isaac Connor
a676f7c407
SHould reset state as well as shared_data->state
2021-06-08 13:56:03 -04:00
Isaac Connor
eda96d24e0
fix crash when in alert state with no event
2021-06-08 13:55:47 -04:00
Isaac Connor
797a4adf70
Merge branch 'master' into fix_out_of_files_in_encoding
2021-05-20 18:56:16 -04:00
Isaac Connor
2f78916ab8
change mem_file to std::string to resolve initialization problems
2021-05-20 16:28:22 -04:00
Isaac Connor
7ad92e51c3
Fix initializers to compile on centos7
2021-05-20 15:56:15 -04:00
Isaac Connor
ccc4d4af54
Merge branch 'master' into fix_out_of_files_in_encoding
2021-05-17 16:32:58 -04:00
Isaac Connor
24b3f4c1b7
When de-interlacing, need to wait for decoder. Fixes race
2021-05-17 16:32:33 -04:00
Isaac Connor
56a1e8d13b
cleanup CheckSignal, set usedsubpixorder
2021-05-17 16:29:57 -04:00
Peter Keresztes Schmidt
b1de220958
Polygon: Perform clip operation on existing object instead of returning a new clipped one
2021-05-16 19:42:41 +02:00
Peter Keresztes Schmidt
09665b139f
Monitor: Clip zone polygon to image size when dumping
...
The polygon vertex coordinated of extra_zone are directly parsed from user input.
Clip the resulting polygon to the image size so we don't try to draw outside of the image.
This is already done for zone polygons stored and loaded from the DB.
2021-05-16 19:41:45 +02:00
Peter Keresztes Schmidt
5af6d6af3d
Polygon: Use std::vector to store the vertices
2021-05-16 16:42:58 +02:00
Peter Keresztes Schmidt
e6c159fb70
Vector2: Make coordinate components public
...
The components were already unconditionally/without side-effects writable. Let's make them public so we don't need the setters.
2021-05-16 16:42:58 +02:00
Peter Keresztes Schmidt
60db1c2eaf
Coord: Rename to Vector2
...
The class is not only used to represent coordinates but also lengths in XY.
Vector2 is a more fitting/general name for this purpose.
2021-05-14 20:14:50 +02:00
Isaac Connor
a56b4053fa
Use resize in stead of reserve so that image_buffer.size actually has a value
2021-05-13 14:24:03 -04:00
Isaac Connor
d52b53e690
Add further bounds checks when accessing image_buffer
2021-05-13 09:31:59 -04:00
Isaac Connor
5a8fa9efc9
Remove dead code and useless debug
2021-05-12 18:54:07 -04:00
Isaac Connor
6f977da94d
Fix potential outofbounds access to image_buffer in getSnapshot()
2021-05-12 14:21:54 -04:00
Isaac Connor
3cd9bdccd5
style and performance improvements reported by cppcheck
2021-05-09 16:39:38 -04:00
Isaac Connor
e970c46f7b
fix memleak. Fixes #3217
2021-05-09 07:18:36 -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
9ee24170a9
use packetqueue.unlock instead of deleting the lock so that we wake up people waiting
2021-05-08 15:57:00 -04:00
Isaac Connor
d3e91da514
sigh. Move the snap unlock further down protecting another use of snap. Use a video test instead of image count to determine videoness of the snap
2021-05-08 12:35:28 -04:00
Isaac Connor
bd6566a819
Have to clearpacket while holding the lock on snap. Otherwise it can get deleted the moment we unlock it.
2021-05-08 12:26:13 -04:00
Isaac Connor
9c6d3989d3
Fix cases of failing to get second packet in de-interlacing
2021-05-07 14:03:36 -04:00
Isaac Connor
4ea48708ed
move the code that waits for decoder to outside the motion detection area. In record mode decoding can happen behind analysis which seems like a good idea, except that then analysis won't free up the raw image.
2021-05-07 09:09:40 -04:00
Isaac Connor
934c726beb
Handle camera not being defined in SubpixelOrder and Colours. Remove subpixelorder as it exists in camera only
2021-05-03 15:19:45 -04:00
Isaac Connor
80d2f9f098
Revert "Don't consult a Camera object to return colours and subpixelorder, we have those as members. Fixes crash in zms"
...
This reverts commit 48f79da892
.
2021-05-03 14:19:34 -04:00
Isaac Connor
48f79da892
Don't consult a Camera object to return colours and subpixelorder, we have those as members. Fixes crash in zms
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
0da4127114
cleanup ready_count update unneeded. Fix crash on reload due to being disconnected.
2021-04-29 07:07:12 -04:00
Isaac Connor
e53628e0bd
Remove old deinterlace code, make new code in ::decode. For 4 field, use the next image in the queue isntead of doing another capture
2021-04-28 16:13:41 -04:00
Isaac Connor
75973a2df1
Check for thread status before waiting. Fixes hang
2021-04-27 10:28:46 -04:00
Isaac Connor
df5b14dbd4
Merge pull request #3221 from Carbenium/zone-stats
...
Some optimizations/cleanups concerning Zones and ZoneStats
2021-04-27 09:26:07 -04:00
Peter Keresztes Schmidt
6d06eac55e
Monitor: Fix a crash when destroying a monitor (shutdown)
...
We have to make sure close_event_thread is joined before we destroy the thread object,
otherwise std::terminate will be called.
2021-04-25 23:09:32 +02:00
Peter Keresztes Schmidt
4180bc99ac
Zone: Sprinkle some const-ness
...
Keep references in for-loops const if no modifications are preformed on the object.
2021-04-25 22:34:33 +02:00
Peter Keresztes Schmidt
eb51408ef9
ZMPacket+Frame: Use vector to store ZoneStats
...
We don't any of the usage patterns that would warrant a std::list (random insert/deletion). Switch to vector which has much lower overhead for this kind of usage.
2021-04-25 22:29:18 +02:00
Peter Keresztes Schmidt
ad32a94931
ZoneStats: Rename members according to Google style guide
2021-04-25 17:18:07 +02:00
Isaac Connor
95a715a96a
When resume is given, clear the ref image, so that analysis can re-assign it. Don't do ref image in decode, leave it for analysis only. Handle zm_terminate after waiting for decode.
2021-04-23 14:52:29 -04:00
Isaac Connor
3e88f60f6d
Fix end code block comment on DetectMotion
2021-04-23 09:19:13 -04:00
Isaac Connor
8671e65517
More work on flushing out ZoneStats. Use references to avoid copying
2021-04-21 21:40:39 -04:00
Isaac Connor
be9c5d3f95
Introduce a ZoneStats structure/class and implement a list of them in packet, frame. Store the stats in a list in the packet until it is time to write them to the db in the event. Hence implement batched queuing of stats.
2021-04-21 17:51:43 -04:00
Isaac Connor
8ca93d2f0b
store event stats regardless of savejpegs or image availability
2021-04-21 14:59:57 -04:00
Isaac Connor
b2f96728d5
Spacing and improve debugging
2021-04-20 23:06:04 -04:00