From 66f7b456ad321d5c0d02472444e2a5a18001abc6 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 26 Mar 2024 22:14:02 +0800 Subject: [PATCH] update --- include/ixsync.hpp | 17 +++-- include/xsync_regs.hpp | 35 +++++---- include/xsync_utils.hpp | 5 +- include/xsync_v2_sig_type.hpp | 1 + src/xsync_utils.cpp | 2 + src/xsync_v2.cpp | 167 +++++++++++++++++++++++++++--------------- src/xsync_v2_sig_type.cpp | 16 ++-- 7 files changed, 153 insertions(+), 90 deletions(-) diff --git a/include/ixsync.hpp b/include/ixsync.hpp index 6a93aaa..13ec4af 100644 --- a/include/ixsync.hpp +++ b/include/ixsync.hpp @@ -142,11 +142,10 @@ class IXsync { * */ - virtual xs_error_code_t ExternalTimecode_setSource(InputInterface_t src) = 0; - virtual xs_error_code_t ExternalTimecode_getSource(InputInterface_t &timecode_select) = 0; - virtual xs_error_code_t ExternalTimecode_setFormat(TimecodeFormat_t format) = 0; - virtual xs_error_code_t ExternalTimecode_getFormat(TimecodeFormat_t &format) = 0; - virtual xs_error_code_t ExternalTimecode_readCode(XsyncTimecode_t &timecode) = 0; + virtual xs_error_code_t ExternalTimecode_readSrc(InputInterface_t &timecode) = 0; + virtual xs_error_code_t ExternalTimecode_readCode(XsyncTimecode_t &timecode) = 0; + virtual xs_error_code_t ExternalTimecode_readFreq(float &freq) = 0; + virtual xs_error_code_t ExternalTimecode_readFormat(TimecodeFormat_t &timecode) = 0; virtual xs_error_code_t TTLInputModule1_detectFreq(float &freq) = 0; virtual xs_error_code_t TTLInputModule2_detectFreq(float &freq) = 0; @@ -209,6 +208,7 @@ class IXsync { virtual xs_error_code_t InternalTimecode_getFormat(TimecodeFormat_t &format) = 0; virtual xs_error_code_t InternalTimecode_setCode(XsyncTimecode_t timecode) = 0; virtual xs_error_code_t InternalTimecode_getCode(XsyncTimecode_t &timecode) = 0; + virtual xs_error_code_t InternalTimecode_readFreq(float &freq) = 0; virtual xs_error_code_t InternalGenlock_setFormat(GenlockFormat_t format) = 0; virtual xs_error_code_t InternalGenlock_getFormat(GenlockFormat_t &format) = 0; @@ -224,6 +224,7 @@ class IXsync { virtual xs_error_code_t SysTimecode_getSource(uint32_t &sig) = 0; virtual xs_error_code_t SysTimecode_readFormat(TimecodeFormat_t &format) = 0; virtual xs_error_code_t SysTimecode_readCode(XsyncTimecode_t &timecode) = 0; + virtual xs_error_code_t SysTimecode_readFreq(float &freq) = 0; virtual xs_error_code_t SysGenlock_setSrc(uint32_t source) = 0; virtual xs_error_code_t SysGenlock_getSrc(uint32_t &source) = 0; @@ -369,6 +370,12 @@ class IXsync { virtual xs_error_code_t TTLOutputModule4_getFreqMultiplication(uint32_t &multi) = 0; virtual xs_error_code_t TTLOutputModule4_readInFreq(float &freq) = 0; virtual xs_error_code_t TTLOutputModule4_readOutFreq(float &freq) = 0; + + /******************************************************************************* + * 工具方法 * + *******************************************************************************/ + + virtual xs_error_code_t Utils_readSigFreq(SignalType_t sig, float &freq) = 0; }; } // namespace xsync diff --git a/include/xsync_regs.hpp b/include/xsync_regs.hpp index 79428c3..85430fa 100644 --- a/include/xsync_regs.hpp +++ b/include/xsync_regs.hpp @@ -163,31 +163,36 @@ typedef enum { * TIMECODE输入模块 * *******************************************************************************/ - external_timecode_module = REGADDOFF__EXTERNAL_TIMECODE + 0, - external_timecode_sig_selt = REGADDOFF__EXTERNAL_TIMECODE + 1, - external_timecode_format = REGADDOFF__EXTERNAL_TIMECODE + 2, - external_timecode_code0 = REGADDOFF__EXTERNAL_TIMECODE + 3, - external_timecode_code1 = REGADDOFF__EXTERNAL_TIMECODE + 4, + external_timecode_module = REGADDOFF__EXTERNAL_TIMECODE + 0, + external_timecode_timecode_sig_selt = REGADDOFF__EXTERNAL_TIMECODE + 1, + external_timecode_timecode_format = REGADDOFF__EXTERNAL_TIMECODE + 2, + external_timecode_timecode0 = REGADDOFF__EXTERNAL_TIMECODE + 3, + external_timecode_timecode1 = REGADDOFF__EXTERNAL_TIMECODE + 4, + external_timecode_freq = REGADDOFF__EXTERNAL_TIMECODE + 5, + external_timecode_rA_freq_bias = REGADDOFF__EXTERNAL_TIMECODE + 10, /******************************************************************************* * 内部TIMECODE模块 * *******************************************************************************/ - internal_timecode_module = REGADDOFF__INTERNAL_TIMECODE + 0, - internal_timecode_en = REGADDOFF__INTERNAL_TIMECODE + 1, - internal_timecode_format = REGADDOFF__INTERNAL_TIMECODE + 2, - internal_timecode_data0 = REGADDOFF__INTERNAL_TIMECODE + 3, - internal_timecode_data1 = REGADDOFF__INTERNAL_TIMECODE + 4, + internal_timecode_module = REGADDOFF__INTERNAL_TIMECODE + 0, + internal_timecode_en = REGADDOFF__INTERNAL_TIMECODE + 1, + internal_timecode_format = REGADDOFF__INTERNAL_TIMECODE + 2, + internal_timecode_data0 = REGADDOFF__INTERNAL_TIMECODE + 3, + internal_timecode_data1 = REGADDOFF__INTERNAL_TIMECODE + 4, + internal_timecode_detect_freq = REGADDOFF__INTERNAL_TIMECODE + 5, /******************************************************************************* * SYS_TIMECODE * *******************************************************************************/ - sys_timecode_module = REGADDOFF__SYS_TIMECODE, - sys_timecode_select = REGADDOFF__SYS_TIMECODE + 1, - sys_timecode_format = REGADDOFF__SYS_TIMECODE + 2, - sys_timecode_data0 = REGADDOFF__SYS_TIMECODE + 3, - sys_timecode_data1 = REGADDOFF__SYS_TIMECODE + 4, + sys_timecode_module = REGADDOFF__SYS_TIMECODE, + sys_timecode_select = REGADDOFF__SYS_TIMECODE + 1, + sys_timecode_format = REGADDOFF__SYS_TIMECODE + 2, + sys_timecode_data0 = REGADDOFF__SYS_TIMECODE + 3, + sys_timecode_data1 = REGADDOFF__SYS_TIMECODE + 4, + sys_timecode_freq_detect = REGADDOFF__SYS_TIMECODE + 5, + sys_timecode_freq_detect_bias = REGADDOFF__SYS_TIMECODE + 6, /******************************************************************************* * TIMECODE输出模块 * diff --git a/include/xsync_utils.hpp b/include/xsync_utils.hpp index 97817fb..a223d3f 100644 --- a/include/xsync_utils.hpp +++ b/include/xsync_utils.hpp @@ -17,12 +17,13 @@ namespace xsync { -uint32_t ipToUint32(const std::string &ipAddress, bool &suc); -string uint32ToIp(uint32_t ip); +uint32_t ipToUint32(const std::string &ipAddress, bool &suc); +string uint32ToIp(uint32_t ip); XsyncTimecode_t timecode64ToXsyncTimeCode(Timecode64_t tc64); Timecode64_t timecodeTo64(XsyncTimecode_t tc); int64_t Xsync_GetTicket(); +bool Xsync_feq(float a, float b, float epsilon = 0.0001); }; // namespace xsync diff --git a/include/xsync_v2_sig_type.hpp b/include/xsync_v2_sig_type.hpp index 9b5fcb2..e92b116 100644 --- a/include/xsync_v2_sig_type.hpp +++ b/include/xsync_v2_sig_type.hpp @@ -34,6 +34,7 @@ typedef enum { TIMECODE_FPS2997 = 3, TIMECODE_FPS2997Drop = 4, TIMECODE_FPS3000 = 5, + TIMECODE_NONE = 255, } TimecodeFormat_t; string TimecodeFormatToStr(TimecodeFormat_t fomrat); diff --git a/src/xsync_utils.cpp b/src/xsync_utils.cpp index 221cbd5..a53f2cd 100644 --- a/src/xsync_utils.cpp +++ b/src/xsync_utils.cpp @@ -3,6 +3,7 @@ #include #include #include +#include namespace xsync { uint32_t ipToUint32(const std::string &ipAddress, bool &suc) { @@ -66,6 +67,7 @@ XsyncTimecode_t timecode64ToXsyncTimeCode(Timecode64_t tc64) { timecode.subframe = tc64.subframe; return timecode; } +bool Xsync_feq(float a, float b, float epsilon ) { return (fabs(a - b) < epsilon); } Timecode64_t timecodeTo64(XsyncTimecode_t tc) { Timecode64_t tc64; diff --git a/src/xsync_v2.cpp b/src/xsync_v2.cpp index 20d14b5..042e575 100644 --- a/src/xsync_v2.cpp +++ b/src/xsync_v2.cpp @@ -138,11 +138,11 @@ class Xsync : public IXsync { if (packet->eventid == ktimecode_report_event) { Timecode64_t tc64; - tc64.tc0 = packet->data[0]; - tc64.tc1 = packet->data[1]; - tc64.subframe = packet->data[2]; + tc64.tc0 = packet->data[0]; + tc64.tc1 = packet->data[1]; + tc64.subframe = packet->data[2]; XsyncTimecode_t timecode = timecode64ToXsyncTimeCode(tc64); - + if (m_on_timecode_msg_cb) m_on_timecode_msg_cb(&timecode); } else if (packet->eventid == kxsync_work_state_report_event) { // 信号发生器状态改变 @@ -308,11 +308,32 @@ class Xsync : public IXsync { virtual xs_error_code_t reg_read(uint32_t regadd, uint32_t ®value, int32_t overtime_ms = 100) override; public: - virtual xs_error_code_t ExternalTimecode_setSource(InputInterface_t src) override; - virtual xs_error_code_t ExternalTimecode_getSource(InputInterface_t &timecode_select) override; - virtual xs_error_code_t ExternalTimecode_setFormat(TimecodeFormat_t format) override; - virtual xs_error_code_t ExternalTimecode_getFormat(TimecodeFormat_t &format) override; - virtual xs_error_code_t ExternalTimecode_readCode(XsyncTimecode_t &timecode) override; + /******************************************************************************* + * TIMECODE * + *******************************************************************************/ + virtual xs_error_code_t ExternalTimecode_readCode(XsyncTimecode_t &timecode) override { // + return readtimecode(reg::external_timecode_timecode0, reg::external_timecode_timecode1, timecode); + } + virtual xs_error_code_t ExternalTimecode_readSrc(InputInterface_t &timecode_select) override { + uint32_t readbak = 0; + DO_XSYNC(reg_read(reg::external_timecode_timecode_sig_selt, readbak, 10)); + if (readbak == 1) { + timecode_select = INPUT_IF_TIMECODE_BNC; + } else if (readbak == 2) { + timecode_select = INPUT_IF_TIMECODE_HEADPHONE; + } else if (readbak == 0) { + timecode_select = INPUT_IF_OFF; + } else { + timecode_select = INPUT_IF_OFF; + } + return kxs_ec_success; + } + virtual xs_error_code_t ExternalTimecode_readFreq(float &freq) override { // + return readfreq(reg::external_timecode_freq, freq); + } + virtual xs_error_code_t ExternalTimecode_readFormat(TimecodeFormat_t &format) override { // + return readTimecodeFormat(reg::external_timecode_freq, reg::external_timecode_timecode0, reg::external_timecode_timecode1, format); + } virtual xs_error_code_t TTLInputModule1_detectFreq(float &freq) override; virtual xs_error_code_t TTLInputModule2_detectFreq(float &freq) override; @@ -334,10 +355,16 @@ class Xsync : public IXsync { return kxs_ec_success; } - virtual xs_error_code_t InternalTimecode_setFormat(TimecodeFormat_t format) override; - virtual xs_error_code_t InternalTimecode_getFormat(TimecodeFormat_t &format) override; - virtual xs_error_code_t InternalTimecode_setCode(XsyncTimecode_t timecode) override; - virtual xs_error_code_t InternalTimecode_getCode(XsyncTimecode_t &timecode) override; + virtual xs_error_code_t InternalTimecode_setFormat(TimecodeFormat_t format) override { REG_WRITE(reg::internal_timecode_format, format); } + virtual xs_error_code_t InternalTimecode_getFormat(TimecodeFormat_t &format) override { REG_READ(reg::internal_timecode_format, format); } + virtual xs_error_code_t InternalTimecode_setCode(XsyncTimecode_t timecode) override { + DO_XSYNC(reg_write(reg::internal_timecode_en, 0)); + DO_XSYNC(writetimecode(reg::internal_timecode_data0, reg::internal_timecode_data1, timecode)); + DO_XSYNC(reg_write(reg::internal_timecode_en, 1)); + return kxs_ec_success; + } + virtual xs_error_code_t InternalTimecode_getCode(XsyncTimecode_t &timecode) override { return readtimecode(reg::internal_timecode_data0, reg::internal_timecode_data1, timecode); } + virtual xs_error_code_t InternalTimecode_readFreq(float &freq) override { return readfreq(reg::internal_timecode_detect_freq, freq); }; virtual xs_error_code_t InternalGenlock_setFormat(GenlockFormat_t format) override; virtual xs_error_code_t InternalGenlock_getFormat(GenlockFormat_t &format) override; @@ -345,10 +372,11 @@ class Xsync : public IXsync { virtual xs_error_code_t InternalClock_setFreq(float freq) override; virtual xs_error_code_t InternalClock_getFreq(float &freq) override; - virtual xs_error_code_t SysTimecode_setSource(uint32_t sig) override; - virtual xs_error_code_t SysTimecode_getSource(uint32_t &sig) override; - virtual xs_error_code_t SysTimecode_readFormat(TimecodeFormat_t &format) override; - virtual xs_error_code_t SysTimecode_readCode(XsyncTimecode_t &timecode) override; + xs_error_code_t SysTimecode_setSource(uint32_t sig) override { REG_WRITE(reg::sys_timecode_select, sig); } + xs_error_code_t SysTimecode_getSource(uint32_t &sig) override { REG_READ(reg::sys_timecode_select, sig); } + xs_error_code_t SysTimecode_readFormat(TimecodeFormat_t &format) override { return readTimecodeFormat(reg::sys_timecode_freq_detect, reg::sys_timecode_data0, reg::sys_timecode_data1, format); } + xs_error_code_t SysTimecode_readFreq(float &freq) override { return readfreq(reg::sys_timecode_freq_detect, freq); } + xs_error_code_t SysTimecode_readCode(XsyncTimecode_t &timecode) override { return readtimecode(reg::sys_timecode_data0, reg::sys_timecode_data1, timecode); } virtual xs_error_code_t SysGenlock_setSrc(uint32_t source) override; virtual xs_error_code_t SysGenlock_getSrc(uint32_t &source) override; @@ -427,6 +455,36 @@ class Xsync : public IXsync { virtual xs_error_code_t TTLOutputModule4_readInFreq(float &freq) override; virtual xs_error_code_t TTLOutputModule4_readOutFreq(float &freq) override; + virtual xs_error_code_t Utils_readSigFreq(SignalType_t sig, float &freq) override { + if (sig == SIGNAL_LOGIC0) { + freq = 0; + } else if (sig == SIGNAL_LOGIC1) { + freq = 0; + } else if (sig == SIGNAL_TTLIN1) { + return TTLInputModule1_detectFreq(freq); + } else if (sig == SIGNAL_TTLIN2) { + return TTLInputModule2_detectFreq(freq); + } else if (sig == SIGNAL_TTLIN3) { + return TTLInputModule3_detectFreq(freq); + } else if (sig == SIGNAL_TTLIN4) { + return TTLInputModule4_detectFreq(freq); + } else if (sig == SIGNAL_EXT_GENLOCK_FREQ) { + return ExternalGenlock_detectFreq(freq); + } else if (sig == SIGNAL_EXT_TIMECODE_FREQ) { + return ExternalTimecode_readFreq(freq); + } else if (sig == SIGNAL_INTERNAL_TIMECODE_FREQ) { + return InternalTimecode_getFormat((TimecodeFormat_t &)freq); + } else if (sig == SIGNAL_INTERNAL_GENLOCK_FREQ) { + } else if (sig == SIGNAL_INTERNAL_CLOCK_SIG) { + } else if (sig == SIGNAL_SYS_CLK_OUTPUT) { + } else if (sig == SIGNAL_SYS_GENLOCK_OUTPUT) { + } else if (sig == SIGNAL_SYS_TIMECODE_FREQ_OUTPUT) { + } else if (sig == SIGNAL_BUSINESS_RECORD_SIG) { + } else if (sig == SIGNAL_BUSINESS_RECORD_EXPOSURE_SIG) { + } + return kxs_ec_success; + } + private: xs_error_code_t doaction(uint32_t action, uint32_t actionval, uint32_t *ackreturn, int32_t overtime_ms = 100); xs_error_code_t storageConfig(); @@ -435,9 +493,38 @@ class Xsync : public IXsync { xs_error_code_t readtimecode(uint32_t reg0, uint32_t reg1, XsyncTimecode_t &timecode); xs_error_code_t writetimecode(uint32_t reg0, uint32_t reg1, XsyncTimecode_t timecode); xs_error_code_t readfreq(uint32_t reg, float &freq); + xs_error_code_t reg_write(uint32_t regadd, uint32_t regvalue, int32_t overtime_ms = 100); xs_error_code_t reg_read_muti(uint32_t regadd, uint32_t nreg, vector ®values, int32_t overtime_ms = 100); + xs_error_code_t readTimecodeFormat(uint32_t freqreg, uint32_t timecode_reg0, uint32_t timecode_reg1, TimecodeFormat_t &format) { + float freq; + uint32_t timecode_regval; + DO_XSYNC(readfreq(freqreg, freq)); + DO_XSYNC(reg_read(timecode_reg0, timecode_regval, 10)); + + uint32_t bit10 = (timecode_regval >> 10) & 0x1; + + if (Xsync_feq(freq, 23.98, 0.01)) { + format = TIMECODE_FPS2398; + } else if (Xsync_feq(freq, 24, 0.01)) { + format = TIMECODE_FPS2400; + } else if (Xsync_feq(freq, 25, 0.01)) { + format = TIMECODE_FPS2500; + } else if (Xsync_feq(freq, 29.97, 0.01)) { + if (bit10) { + format = TIMECODE_FPS2997Drop; + } else { + format = TIMECODE_FPS2997; + } + } else if (Xsync_feq(freq, 30, 0.01)) { + format = TIMECODE_FPS3000; + } else { + format = TIMECODE_NONE; + } + return kxs_ec_success; + } + template xs_error_code_t _reg_read(uint32_t regadd, T ®value, int32_t overtime_ms = 100) { uint32_t regvalue_u32; @@ -696,36 +783,6 @@ xs_error_code_t Xsync::generatorNewMac() { return doaction(xsync_stm32_action_ge xs_error_code_t Xsync::factoryReset() { return doaction(xsync_stm32_action_factory_reset, 0, nullptr, 1000); } xs_error_code_t Xsync::reboot() { return doaction(xsync_stm32_action_reboot, 0, nullptr); } xs_error_code_t Xsync::storageConfig() { return doaction(xsync_stm32_action_storage_cfg, 0, nullptr, 1000); } -#if 0 -xs_error_code_t Xsync::changeNetworkConfig(string ip, string mask, string gateway) { - uint32_t ip32 = 0; - uint32_t mask32 = 0; - uint32_t gateway32 = 0; - xs_error_code_t ecode; - bool suc = false; - - ip32 = (uint32_t)ipToUint32(ip.c_str(), suc); - if (!suc) return kxs_ec_param_error; - mask32 = (uint32_t)ipToUint32(mask.c_str(), suc); - if (!suc) return kxs_ec_param_error; - gateway32 = (uint32_t)ipToUint32(gateway.c_str(), suc); - if (!suc) return kxs_ec_param_error; - - uint32_t readbak = 0; - - ecode = reg_write(reg::kstm32_ip, ip32, readbak); - if (ecode != kxs_ec_success) return ecode; - ecode = reg_write(reg::kstm32_netmask, mask32, readbak); - if (ecode != kxs_ec_success) return ecode; - ecode = reg_write(reg::kstm32_gw, gateway32, readbak); - if (ecode != kxs_ec_success) return ecode; - - ecode = storageConfig(); - if (ecode != kxs_ec_success) return ecode; - - return kxs_ec_success; -} -#endif xs_error_code_t Xsync::doaction(uint32_t action, uint32_t actionval, uint32_t *ackreturn, int32_t overtime_ms) { // @@ -904,6 +961,7 @@ xs_error_code_t Xsync::TTLOutputModule4_readOutFreq(float &freq) { return readfr /******************************************************************************* * TimecodeInputModule * *******************************************************************************/ +#if 0 xs_error_code_t Xsync::ExternalTimecode_setSource(InputInterface_t src) { if (src == INPUT_IF_TIMECODE_BNC) { DO_XSYNC(reg_write(reg::external_timecode_sig_selt, 1, 10)); // 0:off,1:bnc,2:headphone @@ -933,27 +991,16 @@ xs_error_code_t Xsync::ExternalTimecode_getSource(InputInterface_t &timecode_sel xs_error_code_t Xsync::ExternalTimecode_setFormat(TimecodeFormat_t format) { REG_WRITE(reg::external_timecode_format, format); } xs_error_code_t Xsync::ExternalTimecode_getFormat(TimecodeFormat_t &format) { REG_READ(reg::external_timecode_format, format); } xs_error_code_t Xsync::ExternalTimecode_readCode(XsyncTimecode_t &timecode) { return readtimecode(reg::external_timecode_code0, reg::external_timecode_code1, timecode); } +#endif /******************************************************************************* * InternalTimecode * *******************************************************************************/ -xs_error_code_t Xsync::InternalTimecode_setFormat(TimecodeFormat_t format) { REG_WRITE(reg::internal_timecode_format, format); } -xs_error_code_t Xsync::InternalTimecode_getFormat(TimecodeFormat_t &format) { REG_READ(reg::internal_timecode_format, format); } -xs_error_code_t Xsync::InternalTimecode_setCode(XsyncTimecode_t timecode) { - DO_XSYNC(reg_write(reg::internal_timecode_en, 0)); - DO_XSYNC(writetimecode(reg::internal_timecode_data0, reg::internal_timecode_data1, timecode)); - DO_XSYNC(reg_write(reg::internal_timecode_en, 1)); - return kxs_ec_success; -} -xs_error_code_t Xsync::InternalTimecode_getCode(XsyncTimecode_t &timecode) { return readtimecode(reg::internal_timecode_data0, reg::internal_timecode_data1, timecode); } /******************************************************************************* * SysTimecode * *******************************************************************************/ -xs_error_code_t Xsync::SysTimecode_setSource(uint32_t sig) { REG_WRITE(reg::sys_timecode_select, sig); } -xs_error_code_t Xsync::SysTimecode_getSource(uint32_t &sig) { REG_READ(reg::sys_timecode_select, sig); } -xs_error_code_t Xsync::SysTimecode_readFormat(TimecodeFormat_t &format) { REG_READ(reg::sys_timecode_format, format); } -xs_error_code_t Xsync::SysTimecode_readCode(XsyncTimecode_t &timecode) { return readtimecode(reg::sys_timecode_data0, reg::sys_timecode_data1, timecode); } + /******************************************************************************* * TimecodeOutputModule * *******************************************************************************/ diff --git a/src/xsync_v2_sig_type.cpp b/src/xsync_v2_sig_type.cpp index 6f83e19..3d6763c 100644 --- a/src/xsync_v2_sig_type.cpp +++ b/src/xsync_v2_sig_type.cpp @@ -7,14 +7,13 @@ using namespace xsync; * TIMECODE * *******************************************************************************/ namespace xsync { -static map TimecodeFormatMap = { - {"TIMECODE_FPS2398", TIMECODE_FPS2398}, // - {"TIMECODE_FPS2400", TIMECODE_FPS2400}, // - {"TIMECODE_FPS2500", TIMECODE_FPS2500}, // - {"TIMECODE_FPS2997", TIMECODE_FPS2997}, // - {"TIMECODE_FPS2997Drop", TIMECODE_FPS2997Drop}, // - {"TIMECODE_FPS3000", TIMECODE_FPS3000}, // -}; +static map TimecodeFormatMap = {{"TIMECODE_FPS2398", TIMECODE_FPS2398}, // + {"TIMECODE_FPS2400", TIMECODE_FPS2400}, // + {"TIMECODE_FPS2500", TIMECODE_FPS2500}, // + {"TIMECODE_FPS2997", TIMECODE_FPS2997}, // + {"TIMECODE_FPS2997Drop", TIMECODE_FPS2997Drop}, // + {"TIMECODE_FPS3000", TIMECODE_FPS3000}, // + {"TIMECODE_NONE", TIMECODE_NONE}}; string TimecodeFormatToStr(TimecodeFormat_t type) { for (auto &item : TimecodeFormatMap) { @@ -156,6 +155,7 @@ list ControlModeStrSet() { } static map InputInterfaceMap = { + {"INPUT_IF_OFF", INPUT_IF_OFF}, {"TTL1_IN", INPUT_IF_TTL1}, // {"TTL2_IN", INPUT_IF_TTL2}, // {"TTL3_IN", INPUT_IF_TTL3}, //