码迷,mamicode.com
首页 > 其他好文 > 详细

Onvif 获取指定通道的流媒体地址

时间:2014-08-04 20:54:27      阅读:2148      评论:0      收藏:0      [点我收藏+]

标签:ar   代码   amp   new   size   c   type   res   

GetStreamUri函数可以获取流媒体地址。
代码如下:
void UserGetUri(const char* xAddr)
{
  int result=0 ;
  struct soap *soap = soap_new();
  struct _trt__GetStreamUri trt__GetStreamUri ;
  struct _trt__GetStreamUriResponse trt__GetStreamUriResponse;
  printf("\n\n---------------Getting Uri----------------\n\n");

  trt__GetStreamUri.StreamSetup = (struct tt__StreamSetup *)soap_malloc(soap, sizeof(struct tt__StreamSetup));
  trt__GetStreamUri.StreamSetup->__any = NULL;
  trt__GetStreamUri.StreamSetup->__anyAttribute = NULL;
  trt__GetStreamUri.StreamSetup->__size = 1;
  trt__GetStreamUri.StreamSetup->Stream = tt__StreamType__RTP_Unicast;
  trt__GetStreamUri.StreamSetup->Transport = (struct tt__Transport *)soap_malloc(soap,sizeof(struct tt__Transport));
  trt__GetStreamUri.StreamSetup->Transport->Protocol = tt__TransportProtocol__UDP;
  trt__GetStreamUri.StreamSetup->Transport->Tunnel = NULL;
  trt__GetStreamUri.ProfileToken = soap_malloc(soap, 1024);
  strcpy(trt__GetStreamUri.ProfileToken , "Token_000"); //指明哪一通道的流媒体地址
  soap_call___trt__GetStreamUri(soap, xAddr, NULL, &trt__GetStreamUri, &trt__GetStreamUriResponse);

  if (soap->error)
  {
    printf("soap error: %d, %s, %s\n", soap->error, *soap_faultcode(soap), *soap_faultstring(soap));
    result = soap->error;

  }

  else
  {
    printf("!!!!NOTE: RTSP Addr Get Done is :%s \n",trt__GetStreamUriResponse.MediaUri->Uri);
  }

}

Onvif 获取指定通道的流媒体地址,布布扣,bubuko.com

Onvif 获取指定通道的流媒体地址

标签:ar   代码   amp   new   size   c   type   res   

原文地址:http://www.cnblogs.com/haiqin2014/p/3890605.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!