ZoneMinder::Control::Reolink refactoring

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
User avatar
The Eye
Posts: 9
Joined: Thu Feb 18, 2021 7:50 pm

ZoneMinder::Control::Reolink refactoring

Post by The Eye »

I took the liberty of a first stab at the source - see attachment.

It shall be deemed work-in-progress because it is neither finished, nor sufficiently tested (beyond a perl -c) yet.
It seems, that compared with the other Control modules the Reolink code is at technical debt level 9000. :wink:

For now removed like 50% of the code, which was just brutal copy&paste boilerplate and suddenly the
code starts revealing what it aims to do. My guess is that the 39000 bytes can be cut to 10000 and
hopefully I will eventually make the Reolink module the shiniest one. 8)

Will need more quality time with the code still, so JFYI that something like that is happening.

PS: "Invalid file extension for .pm files..." :roll: - so .txt it is.
Attachments
Reolink.txt
Rename to Reolink.pm
(19.11 KiB) Downloaded 238 times
testing ZM v1.34.23 - a Turnkey Linux appliance VM running on Proxmox
VM has currently 8 Denverton Cores, 4GB RAM of which are 2.5GB shared memory, 1TB disk space
2 x Reolink RLC-410 5MP
User avatar
The Eye
Posts: 9
Joined: Thu Feb 18, 2021 7:50 pm

Re: ZoneMinder::Control::Reolink refactoring

Post by The Eye »

Next iteration.

I shall - however - deep dive into ZoneMinder::ONVIF and therefore the ONVIF::Client rabbit hole. Maybe even most of this code will not be necessary anymore.

Reolink claims their cams do support ONVIF 2.1 and I would think the right way to do things would be some nice GetCapabilities voodoo before doing something with the camera (according to what the camera claims it is capable to do). And then I suppose it wouldn't even need a Reolink-specific code.
Attachments
Reolink.txt
removal of copies of string constants
(16.72 KiB) Downloaded 229 times
testing ZM v1.34.23 - a Turnkey Linux appliance VM running on Proxmox
VM has currently 8 Denverton Cores, 4GB RAM of which are 2.5GB shared memory, 1TB disk space
2 x Reolink RLC-410 5MP
jperkins
Posts: 50
Joined: Sat Jan 23, 2021 11:08 am

Re: ZoneMinder::Control::Reolink refactoring

Post by jperkins »

I'd hate to see your work go to waste. When I submitted a very small pull request it was applied quickly. Please note I did not read your changes but based on your comment maybe you would want to start with something smaller at first. Of course if you just wanna modify your own copy of Zoneminder, have at it. I'm fairly certain posting changes like this will never improve zoneminder . Hope this helps

https://github.com/ZoneMinder/zoneminde ... l-Requests
User avatar
The Eye
Posts: 9
Joined: Thu Feb 18, 2021 7:50 pm

Re: ZoneMinder::Control::Reolink refactoring

Post by The Eye »

jperkins wrote: Sun Feb 21, 2021 8:48 pm Please note I did not read your changes but based on your comment maybe you would want to start with something smaller at first.
Not sure what you mean by smaller. This thread isn't meant as a side-channel for patch submission, it's a JFYI.
I'm very well aware of the standard GitHub PR process.
testing ZM v1.34.23 - a Turnkey Linux appliance VM running on Proxmox
VM has currently 8 Denverton Cores, 4GB RAM of which are 2.5GB shared memory, 1TB disk space
2 x Reolink RLC-410 5MP
User avatar
iconnor
Posts: 2862
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ZoneMinder::Control::Reolink refactoring

Post by iconnor »

Thanks for taking this on.
Post Reply