修复编译错误

PtzNew
Matthew 3 months ago
parent 6f56bf0fe3
commit d206a59d9a

@ -2,9 +2,12 @@
// Created by Matthew on 2025/3/4. // Created by Matthew on 2025/3/4.
// //
#include "YuShiCtrl.h" #include "HangYuCtrl.h"
#include "netcamera.h"
#include "httpclient.h" #include "httpclient.h"
#include <cstring>
HangYuCtrl::~HangYuCtrl() HangYuCtrl::~HangYuCtrl()
{ {
@ -17,7 +20,7 @@ bool HangYuCtrl::SetOsd()
void HangYuCtrl::EnableOsd(bool enable) void HangYuCtrl::EnableOsd(bool enable)
{ {
return false; // return false;
} }
std::string HangYuCtrl::GetStreamingUrl(uint8_t channel) std::string HangYuCtrl::GetStreamingUrl(uint8_t channel)
@ -35,7 +38,7 @@ std::string HangYuCtrl::GetStreamingUrl(uint8_t channel)
} }
resData.push_back(0); resData.push_back(0);
const char* start = strstr(&resData[0], "<RTSPURI>"); const char* start = strstr((const char*)&resData[0], "<RTSPURI>");
if (start == NULL) if (start == NULL)
{ {
return ""; return "";
@ -84,4 +87,9 @@ bool HangYuCtrl::UpdateTime(time_t ts)
bool HangYuCtrl::TakePhoto(std::vector<uint8_t>& img) bool HangYuCtrl::TakePhoto(std::vector<uint8_t>& img)
{ {
return false; return false;
}
bool HangYuCtrl::TakeVideo(uint32_t duration, std::string path)
{
} }

@ -3,7 +3,7 @@
// //
#include "VendorCtrl.h" #include "VendorCtrl.h"
VendorCtrl::VendorCtrl(const std::string& ip, const std::string& userName, const std::string& password) : VendorCtrl::VendorCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle) :
m_ip(ip), m_userName(userName), m_password(password), m_channel(channel), m_netHandle(netHandle) m_ip(ip), m_userName(userName), m_password(password), m_channel(channel), m_netHandle(netHandle)
{ {
} }

@ -12,7 +12,7 @@
class VendorCtrl { class VendorCtrl {
public: public:
VendorCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle); VendorCtrl(const std::string& ip, const std::string& userName, const std::string& password, uint8_t channel, net_handle_t netHandle);
virtual ~VendorCtrl() = 0; virtual ~VendorCtrl() {}
virtual bool SetOsd() = 0; virtual bool SetOsd() = 0;
virtual void EnableOsd(bool enable) = 0; virtual void EnableOsd(bool enable) = 0;

@ -17,10 +17,10 @@ bool YuShiCtrl::SetOsd()
void YuShiCtrl::EnableOsd(bool enable) void YuShiCtrl::EnableOsd(bool enable)
{ {
return false; // return false;
} }
std::string GetStreamingUrl(uint8_t channel) std::string YuShiCtrl::GetStreamingUrl(uint8_t channel)
{ {
// /LAPI/V1.0/Channels/<ID>/Media/Video/Streams/<ID>/LiveStreamURL?TransType=<Tran // /LAPI/V1.0/Channels/<ID>/Media/Video/Streams/<ID>/LiveStreamURL?TransType=<Tran
// sType>&TransProtocol=<TransProtocol> // sType>&TransProtocol=<TransProtocol>
@ -29,12 +29,12 @@ std::string GetStreamingUrl(uint8_t channel)
bool YuShiCtrl::UpdateTime(time_t ts) bool YuShiCtrl::UpdateTime(time_t ts)
{ {
/LAPI/V1.0/System/Time // /LAPI/V1.0/System/Time
Json::Value jsonData(Json::objectValue); Json::Value jsonData(Json::objectValue);
jsonData["TimeZone"] = "GMT+08:00"; jsonData["TimeZone"] = "GMT+08:00";
jsonData["DeviceTime"] = ts; jsonData["DeviceTime"] = (int64_t)ts;
jsonData["DateFormat"] = 0; // YYYY-MM-DD jsonData["DateFormat"] = 0; // YYYY-MM-DD
jsonData["HourFormat"] = 1; // 24H jsonData["HourFormat"] = 1; // 24H
@ -44,4 +44,9 @@ bool YuShiCtrl::UpdateTime(time_t ts)
bool YuShiCtrl::TakePhoto(std::vector<uint8_t>& img) bool YuShiCtrl::TakePhoto(std::vector<uint8_t>& img)
{ {
return false; return false;
}
bool YuShiCtrl::TakeVideo(uint32_t duration, std::string path)
{
} }
Loading…
Cancel
Save