问题描述
- onvif GetCapabilities获取不到
-
我最近在学习基于ONVIF的视频传输,目前进展到GetCapabilities阶段,但是我也不知道是什么原因,soap_call___tds__GetCapabilities的返回一直是soap->error,希望有ONVIF开发经验的大神们,帮帮忙!具体问题在二楼!
解决方案
soap_1 = soap_new();
if(soap_1 == NULL)
{
printf("soap_1 error!n");
return -1;
}
soap_set_namespaces(soap_1, namespaces);
capa_req->sizeCategory = 1;
enum ttCapabilityCategory temp_category = tt__CapabilityCategory__Media;
capa_req->Category = (enum tt__CapabilityCategory*)malloc(sizeof(enum tt__CapabilityCategory));
capa_req->Category = &temp_category;
capa_resp->Capabilities = (struct tt__Capabilities *)malloc(sizeof(struct tt__Capabilities)) ;
result = soap_call___tds__GetCapabilities(soap_1,resp.wsdd__ProbeMatches->ProbeMatch->XAddrs, NULL, capa_req, capa_resp);
解决方案二:
结构体的填充的代码如楼上所示,希望有这方面开发经验的大神帮帮忙指出问题!
时间: 2025-01-20 22:15:38