You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

496 lines
38 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __PONVIF_CLASS_HEADER__
  2. #define __PONVIF_CLASS_HEADER__
  3. // Based on PHP Onvif library
  4. #include <curl/curl.h>
  5. #include <vector>
  6. #include <openssl/sha.h>
  7. #include <pthread.h>
  8. #include "../protocol/xmlParser.h"
  9. #include "../../alg/generic/base64.h"
  10. #include "../../components/base/basicTypes.h"
  11. #include "../../components/base/basicLogCollection.h"
  12. //#define DEBUG_ONVIF_PRINTOUT_MESSAGES
  13. //#define DEBUG_ONVIF_TRAFFIC
  14. #define PONVIF_DEFAULT_DISCOVERYBINDIP "0.0.0.0"
  15. #define PONVIF_DEFAULT_DISCOVERYMCASTIP "239.255.255.250"
  16. #define PONVIF_DEFAULT_DISCOVERYMCASTPORT 3702
  17. #define PONVIF_DEFAULT_DISCOVERYTIMEOUT 12
  18. #define PONVIF_PACK_DISCOVERY "<?xml version=\"1.0\" encoding=\"UTF-8\"?><e:Envelope xmlns:e=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:w=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:d=\"http://schemas.xmlsoap.org/ws/2005/04/discovery\" xmlns:dn=\"http://www.onvif.org/ver10/network/wsdl\"><e:Header><w:MessageID>uuid:84ede3de-7dec-11d0-c360-f01234567890</w:MessageID><w:To e:mustUnderstand=\"true\">urn:schemas-xmlsoap-org:ws:2005:04:discovery</w:To><w:Action a:mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</w:Action></e:Header><e:Body><d:Probe><d:Types>dn:NetworkVideoTransmitter</d:Types></d:Probe></e:Body></e:Envelope>"
  19. #define PONVIF_PACK_GET_SYS_DTS "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetSystemDateAndTime xmlns=\"http://www.onvif.org/ver10/device/wsdl\"/></s:Body></s:Envelope>"
  20. #define PONVIF_PACK_GET_CAPABILITIES "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetCapabilities xmlns=\"http://www.onvif.org/ver10/device/wsdl\"><Category>All</Category></GetCapabilities></s:Body></s:Envelope>"
  21. #define PONVIF_PACK_GET_VIDEO_SOURCES "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetVideoSources xmlns=\"http://www.onvif.org/ver10/media/wsdl\"/></s:Body></s:Envelope>"
  22. #define PONVIF_PACK_GET_PROFILES "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetProfiles xmlns=\"http://www.onvif.org/ver10/media/wsdl\"/></s:Body></s:Envelope>"
  23. #define PONVIF_PACK_GET_SERVICES "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetServices xmlns=\"http://www.onvif.org/ver10/device/wsdl\"><IncludeCapability>false</IncludeCapability></GetServices></s:Body></s:Envelope>"
  24. #define PONVIF_PACK_GET_DEV_INFO "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetDeviceInformation xmlns=\"http://www.onvif.org/ver10/device/wsdl\"/></s:Body></s:Envelope>"
  25. #define PONVIF_PACK_GET_STREAM_URI "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetStreamUri xmlns=\"http://www.onvif.org/ver10/media/wsdl\"><StreamSetup><Stream xmlns=\"http://www.onvif.org/ver10/schema\">%%STREAM%%</Stream><Transport xmlns=\"http://www.onvif.org/ver10/schema\"><Protocol>%%PROTOCOL%%</Protocol></Transport></StreamSetup><ProfileToken>%%PROFILETOKEN%%</ProfileToken></GetStreamUri></s:Body></s:Envelope>"
  26. #define PONVIF_PACK_GET_PICTURE_URI "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetSnapshotUri xmlns=\"http://www.onvif.org/ver10/media/wsdl\"><ProfileToken>%s</ProfileToken></GetSnapshotUri></s:Body></s:Envelope>"
  27. #define PONVIF_PACK_GET_PRESETS "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetPresets xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken></GetPresets></s:Body></s:Envelope>"
  28. #define PONVIF_PACK_GET_PTZ_NODE "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetNode xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><NodeToken>%s</NodeToken></GetNode></s:Body></s:Envelope>"
  29. #define PONVIF_PACK_GET_PTZ_STATUS "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GetStatus xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken></GetStatus></s:Body></s:Envelope>"
  30. #define PONVIF_PACK_GOTO_PRESET "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><GotoPreset xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><PresetToken>%s</PresetToken><Speed><PanTilt x=\"%%SPEEDPANTILTX%%\" y=\"%%SPEEDPANTILTY%%\" xmlns=\"http://www.onvif.org/ver10/schema\"/><Zoom x=\"%%SPEEDZOOMX%%\" xmlns=\"http://www.onvif.org/ver10/schema\"/></Speed></GotoPreset></s:Body></s:Envelope>"
  31. #define PONVIF_PACK_REMOVE_PRESET "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><RemovePreset xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><PresetToken>%s</PresetToken></RemovePreset></s:Body></s:Envelope>"
  32. #define PONVIF_PACK_SET_PRESET "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><SetPreset xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><PresetName>%s</PresetName></SetPreset></s:Body></s:Envelope>"
  33. #define PONVIF_PACK_RELATIVE_MOVE "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><RelativeMove xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><Translation><PanTilt x=\"%%TRANSLATIONPANTILTX%%\" y=\"%%TRANSLATIONPANTILTY%%\" space=\"http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace\" xmlns=\"http://www.onvif.org/ver10/schema\"/></Translation><Speed><PanTilt x=\"%%SPEEDPANTILTX%%\" y=\"%%SPEEDPANTILTY%%\" space=\"http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace\" xmlns=\"http://www.onvif.org/ver10/schema\"/></Speed></RelativeMove></s:Body></s:Envelope>"
  34. #define PONVIF_PACK_RELATIVE_ZOOM "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><RelativeMove xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><Translation><Zoom x=\"%%ZOOM%%\" space=\"http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace\" xmlns=\"http://www.onvif.org/ver10/schema\"/></Translation><Speed><Zoom x=\"%%SPEEDZOOM%%\" space=\"http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace\" xmlns=\"http://www.onvif.org/ver10/schema\"/></Speed></RelativeMove></s:Body></s:Envelope>"
  35. #define PONVIF_PACK_ABSOLUTE_MOVE "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><AbsoluteMove xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><Position><PanTilt x=\"%0.5f\" y=\"%0.5f\" space=\"http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace\" xmlns=\"http://www.onvif.org/ver10/schema\"/><Zoom x=\"%0.5f\" space=\"http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace\" xmlns=\"http://www.onvif.org/ver10/schema\"/></Position></AbsoluteMove></s:Body></s:Envelope>"
  36. #define PONVIF_PACK_CONTINUOUS_MOVE "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><ContinuousMove xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><Velocity><PanTilt x=\"%%VELOCITYPANTILTX%%\" y=\"%%VELOCITYPANTILTY%%\" space=\"http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace\" xmlns=\"http://www.onvif.org/ver10/schema\"/></Velocity></ContinuousMove></s:Body></s:Envelope>"
  37. #define PONVIF_PACK_CONTINUOUS_ZOOM "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><ContinuousMove xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><Velocity><Zoom x=\"%%ZOOM%%\" space=\"http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace\" xmlns=\"http://www.onvif.org/ver10/schema\"/></Velocity></ContinuousMove></s:Body></s:Envelope>"
  38. #define PONVIF_PACK_PTZ_STOP "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"><s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><Stop xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\"><ProfileToken>%s</ProfileToken><PanTilt>%%PANTILT%%</PanTilt><Zoom>%%ZOOM%%</Zoom></Stop></s:Body></s:Envelope>"
  39. #define PONVIF_ENVELOPE_EXT "<?xml version=\"1.0\" encoding=\"UTF-8\"?><e:Envelope xmlns:e=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:w=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:d=\"http://schemas.xmlsoap.org/ws/2005/04/discovery\" xmlns:dn=\"http://www.onvif.org/ver10/network/wsdl\">%s%s</e:Envelope>"
  40. #define PONVIF_ENVELOPE_SIM "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\">%s%s</s:Envelope>"
  41. #define PONVIF_BODY "<s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">%s</s:Body>"
  42. #define PONVIF_HEADER_PROBE "<e:Header><w:MessageID>uuid:84ede3de-7dec-11d0-c360-f01234567890</w:MessageID><w:To e:mustUnderstand=\"true\">urn:schemas-xmlsoap-org:ws:2005:04:discovery</w:To><w:Action a:mustUnderstand=\"true\">http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</w:Action></e:Header>"
  43. #define PONVIF_HEADER_SECUR "<s:Header><Security s:mustUnderstand=\"1\" xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"><UsernameToken><Username>%s</Username><Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest\">%s</Password><Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">%s</Nonce><Created xmlns=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">%s</Created></UsernameToken></Security></s:Header>"
  44. #define PONVIF_PCK_GET_CAPABILITIES "<GetCapabilities xmlns=\"http://www.onvif.org/ver10/device/wsdl\"><Category>All</Category></GetCapabilities>"
  45. typedef struct S_accessToken{
  46. char USERNAME[CTEXT];
  47. char PASSDIGEST[CTEXT];//SHA_DIGEST_LENGTH];
  48. char NONCE[CTEXT];//SHA_DIGEST_LENGTH];
  49. char TIMESTAMP[CTEXT];
  50. } accessToken;
  51. typedef struct S_videoSourceProfile{
  52. char sourcetoken[CTEXT];
  53. char profiletoken[CTEXT];
  54. char profilename[CTEXT];
  55. char encoding[16];
  56. int width;
  57. int height;
  58. int fps;
  59. int bitrate;
  60. } videoSourceProfile;
  61. typedef struct S_onvifVideoResolution{
  62. int Width;
  63. int Height;
  64. }onvifVideoResolution;
  65. typedef struct S_onvifBacklightCompensation{
  66. bool Mode;
  67. float Level;
  68. }onvifBacklightCompensation;
  69. typedef enum E_onvifExposurePriority{
  70. LowNoise = 0,
  71. FrameRate
  72. }onvifExposurePriority;
  73. typedef struct S_onvifRectangle{
  74. int x;
  75. int y;
  76. int width;
  77. int height;
  78. }onvifRectangle;
  79. typedef struct S_onvifExposure{
  80. bool Mode;
  81. onvifExposurePriority Priority;
  82. onvifRectangle Window;
  83. float MinExposureTime;
  84. float MaxExposureTime;
  85. float MinGain;
  86. float MaxGain;
  87. float MinIris;
  88. float MaxIris;
  89. float ExposureTime;
  90. float Gain;
  91. float Iris;
  92. }onvifExposure;
  93. typedef enum E_onvifOnOffAuto{
  94. ON = 0,
  95. OFF,
  96. AUTO
  97. }onvifOnOffAuto;
  98. typedef struct S_onvifFocusConfiguration{
  99. bool AutoFocusMode;
  100. float DefaultSpeed;
  101. float NearLimit;
  102. float FarLimit;
  103. }onvifFocusConfiguration;
  104. typedef struct S_onvifWideDynamicRange{
  105. bool Mode;
  106. float Level;
  107. }onvifWideDynamicRange;
  108. typedef struct S_onvifWhiteBalanceExtension{
  109. }onvifWhiteBalanceExtension;
  110. typedef struct S_onvifWhiteBalance{
  111. bool Mode;
  112. float CrGain;
  113. float CbGain;
  114. onvifWhiteBalanceExtension * Extension;
  115. }onvifWhiteBalance;
  116. typedef struct S_onvifImagingSettingsExtension{
  117. }onvifImagingSettingsExtension;
  118. typedef struct S_onvifImagingSettings{
  119. onvifBacklightCompensation * BacklightCompensation;
  120. float Brightness;
  121. float ColorSaturation;
  122. float Contrast;
  123. onvifExposure * Exposure;
  124. onvifFocusConfiguration * Focus;
  125. onvifOnOffAuto IrCutFilter;
  126. float Sharpness;
  127. onvifWideDynamicRange * WideDynamicRange;
  128. onvifWhiteBalance * WhiteBalance;
  129. onvifImagingSettingsExtension * Extension;
  130. }onvifImagingSettings;
  131. typedef struct S_onvifVideoSourceExtension{
  132. onvifImagingSettings * Imaging;
  133. }onvifVideoSourceExtension;
  134. typedef struct S_onvifVideoSource{
  135. char token[CTEXT];
  136. float Framerate;
  137. onvifVideoResolution Resolution;
  138. onvifImagingSettings * Imaging;
  139. onvifVideoSourceExtension * Extension;
  140. }videoSource;
  141. typedef struct S_onvifSupportedVersions{
  142. int Major;
  143. int Minor;
  144. }onvifSupportedVersions;
  145. typedef struct S_onvifNetworkCapabilitiesExtension2{
  146. }onvifNetworkCapabilitiesExtension2;
  147. typedef struct S_onvifNetworkCapabilitiesExtension{
  148. bool Dot11Configuration;
  149. onvifNetworkCapabilitiesExtension2 * Extension;
  150. }onvifNetworkCapabilitiesExtension;
  151. typedef struct S_onvifNetworkCapabilities{
  152. bool IPFilter;
  153. bool ZeroConfiguration;
  154. bool IPVersion6;
  155. bool DynDNS;
  156. onvifNetworkCapabilitiesExtension * Extension;
  157. }onvifNetworkCapabilities;
  158. typedef struct S_onvifIOCapabilitiesExtension2{
  159. }onvifIOCapabilitiesExtension2;
  160. typedef struct S_onvifIOAuxiliaryData{
  161. }onvifIOAuxiliaryData;
  162. typedef struct S_onvifIOCapabilitiesExtension{
  163. bool Auxiliary;
  164. onvifIOAuxiliaryData * AuxiliaryCommands;
  165. onvifIOCapabilitiesExtension2 * Extension;
  166. }onvifIOCapabilitiesExtension;
  167. typedef struct S_onvifIOCapabilities{
  168. int InputConnectors;
  169. int RelayOutputs;
  170. onvifIOCapabilitiesExtension * Extension;
  171. }onvifIOCapabilities;
  172. typedef struct S_onvifSecurityCapabilitiesExtension2{
  173. bool Dot1X;
  174. int SupportedEAPMethod;
  175. bool RemoteUserHandling;
  176. }onvifSecurityCapabilitiesExtension2;
  177. typedef struct S_onvifSecurityCapabilitiesExtension{
  178. bool TLS1_0;
  179. onvifSecurityCapabilitiesExtension2 * Extension;
  180. }onvifSecurityCapabilitiesExtension;
  181. typedef struct S_onvifSecurityCapabilities{
  182. bool TLS1_1;
  183. bool TLS1_2;
  184. bool OnboardKeyGeneration;
  185. bool AccessPolicyConfig;
  186. bool X_509Token;
  187. bool SAMLToken;
  188. bool KerberosToken;
  189. bool RELToken;
  190. onvifSecurityCapabilitiesExtension * Extension;
  191. }onvifSecurityCapabilities;
  192. typedef struct S_onvifSystemCapabilitiesExtension2{
  193. }onvifSystemCapabilitiesExtension2;
  194. typedef struct S_onvifSystemCapabilitiesExtension{
  195. bool HttpFirmwareUpgrade;
  196. bool HttpSystemBackup;
  197. bool HttpSystemLogging;
  198. bool HttpSupportInformation;
  199. onvifSystemCapabilitiesExtension2 * Extension;
  200. }onvifSystemCapabilitiesExtension;
  201. typedef struct S_onvifSystemCapabilities{
  202. bool DiscoveryResolve;
  203. bool DiscoveryBye;
  204. bool RemoteDiscovery;
  205. bool SystemBackup;
  206. bool SystemLogging;
  207. bool FirmwareUpgrade;
  208. onvifSupportedVersions * SupportedVersions;
  209. onvifSystemCapabilitiesExtension * Extension;
  210. }onvifSystemCapabilities;
  211. typedef struct S_onvifDeviceCapabilitiesExtension{
  212. }onvifDeviceCapabilitiesExtension;
  213. typedef struct S_onvifAnalyticsCapabilities{
  214. char XAddr[CTEXT];
  215. bool RuleSupport;
  216. bool AnalyticsModuleSupport;
  217. }onvifAnalyticsCapabilities;
  218. typedef struct S_onvifDeviceCapabilities{
  219. char XAddr[CTEXT];
  220. onvifNetworkCapabilities * Network;
  221. onvifSystemCapabilities * System;
  222. onvifIOCapabilities * IO;
  223. onvifSecurityCapabilities * Security;
  224. onvifDeviceCapabilitiesExtension * Extension;
  225. }onvifDeviceCapabilities;
  226. typedef struct S_onvifEventCapabilities{
  227. char XAddr[CTEXT];
  228. bool WSSubscriptionPolicySupport;
  229. bool WSPullPointSupport;
  230. bool WSPausableSubscriptionManagerInterfaceSupport;
  231. }onvifEventCapabilities;
  232. typedef struct S_onvifImagingCapabilities{
  233. char XAddr[CTEXT];
  234. }onvifImagingCapabilities;
  235. typedef struct S_onvifRealTimeStreamingCapabilitiesExtension{
  236. }onvifRealTimeStreamingCapabilitiesExtension;
  237. typedef struct S_onvifRealTimeStreamingCapabilities{
  238. bool RTPMulticast;
  239. bool RTP_TCP;
  240. bool RTP_RTSP_TCP;
  241. onvifRealTimeStreamingCapabilitiesExtension * Extension;
  242. }onvifRealTimeStreamingCapabilities;
  243. typedef struct S_onvifProfileCapabilities{
  244. int MaximumNumberOfProfiles;
  245. }onvifProfileCapabilities;
  246. typedef struct S_onvifMediaCapabilitiesExtension{
  247. onvifProfileCapabilities * ProfileCapabilities;
  248. }onvifMediaCapabilitiesExtension;
  249. typedef struct S_onvifMediaCapabilities{
  250. char XAddr[CTEXT];
  251. onvifRealTimeStreamingCapabilities * StreamingCapabilities;
  252. onvifMediaCapabilitiesExtension * Extension;
  253. }onvifMediaCapabilities;
  254. typedef struct S_onvifPTZCapabilities{
  255. char XAddr[CTEXT];
  256. }onvifPTZCapabilities;
  257. typedef struct S_onvifDeviceIOCapabilities{
  258. char XAddr[CTEXT];
  259. int VideoSources;
  260. int VideoOutputs;
  261. int AudioSources;
  262. int AudioOutputs;
  263. int RelayOutputs;
  264. }onvifDeviceIOCapabilities;
  265. typedef struct S_onvifDisplayCapabilities{
  266. char XAddr[CTEXT];
  267. bool FixedLayout;
  268. }onvifDisplayCapabilities;
  269. typedef struct S_onvifRecordingCapabilities{
  270. char XAddr[CTEXT];
  271. bool ReceiverSource;
  272. bool MediaProfileSource;
  273. bool DynamicRecordings;
  274. bool DynamicTracks;
  275. int MaxStringLength;
  276. }onvifRecordingCapabilities;
  277. typedef struct S_onvifSearchCapabilities{
  278. char XAddr[CTEXT];
  279. bool MetadataSearch;
  280. }onvifSearchCapabilities;
  281. typedef struct S_onvifReplayCapabilities{
  282. char XAddr[CTEXT];
  283. }onvifReplayCapabilities;
  284. typedef struct S_onvifReceiverCapabilities{
  285. char XAddr[CTEXT];
  286. bool RTP_Multicast;
  287. bool RTP_TCP;
  288. bool RTP_RTSP_TCP;
  289. int SupportedReceivers;
  290. int MaximumRTSPURILength;
  291. }onvifReceiverCapabilities;
  292. typedef struct S_onvifAnalyticsDeviceExtension{
  293. }onvifAnalyticsDeviceExtension;
  294. typedef struct S_onvifAnalyticsDeviceCapabilities{
  295. char XAddr[CTEXT];
  296. bool RuleSupport;
  297. onvifAnalyticsDeviceExtension * Extension;
  298. }onvifAnalyticsDeviceCapabilities;
  299. typedef struct S_onvifCapabilitiesExtension2{
  300. }onvifCapabilitiesExtension2;
  301. typedef struct S_onvifCapabilitiesExtension{
  302. onvifDeviceIOCapabilities * DeviceIO;
  303. onvifDisplayCapabilities * Display;
  304. onvifRecordingCapabilities * Recording;
  305. onvifSearchCapabilities * Search;
  306. onvifReplayCapabilities * Replay;
  307. onvifReceiverCapabilities * Receiver;
  308. onvifAnalyticsDeviceCapabilities * AnalyticsDevice;
  309. onvifCapabilitiesExtension2 * Extensions;
  310. }onvifCapabilitiesExtension;
  311. typedef struct S_nodeCapability{
  312. onvifAnalyticsCapabilities * Analytics;
  313. onvifDeviceCapabilities * Device;
  314. onvifEventCapabilities * Events;
  315. onvifImagingCapabilities * Imaging;
  316. onvifMediaCapabilities * Media;
  317. onvifPTZCapabilities * PTZ;
  318. onvifCapabilitiesExtension * Extension;
  319. }nodeCapability;
  320. typedef struct S_discoveryNodeInfo{
  321. char endpoint_uid[64];
  322. char types[CTEXT];
  323. char scopes[CTEXT];
  324. char x_addrs[CTEXT];
  325. char meta_version[10];
  326. char ip_addrs[32];
  327. }discoveryNodeInfo;
  328. typedef std::vector<videoSourceProfile *> videoSourceProfiles;
  329. typedef std::vector<videoSource *> videoSources;
  330. typedef std::vector<discoveryNodeInfo *> discoveryResults;
  331. class pOnvif{
  332. private:
  333. CURL * m_pCURL;
  334. basicLogCollection * m_pLog;
  335. CSTR m_pIpAddress;
  336. CSTR m_pUsername;
  337. CSTR m_pPassword;
  338. CSTR m_pDeviceURI;
  339. int m_pLastIndex;
  340. CSTR m_pMediaURI;
  341. CSTR m_pSnapshotURI;
  342. CSTR m_pPTZURI;
  343. CSTR m_pBaseURI;
  344. onvifSupportedVersions m_sOnvifVersion;
  345. time_t m_nDeltaTime;
  346. videoSources m_vVideoSources;
  347. videoSourceProfiles m_vVideoProfiles;
  348. videoSourceProfiles m_vActiveSources;
  349. nodeCapability m_sCapabilities;
  350. CSTR m_pProxyHost;
  351. int m_nProxyPort;
  352. CSTR m_pProxyUsername;
  353. CSTR m_pProxyPassword;
  354. CSTR m_pLastResponse;
  355. bool m_bIntransingent;
  356. time_t m_nDiscoveryTimeout;
  357. CSTR m_pDiscoveryBindIP;
  358. CSTR m_pDiscoveryMCastIP;
  359. int m_nDiscoveryMCastPort;
  360. bool m_bDiscoveryHideDuplicates;
  361. static int _writer( char *data, size_t size, size_t nmemb, pOnvif *Ptr );
  362. public:
  363. pOnvif();
  364. ~pOnvif();
  365. bool setProxyHost( CSTR proxyHost );
  366. CSTR getProxyHost( void );
  367. bool setProxyPort( int proxyPort);
  368. int getProxyPort( void );
  369. bool setProxyUsername( CSTR proxyUsername );
  370. CSTR getProxyUsername( void );
  371. bool setProxyPassword( CSTR proxyPassword );
  372. CSTR getProxyPassword( void );
  373. bool setUsername( CSTR username );
  374. CSTR getUsername( void );
  375. bool setPassword( CSTR password );
  376. CSTR getPassword( void );
  377. CSTR getDeviceUri( void );
  378. bool setDeviceUri( CSTR deviceUri );
  379. CSTR getIPAddress( void );
  380. bool setIPAddress( CSTR ipAddress );
  381. videoSources * getSources( void );
  382. videoSourceProfiles * getProfiles( void );
  383. videoSourceProfiles * getActiveProfiles( void );
  384. CSTR getMediaUri( void );
  385. CSTR getPTZUri( void );
  386. CSTR getBaseUrl( void );
  387. void getSupportedVersion( void );
  388. nodeCapability * getCapabilities( void );
  389. bool setBreakOnError( bool intransingent );
  390. CSTR getLastResponse( void );
  391. bool setDiscoveryTimeout( int discoverytimeout );
  392. bool setDiscoveryBindIp( CSTR discoverybindip );
  393. bool setDiscoveryMcastIp( CSTR discoverymcastip );
  394. bool setDiscoveryMcastPort( int discoverymcastport );
  395. bool setDiscoveryHideDuplicates( bool discoveryhideduplicates );
  396. CSTR getSnapshotUri( void );
  397. discoveryResults discover( void );
  398. bool create( void );
  399. struct tm * core_GetSystemDateAndTime( void );
  400. bool core_GetCapabilities();
  401. bool core_GetDeviceInformation();
  402. bool media_GetVideoSources();
  403. bool media_GetProfiles();
  404. bool media_GetServices();
  405. CSTR media_GetStreamUri( CSTR profileToken, CSTR stream="RTP-Unicast", CSTR protocol="RTSP" );
  406. CSTR media_GetSnapshotUri( CSTR profileToken );
  407. bool ptz_GetPresets( CSTR profileToken );
  408. bool ptz_GetNode( CSTR ptzNodeToken );
  409. bool ptz_GetStatus( CSTR profileToken );
  410. bool ptz_GotoPreset( CSTR profileToken, CSTR presetToken, float speed_pantilt_x, float speed_pantilt_y, float speed_zoom_x );
  411. bool ptz_RemovePreset( CSTR profileToken, CSTR presetToken );
  412. bool ptz_SetPreset( CSTR profileToken, CSTR presetName );
  413. bool ptz_RelativeMove( CSTR profileToken, float translation_pantilt_x, float translation_pantilt_y, float speed_pantilt_x, float speed_pantilt_y );
  414. bool ptz_RelativeMoveZoom( CSTR profileToken, float zoom, float speedZoom );
  415. bool ptz_AbsoluteMove( CSTR profileToken, float position_pantilt_x, float position_pantilt_y, float zoom );
  416. bool ptz_ContinuousMove( CSTR profileToken, float velocity_pantilt_x, float velocity_pantilt_y);
  417. bool ptz_ContinuousMoveZoom( CSTR profileToken, float zoom );
  418. bool ptz_Stop( CSTR profileToken, bool pantilt, bool zoom );
  419. /*
  420. Internal functions
  421. */
  422. private:
  423. accessToken _makeToken( void );
  424. void _getOnvifVersion( nodeCapability &capabilities );
  425. void _getActiveSources( videoSourceProfiles &videoSources, videoSourceProfiles profiles );
  426. void _getProfileData( videoSourceProfiles &videoSources, videoSourceProfiles profiles );
  427. //protected function _xml2array($response);
  428. accessToken _passwordDigest( CSTR username, CSTR password, time_t timestamp = 0, uint32_t nonce = 0 );
  429. bool _send_request( CSTR url, CSTR post_string );
  430. };
  431. #endif