mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 12:14:36 -05:00
getCamParams() and _setImaging() addressed the imaging service with a literal VideoSourceToken of 000. That token is a different namespace from the media ProfileToken carried in ControlDevice, so it could not be configured around: on an AMLINK AL5M-T5171EW the media profiles are MediaProfile00000 while the video source is 00000, and the camera answers a request for 000 with "The requested VideoSource does not exist." Brightness (Iris) and Contrast (White) control were unusable on any camera that does not happen to number its first video source 000. Read the token from GetVideoSources on first use and cache it. The fallback to 000 is applied per call rather than cached, so a camera that is unreachable when the control daemon starts gets another chance instead of being pinned to the wrong token for the life of the daemon. Parsing is split out as video_source_token_from_xml() so it can be tested without a camera, matching the pattern used by the HikVision light helpers. Verified against a live AMLINK AL5M-T5171EW: token discovered as 00000, irisAbsOpen(step 10) moved Brightness 50 -> 60, restored to 50. (cherry picked from commit 7f1935d69d58b3e2bbf71a54fe11b1a6b4bc30af)