Commit Graph

169 Commits

Author SHA1 Message Date
Isaac Connor
b64520649d Use std::shared_ptr to fix memory leak due to use of GetSnapshot and not freeing the returned packet. 2026-01-20 16:18:43 -05:00
Isaac Connor
47cc713eaa Re-enable analysis image viewing 2026-01-16 16:02:19 -05:00
Isaac Connor
2f73e0591d feat: add last_analysis_viewed_time tracking for analysis image viewers
Add SharedData field and methods to track when analysis images are being
viewed, mirroring the existing last_viewed_time functionality. This allows
the analysis process to know if someone is actively viewing analysis images.

- Add last_analysis_viewed_time to SharedData struct
- Add getLastAnalysisViewed(), setLastAnalysisViewed(), hasAnalysisViewers()
- Update MonitorStream to set flag when streaming FRAME_ANALYSIS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 10:13:23 -05:00
Isaac Connor
adba371cd1 pause when we receive CMD_STOP 2025-08-07 14:39:04 -04:00
Isaac Connor
283b62a3bf Fix format string for size_t 2025-07-19 16:58:29 -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
14d6234e57 Make frame send time a debug 2024-12-09 12:26:51 -05:00
Isaac Connor
42914b63c0 Remove unneeded initialisations and group command processor code together 2024-10-20 18:04:12 -04:00
Isaac Connor
bc1a7af1fc Add analysing to monitor status stream 2024-10-02 09:30:03 -04:00
Isaac Connor
0780032149 Add score to monitorstream status 2024-10-01 16:28:56 -04:00
Isaac Connor
e6f9dbae2e move image_count to shared mem. Use it in monitorstream to detect when last_write_time % buffer_count hasn't changed, but there is in fact a new image. 2024-05-21 14:53:52 -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
b87c86621a Set zm_terminate on io error 2024-02-08 14:42:08 -05:00
Isaac Connor
79ce5cf80f When monitor is Decoding==None send a more informative text image saying so. Instead of simply returning, set zm_terminate and go through the normal flow so that comms thread and db threads terminate as well. Might fixes zms hangs 2024-02-08 10:58:58 -05:00
Isaac Connor
3fe8f2f4b3 Better debug on waiting for capture to begin. Only send error image once, as we are in single image mode 2024-01-11 10:12:00 -05:00
Isaac Connor
8617c09f16 Implement new zms parameters frames= which is the # of frames to send when in streaming mode. The idea is to replicate single mode, but allowing for other intermediate images, like Waiting for Connection etc. type=single should only ever send 1 single image. 2024-01-04 11:37:49 -05:00
Isaac Connor
c598f49b55 Comment out pixformat line to stop warnings 2024-01-02 16:24:44 -05:00
Isaac Connor
7a6c0e2743 Comment out unneeded debug 2023-12-19 10:54:35 -05:00
Isaac Connor
c2f05911b1 Put a 1 sec wait limit on zms when in single image mode. 2023-12-03 09:15:28 -05:00
Alejandro Criado-Pérez
543683aa4c Corrections on cpp and h files 2023-08-13 01:27:19 +02:00
Isaac Connor
a4c14eb890 Don't crash when not able to connect to monitor 2023-08-02 15:11:13 -04:00
Isaac Connor
01257d2ca1 Output debug the pixformat of the shm image 2023-07-21 15:09:51 -04:00
Isaac Connor
32ffee0a75 When waiting for capture, output text images saying so with a keepalive frequency 2023-06-12 09:22:16 -04:00
Isaac Connor
8676da6ead If monitor has been deleted, we won't be able to connect to it. Show an instructive jpeg and exit. 2023-05-10 13:06:09 -04:00
Isaac Connor
3f3d9cb421 Don't crash when doing single image of a monitor that isn't running 2023-04-25 10:18:37 -04:00
Isaac Connor
c61d5ce341 Implement ZOOMSTOP for live monitor view 2023-04-13 12:25:08 -04:00
Isaac Connor
87f4f9afbd Add scale to status for monitorStream 2023-04-06 19:02:50 -04:00
Isaac Connor
a7b1379502 Add AVPixelFormat to shm for each image, disable analysis image viewing. The cp to shm is too expensive. Need something better. 2023-02-22 05:59:16 -05:00
Isaac Connor
5fdf66b51c Instead of return, set zm_terminate and continue so that we join the command processor thread and don't crash 2022-11-16 10:33:10 -05:00
Isaac Connor
de012de198 Add a debug to tell if we got back from joining command_processor 2022-10-25 09:22:17 -04: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
8558ade8f1 Merge branch 'master' into misc_fixes 2022-08-25 18:33:06 -04:00
Isaac Connor
e655cc345f Fix crash due to deplicated join. 2022-08-16 15:16:37 -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
Isaac Connor
05155cff73 Zoom by 10% instead of 25% 2022-05-07 11:38:10 -04:00
Isaac Connor
8d38d1c36e Implement 25% zoom incrementts with no max 2022-05-06 12:11:47 -04:00
Isaac Connor
c42a5759a4 Remove unneeded setLastViewed 2022-04-28 19:17:21 -04:00
Isaac Connor
a247645046 Use std::this_thread::sleep_for(MAX_SLEEP); instead 2022-04-28 17:13:47 -04:00
Isaac Connor
aab717bc91 Add early test for zm_terminate after processing comms 2022-04-28 16:45:54 -04:00
Isaac Connor
554217931c Remove debugging 2022-04-28 16:43:13 -04:00
Isaac Connor
eeb69cbb54 Move the tests for monitor connectedness down into the main while loop so that we also check for feof etc. The gist is to stay running even if monitor is not running. We will wait for it to come back 2022-04-28 16:41:11 -04:00
Isaac Connor
e7dcfa6166 Put back code that calculates how long it takes to send a frame, but make it just a debug instead of a warning when we are too slow 2022-04-20 09:58:37 -04:00
Isaac Connor
88665a68f5 Don't warn about not being able to keep up to maxfps 2022-04-10 13:09:55 -04:00
Isaac Connor
ed41e63980 Can't treat anlysing as a boolean because ANALYSING_NONE==1. Should fix zm oing motion detection when set to NONE 2022-03-20 19:13:46 -04:00
Isaac Connor
9b9746113e If we asked for stream, keep streaming even not decoding or other problem. We will wait for the situation to change 2022-03-04 12:06:24 -05:00
Isaac Connor
cd2c977ed8 Merge branch 'master' into replace_function_concept 2022-02-16 14:25:38 -05:00
Isaac Connor
c9de883a7c Rework to remove static temp_img_buffer. Is now a class member. Must be allocated as needed. 2022-02-16 14:18:37 -05:00
Isaac Connor
23bfbcd6ce Merge branch 'master' into multistream 2022-01-26 10:13:20 -05:00
Isaac Connor
05043a37b1 include image index in debug 2022-01-19 12:27:16 -05:00