12 changed files with 465 additions and 590 deletions
-
1.gitignore
-
21.vscode/c_cpp_properties.json
-
89.vscode/settings.json
-
220bak/xsync_udp_factory_impl.cpp
-
29bak/xsync_udp_factory_impl.hpp
-
1udp_packet_monitor/build.bat
-
11udp_packet_monitor/main.cpp
-
2xsync_timecode_recorder/build.bat
-
1xsync_timecode_recorder/build2.bat
-
2xsync_timecode_recorder/build_xsync.bat
-
220xsync_timecode_recorder/xsync_timecode_recorder.cpp
@ -1,21 +0,0 @@ |
|||
{ |
|||
"configurations": [ |
|||
{ |
|||
"name": "Win32", |
|||
"includePath": [ |
|||
"${workspaceFolder}/**" |
|||
], |
|||
"defines": [ |
|||
"_DEBUG", |
|||
"UNICODE", |
|||
"_UNICODE" |
|||
], |
|||
"compilerPath": "C:\\msys64\\mingw64\\bin\\gcc.exe", |
|||
"cStandard": "c17", |
|||
"cppStandard": "gnu++17", |
|||
"intelliSenseMode": "windows-gcc-x64", |
|||
"compileCommands": "${workspaceFolder}/build/compile_commands.json" |
|||
} |
|||
], |
|||
"version": 4 |
|||
} |
@ -1,89 +0,0 @@ |
|||
{ |
|||
"files.associations": { |
|||
"*.hpp": "cpp", |
|||
"qapplication": "cpp", |
|||
"qdebug": "cpp", |
|||
"qdatetime": "cpp", |
|||
"vector": "cpp", |
|||
"typeindex": "cpp", |
|||
"typeinfo": "cpp", |
|||
"string": "cpp", |
|||
"memory": "cpp", |
|||
"any": "cpp", |
|||
"array": "cpp", |
|||
"atomic": "cpp", |
|||
"bit": "cpp", |
|||
"*.tcc": "cpp", |
|||
"bitset": "cpp", |
|||
"cctype": "cpp", |
|||
"charconv": "cpp", |
|||
"chrono": "cpp", |
|||
"clocale": "cpp", |
|||
"cmath": "cpp", |
|||
"codecvt": "cpp", |
|||
"compare": "cpp", |
|||
"complex": "cpp", |
|||
"concepts": "cpp", |
|||
"condition_variable": "cpp", |
|||
"cstdarg": "cpp", |
|||
"cstddef": "cpp", |
|||
"cstdint": "cpp", |
|||
"cstdio": "cpp", |
|||
"cstdlib": "cpp", |
|||
"cstring": "cpp", |
|||
"ctime": "cpp", |
|||
"cwchar": "cpp", |
|||
"cwctype": "cpp", |
|||
"deque": "cpp", |
|||
"list": "cpp", |
|||
"map": "cpp", |
|||
"set": "cpp", |
|||
"unordered_map": "cpp", |
|||
"exception": "cpp", |
|||
"algorithm": "cpp", |
|||
"functional": "cpp", |
|||
"iterator": "cpp", |
|||
"memory_resource": "cpp", |
|||
"numeric": "cpp", |
|||
"optional": "cpp", |
|||
"random": "cpp", |
|||
"ratio": "cpp", |
|||
"string_view": "cpp", |
|||
"system_error": "cpp", |
|||
"tuple": "cpp", |
|||
"type_traits": "cpp", |
|||
"utility": "cpp", |
|||
"fstream": "cpp", |
|||
"initializer_list": "cpp", |
|||
"iomanip": "cpp", |
|||
"iosfwd": "cpp", |
|||
"iostream": "cpp", |
|||
"istream": "cpp", |
|||
"limits": "cpp", |
|||
"mutex": "cpp", |
|||
"new": "cpp", |
|||
"numbers": "cpp", |
|||
"ostream": "cpp", |
|||
"semaphore": "cpp", |
|||
"span": "cpp", |
|||
"sstream": "cpp", |
|||
"stdexcept": "cpp", |
|||
"stop_token": "cpp", |
|||
"streambuf": "cpp", |
|||
"thread": "cpp", |
|||
"cinttypes": "cpp", |
|||
"variant": "cpp", |
|||
"qfile": "cpp", |
|||
"qmainwindow": "cpp", |
|||
"qvalueaxis": "cpp", |
|||
"qlabel": "cpp", |
|||
"future": "cpp", |
|||
"qcoreapplication": "cpp", |
|||
"qcategoryaxis": "cpp", |
|||
"qaction": "cpp", |
|||
"qthread": "cpp", |
|||
"qlineseries": "cpp", |
|||
"qsplineseries": "cpp" |
|||
}, |
|||
"files.autoGuessEncoding": true, |
|||
} |
@ -1,220 +0,0 @@ |
|||
#include "xsync_udp_factory_impl.hpp"
|
|||
|
|||
#include "zqthread.hpp"
|
|||
//
|
|||
#include <winsock2.h>
|
|||
//
|
|||
#include <Windows.h>
|
|||
|
|||
#define ENABLE_LOG
|
|||
#ifdef ENABLE_LOG
|
|||
#include "../src/logger.hpp"
|
|||
#endif
|
|||
#define TAG "XSYNC_UDP"
|
|||
#pragma comment(lib, "ws2_32")
|
|||
using namespace xsync; |
|||
using namespace iflytop; |
|||
|
|||
/*******************************************************************************
|
|||
* XSUDP * |
|||
*******************************************************************************/ |
|||
|
|||
#define USB_NO_BLOCK_UDP 0
|
|||
|
|||
class XSUDP : public I_XSUDP { |
|||
uint32_t m_ip; |
|||
int m_localport; |
|||
|
|||
struct sockaddr_in localadd = {}; |
|||
int m_sock_fd = 0; |
|||
unique_ptr<ZQThread> m_zq_thread; |
|||
onMessage_t m_onMessage; |
|||
|
|||
char* m_rxbuf = nullptr; |
|||
size_t m_rxbufsize = 0; |
|||
|
|||
public: |
|||
virtual xs_error_code_t initialize(string ip, int localport) override; |
|||
virtual xs_error_code_t sendto(const XsyncNetAdd& to, const char* data, int32_t length, int32_t* sendlength) override; |
|||
virtual xs_error_code_t receive(char* data, int32_t& length, XsyncNetAdd& from, int overtimems) override; |
|||
virtual xs_error_code_t startReceive(onMessage_t onMessage) override; |
|||
virtual xs_error_code_t stopReceive() override; |
|||
virtual xs_error_code_t clearRxBuffer() override; |
|||
virtual ~XSUDP(); |
|||
}; |
|||
|
|||
const char* fmtip(uint32_t ip) { |
|||
static char ipstr[16]; |
|||
sprintf(ipstr, "%d.%d.%d.%d", (ip >> 24) & 0xff, (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); |
|||
return ipstr; |
|||
} |
|||
|
|||
xs_error_code_t XSUDP::initialize(string ip, int localport) { |
|||
localadd.sin_family = AF_INET; |
|||
localadd.sin_addr.s_addr = inet_addr(ip.c_str()); |
|||
localadd.sin_port = htons(localport); |
|||
|
|||
// 创建客户端用于通信的Socket
|
|||
m_sock_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); |
|||
if (m_sock_fd < 0) return kxs_ec_socket_fail; |
|||
|
|||
int ret = bind(m_sock_fd, (struct sockaddr*)&localadd, sizeof(localadd)); |
|||
if (ret < 0) return kxs_ec_bind_fail; |
|||
|
|||
#if USB_NO_BLOCK_UDP
|
|||
u_long mode = 1; |
|||
if (ioctlsocket(m_sock_fd, FIONBIO, &mode) != NO_ERROR) { |
|||
return kxs_ec_setsockopt_rx_timeout_fail; |
|||
} |
|||
#endif
|
|||
return kxs_ec_success; |
|||
} |
|||
|
|||
xs_error_code_t XSUDP::sendto(const XsyncNetAdd& to, const char* data, int32_t length, int32_t* sendlength) { |
|||
struct sockaddr_in sockaddr; |
|||
sockaddr.sin_family = AF_INET; |
|||
sockaddr.sin_addr.s_addr = inet_addr(to.ip.c_str()); |
|||
sockaddr.sin_port = htons(to.port); |
|||
int ret = ::sendto(m_sock_fd, data, length, 0, (struct sockaddr*)&sockaddr, sizeof(sockaddr)); |
|||
if (sendlength) *sendlength = ret; |
|||
if (ret >= 0) { |
|||
return kxs_ec_success; |
|||
} |
|||
return kxs_ec_send_fail; |
|||
} |
|||
xs_error_code_t XSUDP::receive(char* data, int32_t& length, XsyncNetAdd& from, int overtimems) { |
|||
#if USB_NO_BLOCK_UDP
|
|||
struct sockaddr_in sockaddr = {0}; |
|||
int32_t overtime_10ms = overtimems / 10; |
|||
int ret = 0; |
|||
overtime_10ms += 1; |
|||
for (size_t i = 0;; i++) { |
|||
int senderAddressLen = sizeof(sockaddr); |
|||
ret = ::recvfrom(m_sock_fd, (char*)data, length, 0, (struct sockaddr*)&sockaddr, &senderAddressLen); |
|||
length = ret; |
|||
|
|||
if (ret > 0) break; |
|||
if (i >= overtime_10ms) break; |
|||
Sleep(10); |
|||
} |
|||
|
|||
if (ret <= 0) { |
|||
return kxs_ec_overtime; |
|||
} |
|||
|
|||
uint32_t ip = ntohl(sockaddr.sin_addr.s_addr); |
|||
from.ip = string(fmtip(ip)); |
|||
from.port = ntohs(sockaddr.sin_port); |
|||
|
|||
return kxs_ec_success; |
|||
#else
|
|||
struct sockaddr_in sockaddr = {0}; |
|||
|
|||
timeval timeout; |
|||
timeout.tv_sec = overtimems; // 这个结构体的单位是ms,不是秒
|
|||
timeout.tv_usec = 0; |
|||
|
|||
if (timeout.tv_sec == 0) { |
|||
timeout.tv_sec = 1; |
|||
} |
|||
|
|||
if (setsockopt(m_sock_fd, SOL_SOCKET, SO_RCVTIMEO, (const char*)&timeout, sizeof(timeout)) == -1) { |
|||
return kxs_ec_setsockopt_rx_timeout_fail; |
|||
} |
|||
int senderAddressLen = sizeof(sockaddr); |
|||
int ret = ::recvfrom(m_sock_fd, (char*)data, length, 0, (struct sockaddr*)&sockaddr, &senderAddressLen); |
|||
length = ret; |
|||
data[length] = 0; |
|||
|
|||
if (ret < 0) { |
|||
// ZLOGI(TAG, "recvfrom error %d %s", ret, strerror(errno));
|
|||
// if (errno == EWOULDBLOCK || errno == EAGAIN) {
|
|||
return kxs_ec_overtime; |
|||
// } else {
|
|||
// return kxs_ec_receive_fail;
|
|||
// }
|
|||
} |
|||
|
|||
// inet_ntop(AF_INET, &(sockaddr.sin_addr), ip, INET_ADDRSTRLEN);
|
|||
uint32_t ip = ntohl(sockaddr.sin_addr.s_addr); |
|||
from.ip = string(fmtip(ip)); |
|||
from.port = ntohs(sockaddr.sin_port); |
|||
|
|||
return kxs_ec_success; |
|||
#endif
|
|||
} |
|||
|
|||
xs_error_code_t XSUDP::startReceive(onMessage_t onMessage) { |
|||
m_onMessage = onMessage; |
|||
|
|||
if (m_zq_thread) { |
|||
return kxs_ec_success; |
|||
} |
|||
m_rxbuf = (char*)malloc(10240); |
|||
m_rxbufsize = 10240; |
|||
|
|||
m_zq_thread.reset(new ZQThread("udplistener_thread", [this]() { |
|||
while (!m_zq_thread->isTryExit()) { |
|||
memset(m_rxbuf, 0, m_rxbufsize); |
|||
int32_t length = m_rxbufsize; |
|||
XsyncNetAdd from; |
|||
xs_error_code_t ret = receive(m_rxbuf, length, from, 1000); |
|||
if (ret == kxs_ec_success) { |
|||
if (m_onMessage) m_onMessage(from, (uint8_t*)m_rxbuf, length); |
|||
} |
|||
} |
|||
})); |
|||
m_zq_thread->start(); |
|||
return kxs_ec_success; |
|||
} |
|||
|
|||
xs_error_code_t XSUDP::stopReceive() { |
|||
if (m_zq_thread) { |
|||
m_zq_thread->quit(); |
|||
m_zq_thread->wait(); |
|||
m_zq_thread.reset(nullptr); |
|||
} |
|||
|
|||
if (!m_rxbuf) { |
|||
free(m_rxbuf); |
|||
m_rxbuf = nullptr; |
|||
m_rxbufsize = 0; |
|||
} |
|||
} |
|||
|
|||
xs_error_code_t XSUDP::clearRxBuffer() { |
|||
#if USB_NO_BLOCK_UDP
|
|||
char buf[1024]; |
|||
int32_t length = 1024; |
|||
XsyncNetAdd from; |
|||
xs_error_code_t ret = kxs_ec_success; |
|||
|
|||
while (ret == kxs_ec_success) { |
|||
ret = receive(buf, length, from, 1); |
|||
} |
|||
#endif
|
|||
|
|||
return kxs_ec_success; |
|||
} |
|||
|
|||
XSUDP::~XSUDP() { |
|||
stopReceive(); |
|||
|
|||
if (m_sock_fd > 0) { |
|||
closesocket(m_sock_fd); |
|||
m_sock_fd = -1; |
|||
} |
|||
} |
|||
|
|||
/*******************************************************************************
|
|||
* xSyncUdpFactoryImpl * |
|||
*******************************************************************************/ |
|||
|
|||
void XSyncUdpFactoryImpl::initialize() {} |
|||
|
|||
XSyncUdpFactoryImpl* XSyncUdpFactoryImpl::Ins() { |
|||
static XSyncUdpFactoryImpl instance; |
|||
return &instance; |
|||
} |
|||
|
|||
shared_ptr<I_XSUDP> XSyncUdpFactoryImpl::createXSUDP() { return make_shared<XSUDP>(); } |
@ -1,29 +0,0 @@ |
|||
#pragma once
|
|||
#include <fstream>
|
|||
#include <functional>
|
|||
#include <iostream>
|
|||
#include <list>
|
|||
#include <map>
|
|||
#include <memory>
|
|||
#include <set>
|
|||
#include <sstream>
|
|||
#include <string>
|
|||
#include <vector>
|
|||
|
|||
#include "xsync_v2.hpp"
|
|||
namespace xsync { |
|||
using namespace std; |
|||
|
|||
class XSyncUdpFactoryImpl : public I_XSUDPFactory { |
|||
private: |
|||
/* data */ |
|||
XSyncUdpFactoryImpl(){}; |
|||
|
|||
public: |
|||
static XSyncUdpFactoryImpl* Ins(); |
|||
|
|||
void initialize(); |
|||
virtual shared_ptr<I_XSUDP> createXSUDP() override; |
|||
}; |
|||
|
|||
} // namespace xsync
|
@ -0,0 +1 @@ |
|||
g++ -static -static-libgcc -static-libstdc++ -I ../libxsync/include main.cpp -L "./" -lwsock32 -lstdc++ -o udp_packet_monitor.exe |
@ -0,0 +1,2 @@ |
|||
@REM g++ -static -static-libgcc -static-libstdc++ -I ../libxsync/include xsync_timecode_recorder.cpp -L "./" -lwsock32 -lstdc++ -llibxsync.dll |
|||
g++ -static-libgcc -static-libstdc++ -I ../libxsync/include xsync_timecode_recorder.cpp -L "./" -o xsync_timecode_recorder.exe -lxsync -lwsock32 -fpic |
@ -0,0 +1 @@ |
|||
g++ -static -static-libgcc -static-libstdc++ -I ../libxsync/include ../libxsync/src/xsync_udp_factory_impl.cpp ../libxsync/src/xsync_utils.cpp ../libxsync/src/xsync_v2_sig_type.cpp ../libxsync/src/xsync_v2.cpp xsync_timecode_recorder.cpp -L "./" -o xsync_timecode_recorder.exe -lwsock32 |
@ -0,0 +1,2 @@ |
|||
g++ -I ../libxsync/include ../libxsync/src/xsync_udp_factory_impl.cpp ../libxsync/src/xsync_utils.cpp ../libxsync/src/xsync_v2_sig_type.cpp ../libxsync/src/xsync_v2.cpp -o xsync.dll -lwsock32 -fpic -shared |
|||
|
@ -0,0 +1,220 @@ |
|||
#include <stdint.h>
|
|||
#include <stdio.h>
|
|||
#include <time.h>
|
|||
#include <winsock2.h>
|
|||
|
|||
#include <chrono>
|
|||
#include <fstream>
|
|||
#include <functional>
|
|||
#include <iostream>
|
|||
#include <list>
|
|||
#include <map>
|
|||
#include <memory>
|
|||
#include <mutex>
|
|||
#include <set>
|
|||
#include <sstream>
|
|||
#include <string>
|
|||
#include <thread>
|
|||
#include <vector>
|
|||
//
|
|||
#include "xsync_packet.hpp"
|
|||
#include "xsync_udp_factory_impl.hpp"
|
|||
#include "xsync_v2.hpp"
|
|||
|
|||
//
|
|||
#include <Windows.h>
|
|||
|
|||
#pragma comment(lib, "ws2_32.lib")
|
|||
using namespace std; |
|||
using namespace xsync; |
|||
|
|||
static std::ofstream* logfile; |
|||
|
|||
/**
|
|||
* @brief 获取 年月日时分秒:毫秒 |
|||
* |
|||
* @return string |
|||
*/ |
|||
static const char* gettime_str() { |
|||
time_t t = time(0); |
|||
static char tmp[64]; |
|||
strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", localtime(&t)); |
|||
struct tm* tt = localtime(&t); |
|||
// sprintf(tmp, "%s:%03d", tmp, GetTickCount() % 1000);
|
|||
return tmp; |
|||
} |
|||
|
|||
static string getlogfilename() { |
|||
time_t t = time(0); |
|||
char tmp[64]; |
|||
strftime(tmp, sizeof(tmp), "%Y%m%d_%H%M%S.log", localtime(&t)); |
|||
return tmp; |
|||
} |
|||
|
|||
/**
|
|||
* @brief 写日志到文件中 |
|||
*/ |
|||
bool log_file_init() { |
|||
// 创建日志文件
|
|||
logfile = new ofstream(getlogfilename(), ios::app); |
|||
if (logfile == NULL) { |
|||
printf("创建日志文件失败\n"); |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
void log(const char* fmt, ...) { |
|||
char buf[1024] = {0}; |
|||
va_list args; |
|||
va_start(args, fmt); |
|||
vsprintf(buf, fmt, args); |
|||
va_end(args); |
|||
cout << buf; |
|||
} |
|||
|
|||
void logd(const char* fmt, ...) { |
|||
char buf[1024] = {0}; |
|||
va_list args; |
|||
va_start(args, fmt); |
|||
vsprintf(buf, fmt, args); |
|||
va_end(args); |
|||
if (logfile) { |
|||
*logfile << buf; |
|||
logfile->flush(); |
|||
} |
|||
cout << buf; |
|||
} |
|||
|
|||
#define LOGD(fmt, ...) logd("[%s] INFO : " fmt "\n", gettime_str(), ##__VA_ARGS__);
|
|||
|
|||
int64_t gettime() { |
|||
auto currentTime = std::chrono::system_clock::now(); |
|||
return currentTime.time_since_epoch().count() / 1000000; |
|||
} |
|||
XsyncTimecode_t nowtc; |
|||
|
|||
int main(int argc, char* argv[]) { |
|||
// 初始化网络环境
|
|||
log_file_init(); |
|||
WSADATA wsa; |
|||
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0) { |
|||
LOGD("WSAStartup failed"); |
|||
return -1; |
|||
} |
|||
|
|||
XSyncUdpFactoryImpl::Ins()->initialize(); |
|||
|
|||
// m_xsync.reset(new Xsync());
|
|||
|
|||
XsyncInit(XSyncUdpFactoryImpl::Ins()); |
|||
xsync_config_t config = {0}; |
|||
config.listenCameraSyncPacket = true; |
|||
xs_error_code_t ecode = XsyncIns()->initialize(&config); |
|||
if (ecode != 0) { |
|||
LOGD("initialize failed"); |
|||
return -1; |
|||
} |
|||
|
|||
bool online = false; |
|||
XsyncIns()->registerOnConnectStateChangeCallback([&online](bool state, string targetIp) { |
|||
LOGD("targetIp:%s,state:%d", targetIp.c_str(), state); |
|||
online = state; |
|||
}); |
|||
|
|||
while (!online) { |
|||
Sleep(1); |
|||
} |
|||
version_t sdk_version; |
|||
version_t fpga_version; |
|||
version_t stm32_version; |
|||
XsyncIns()->readSDKVersion(sdk_version); |
|||
XsyncIns()->readARMSoftwareVersion(stm32_version); |
|||
XsyncIns()->readFPGASoftwareVersion(fpga_version); |
|||
|
|||
LOGD("sdk_version:%d.%d.%d", sdk_version.main, sdk_version.sub, sdk_version.fix); |
|||
LOGD("fpga_version:%d.%d.%d", fpga_version.main, fpga_version.sub, fpga_version.fix); |
|||
LOGD("stm32_version:%d.%d.%d", stm32_version.main, stm32_version.sub, stm32_version.fix); |
|||
|
|||
XsyncIns()->registerOnTimecodeMsgCallback([](XsyncTimecode_t* timecode_msg) { //
|
|||
nowtc = *timecode_msg; |
|||
}); |
|||
|
|||
XsyncIns()->registerOnTimecodeRawMsgCallback([](XsyncNetAdd& from, uint8_t* rawpacket, size_t length) { |
|||
//
|
|||
iflytop_xsync_event_report_packet_t* packet = (iflytop_xsync_event_report_packet_t*)rawpacket; |
|||
|
|||
uint32_t stm32_ticket = packet->data[3]; |
|||
uint32_t stm32_send_delay = packet->data[4]; |
|||
|
|||
Timecode64_t tc64; |
|||
tc64.tc0 = packet->data[0]; |
|||
tc64.tc1 = packet->data[1]; |
|||
tc64.subframe = packet->data[2]; |
|||
XsyncTimecode_t timecode = nowtc; |
|||
|
|||
static int64_t lastrxticket; |
|||
static uint32_t laststm32ticket = 0; |
|||
static int32_t et1 = 0; |
|||
static int32_t et2 = 0; |
|||
static int32_t et3 = 0; |
|||
static int32_t et4 = 0; |
|||
static Timecode64_t lasttimecode64; |
|||
static int32_t lastdifftime = 0; |
|||
static int32_t lastdiffstm32; |
|||
int64_t nowticket = gettime(); |
|||
int64_t difftime = nowticket - lastrxticket; |
|||
int64_t diffstm32 = stm32_ticket - laststm32ticket; |
|||
static int32_t totalPacketNum = 0; |
|||
totalPacketNum++; |
|||
|
|||
{ |
|||
if (abs(difftime - lastdifftime) > 4) { |
|||
et1++; |
|||
LOGD("e1:abs(difftime - lastdifftime) > 4"); |
|||
} |
|||
|
|||
if (abs(diffstm32 - lastdiffstm32) > 2) { |
|||
et2++; |
|||
LOGD("e2:abs(diffstm32 - lastdiffstm32) > 2"); |
|||
} |
|||
|
|||
if (stm32_send_delay > 1) { |
|||
et3++; |
|||
LOGD("e3:stm32_send_delay>1"); |
|||
} |
|||
|
|||
if (memcmp(&lasttimecode64, &tc64, sizeof(Timecode64_t)) == 0) { |
|||
et4++; |
|||
LOGD("e4:memcmp(&lasttimecode64, &tc64, sizeof(Timecode64_t)) == 0"); |
|||
} |
|||
|
|||
LOGD("pcticket:%ld(%10d) tc:%2d:%2d:%2d:%2d:%2d stm32ticket:%10d(%10d) stm32_send_delay:%d et:(%d %d %d %d)/%d", nowticket, difftime, //
|
|||
timecode.hour, timecode.minute, timecode.second, timecode.frame, timecode.subframe, //
|
|||
stm32_ticket, diffstm32, stm32_send_delay, //
|
|||
et1 / 2, et2, et3, et4, totalPacketNum); |
|||
} |
|||
|
|||
lasttimecode64 = tc64; |
|||
|
|||
//
|
|||
lastrxticket = nowticket; |
|||
laststm32ticket = stm32_ticket; |
|||
lastdifftime = difftime; |
|||
lastdiffstm32 = diffstm32; |
|||
}); |
|||
|
|||
// XsyncIns()->registerOnCameraSyncMsgCallback([](xysnc_camera_sync_data_t* camera_sync_msg) { //
|
|||
// xysnc_camera_sync_data_t camera_sync_data = *camera_sync_msg;
|
|||
// LOGD("OnCameraSyncMsgCallback:%d", camera_sync_msg->frameIndex);
|
|||
// });
|
|||
|
|||
// XsyncIns()->registerOnRecordSigChangeMsgCallback([](uint32_t recordSig, XsyncTimecode_t* timecode_msg) { //
|
|||
// LOGD("OnRecordSigChangeMsgCallback :%d", recordSig);
|
|||
// });
|
|||
|
|||
while (true) { |
|||
Sleep(1000); |
|||
} |
|||
return 0; |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue