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.

50 lines
1.1 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "onvifclientreplay.hpp"
  2. inline OnvifClientReplay::OnvifClientReplay(OnvifClientDevice &device)
  3. : m_Device(device), replayProxy(SOAP_C_UTFSTRING)
  4. {
  5. }
  6. inline OnvifClientReplay::~OnvifClientReplay()
  7. {
  8. }
  9. ONVIFLIB_API inline int OnvifClientReplay::GetReplayUri(string recordingToken, string &replayUrl)
  10. {
  11. string strUrl;
  12. string strUser;
  13. string strPass;
  14. _trp__GetReplayUri req;
  15. _trp__GetReplayUriResponse resp;
  16. tt__StreamSetup StreamSetup;
  17. tt__Transport Transport;
  18. Transport.Protocol = tt__TransportProtocol__RTSP;
  19. StreamSetup.Stream = tt__StreamType__RTP_Unicast;
  20. StreamSetup.Transport = &Transport;
  21. if (m_Device.GetUserPasswd(strUser, strPass) == false
  22. || m_Device.GetReplayUrl(strUrl) == false)
  23. {
  24. return SOAP_ERR;
  25. }
  26. replayProxy.soap_endpoint = strUrl.c_str();
  27. soap_wsse_add_Security(&replayProxy);
  28. soap_wsse_add_UsernameTokenDigest(&replayProxy, "Id",
  29. strUser.c_str() , strPass.c_str());
  30. req.RecordingToken = recordingToken;
  31. req.StreamSetup = &StreamSetup;
  32. int ret = replayProxy.GetReplayUri( &req, &resp);
  33. if (ret == SOAP_OK)
  34. {
  35. replayUrl = resp.Uri;
  36. }
  37. return ret;
  38. }