Commit Graph

183 Commits

Author SHA1 Message Date
Isaac Connor
4863febff0 Split out seeking code into ::seek. Test for no rows returned when loading by monitor_id and time. Use SystemTimePoint instead of time_t. Add setStreamStart(event_id, time) 2026-01-05 16:37:30 -05:00
Isaac Connor
920d38b4cd include filesystem since we use std::filesystem::exists 2025-11-11 13:13:53 -05:00
Isaac Connor
1b2fd12f57 Fix warnings about unequal frame coutns 2025-10-11 10:56:05 -04:00
Isaac Connor
b66bfc8960 Prevent looking for a last frame that doesn't actually exist 2025-09-16 15:58:19 -04:00
Isaac Connor
e931f5ee40 Send an error image instead of ISE when we can't get the required frame 2025-08-26 08:08:06 -04:00
Isaac Connor
4757d711ef Change various cases of int img_buffer_size to size_t 2025-07-19 14:18:32 -04:00
Isaac Connor
9d0f2c25bb Small debug cleanup 2025-06-11 14:51:43 -04:00
Isaac Connor
0d34e4647a Log scale in debug about status command 2024-12-09 19:07:51 -05:00
Isaac Connor
02871576a5 Add fps to event status. Convert CmdTimer to Interval 2024-10-22 18:22:19 -04:00
Isaac Connor
33ede2f7d1 FIx floating point exception 2024-09-27 16:17:09 -04:00
Isaac Connor
c6e5ff43e7 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2024-09-27 16:01:20 -04:00
Isaac Connor
3802ec17d3 Add test for 0 duration may fix floating point exceptions 2024-09-27 10:01:09 -04:00
Isaac Connor
bf7920bad8 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2024-09-24 19:30:47 -04:00
Isaac Connor
37fef75eff Handle 0 frame_mod 2024-09-24 17:23:23 -04:00
Isaac Connor
a28d88880f Merge branch 'master' of github.com:ZoneMinder/zoneminder 2024-09-22 08:20:08 -04:00
Isaac Connor
312a15801e Using last_delta really doesn't work. Instead let's use remaining time/remaining frames. 2024-09-20 18:54:54 -04:00
Isaac Connor
3dd08cd213 Load duration from the db instead of calculating it from start and endtime. This gives us the decimal part as well. 2024-09-19 16:09:38 -04:00
Isaac Connor
7c8738e976 Correct log in debug statusment 2024-09-16 17:22:27 -04:00
Isaac Connor
e68fb77e4b Take frame_mod into account when calculating time to sleep. Fixes rate not really working. 2024-09-16 16:41:00 -04:00
Isaac Connor
1deccb8cf4 Instead of just exiting, set zm_terminate to true so we exit gracefully 2024-08-22 19:09:15 -04:00
Isaac Connor
d968e243ff Implement mode=single for events, so that we can efficiently just grab a single frame 2024-08-19 18:26:35 -04:00
Isaac Connor
5237641efe Fix calculation for when to send a keepalive image. Possible fixes #4101 2024-08-13 16:38:14 -04:00
Isaac Connor
9b1f3fd3e1 Use better format specifiers 2024-05-24 16:06:21 -04:00
Isaac Connor
5e1596d9f5 Fix panning not working when paused. Also fixes SCALE. Fixes #3947 2024-04-05 09:32:05 -04:00
Aaron Kling
c4683d90a9 Format code using astyle google format
Commands used:
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.cpp
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.h
2024-03-26 13:43:58 -05:00
Isaac Connor
2d73a083b5 curr_frame_id should never be 0. So set it to 1 instead 2024-01-29 13:30:17 -05:00
Isaac Connor
39e03e6a3c Fix infinite loop in the event there is only the initial frame in the db. 2024-01-18 14:16:38 -05:00
Isaac Connor
7280329e6e Split long line 2024-01-17 17:09:43 -05:00
Isaac Connor
bc11f5cdac Fix never gapless events not working. Put mutex around status sending because event_data may change at any moment. Fix 100% cpu use when at end of event and not moving to next event, hence paused. 2023-11-01 17:27:56 -04:00
Isaac Connor
5bb7529c3e Just code cleanups, but also add a mysqL-free_result which should fix a mem leak 2023-11-01 17:27:56 -04:00
Isaac Connor
b7424b5bea Test for seek beyond event length and frame_id > last_frame_id 2023-10-16 14:33:57 -04:00
Isaac Connor
61791c76a3 Adjust debug level of no event change required line as it repeats a billion times.. 2023-10-16 14:05:12 -04:00
Isaac Connor
277f856452 Move lock lower down to where it is crucial. When debugging offsets, use %.6f instead of %.2f 2023-10-16 12:14:38 -04:00
Isaac Connor
f39b3f0583 Reduce debug levels. Pass along Width and Height when instantiating Image from AVFrame so that it can scale to a lower res. 2023-08-02 13:56:06 -04:00
Isaac Connor
01b886ef49 Add scale to status and fix cast on elapsed 2023-04-06 15:15:36 -04:00
Isaac Connor
7e489f7fa2 When there are NO frames in the db, populate the list of frames by 1/fps. 2022-12-07 12:26:51 -05:00
Isaac Connor
c2680f7f77 Turn failure to send into a debug. When running under fpm etc we may not get SIGPIPE. 2022-10-17 17:22:23 -04:00
Isaac Connor
319904ab80 When we increment past the event, fix the curr_frame_id so we reference the last image. 2022-09-14 18:30:39 -04:00
Isaac Connor
4668ffcaa9 rework event stream. Fixes seeking. Fixes event not completing due to not have Frame records for every frame. Adds send_twice to deal with browsers not showing the last sent image. Use locking around anything to do with curr_frame_id as commandQueue is it's own thread now. 2022-09-13 16:16:54 -04:00
Isaac Connor
8549cdf317 Implement a mutex/locks around changing event data, curr_frame_id, etc. also contains a fix for seeking due to > instead of <. In general fixes seeking 2022-09-12 16:17:42 -04:00
Isaac Connor
8558ade8f1 Merge branch 'master' into misc_fixes 2022-08-25 18:33:06 -04:00
Isaac Connor
b9c97e6795 Fix crash due to deplicated join. Don't output BOUNDARY unless image loading suceeds 2022-08-16 15:15:01 -04:00
Isaac Connor
aa030afcb6 Make checkCommandQueue it's own thread, meaning we use blocking I/O and will still respond when it takes forever to send a jpeg. Make warning about broken stream into a Debug. The signal doesn't set zm_terminate fast enough. 2022-08-15 17:58:56 -04:00
Doug Nazar
9385127b50 Consolidate temp_img_buffer resizing and use correct delete[] operator 2022-07-30 22:27:41 -04:00
Doug Nazar
f4dd897ef4 Convert AVFrame* to custom unique_ptr (av_frame_ptr).
Switch all owning AVFrame* variables to av_frame_ptr for
automatic cleanup.

Use AVBufferRef to store frame data in AVFrame where appropriate
so that it can be freed automatically with it's AVFrame.

Handle allocation errors.
2022-07-30 13:21:11 -04:00
Doug Nazar
3b21153757 Fix various printf formats for 32bit, 32bit w/_FILE_OFFSET_BITS=64 and 64-bit 2022-07-16 03:18:18 -04:00
Isaac Connor
a4621b3ade Zoom in/out by increments of 10. Implement handling of ZOOMSTOP command 2022-06-17 15:12:47 -04:00
Isaac Connor
cd2c977ed8 Merge branch 'master' into replace_function_concept 2022-02-16 14:25:38 -05:00
Isaac Connor
2336926d90 Rework to remove static temp_img_buffer. Is now a class member. Must be allocated as needed. Use new reworked zm_sendfile and handle if not all bytes are sent. Fixes #3437. 2022-02-16 14:16:01 -05:00
Isaac Connor
33f23cbd84 Sync up n_frames, frame_count, curr_frame_id on int instead of a mix of long int, int and unsigned long int 2022-02-15 18:52:46 -05:00