waitMoveIsDone() used to poll GetStatus for at most ~4 s and only
understood MoveStatus. Cameras that report only the position (or report
MoveStatus only away from 0/0/0) always ran into the timeout.
- After create(), protocolPTZ_ONVIF detects what the camera reports:
PTZ GetServiceCapabilities (MoveStatus / StatusPosition attributes)
plus a real GetStatus probe. The result is logged
("PTZ status support: ...").
- waitMoveIsDone():
* MoveStatus cameras: poll every 200 ms until pan/tilt and zoom are
IDLE (IDLE right after the command is ignored for 1 s unless the
camera was seen MOVING or is already on target);
* position-only cameras: until the AbsoluteMove target is reached or
the position stops changing;
* cameras reporting neither: fixed 3 s wait.
Gives up after 10 s, falls back to the fixed wait after 3 failed
GetStatus calls.
- pOnvif::ptz_GetStatus: Position and MoveStatus are optional in the
schema; read every element NULL-safe, always read MoveStatus, report
hasPosition / hasZoomPosition / isMoving.
- pOnvif::_send_request: arm the reply flag before queuing the request
and ignore late replies of timed-out requests, so a poll can no longer
get the answer of the previous request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16