航煜网络相关调整

PtzNew
Matthew 3 months ago
parent 5c7f6abb71
commit 4ba4be427e

@ -1766,8 +1766,14 @@ bool CPhoneDevice::TakeVideoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
return false;
}
std::string streamingUrl = vendorCtrl->GetStreamingUrl(localPhotoInfo.channel);
std::string streamingUrl = vendorCtrl->GetStreamingUrl(localPhotoInfo.cameraId);
if (streamingUrl.empty())
{
XYLOG(XYLOG_SEVERITY_ERROR, "Invalid Streaming URL CH=%u PR=%X PHOTOID=%u", (uint32_t)localPhotoInfo.channel, (unsigned int)localPhotoInfo.preset, localPhotoInfo.photoId);
TakePhotoCb(0, localPhotoInfo, "", 0);
return false;
}
// strcpy(netPhotoInfo.outputPath, path.c_str());
// strcpy(netPhotoInfo.interface, "eth0");

@ -28,9 +28,10 @@ std::string HangYuCtrl::GetStreamingUrl(uint8_t channel)
// /LAPI/V1.0/Channels/<ID>/Media/Video/Streams/<ID>/LiveStreamURL?TransType=<Tran
// sType>&TransProtocol=<TransProtocol>
char url[128] = { 0 };
snprintf(url, sizeof(url), "/Streams/%u/1/Transport", (uint32_t)channel);
snprintf(url, sizeof(url), "http://%s/Streams/%u/1/Transport", m_ip.c_str(), (uint32_t)channel);
std::vector<uint8_t> resData;
int res = DoGetRequest(url, HTTP_AUTH_TYPE_BASIC, m_userName.c_str(), m_password.c_str(), m_netHandle, resData);
if (res != 0 || resData.empty())
{
@ -49,9 +50,8 @@ std::string HangYuCtrl::GetStreamingUrl(uint8_t channel)
{
return "";
}
strncpy(url, start, end - start);
return std::string(url);
return std::string(start, end);
}
bool HangYuCtrl::UpdateTime(time_t ts)

Loading…
Cancel
Save