宏定义Mv3dLpDefine.h和接口Mv3dLpApi.h的路径如下:
D:\3DMVS\Development\Includes
可以根据自己的客户端安装目录下查找即可,例如我的3DMVS的安装在D盘根目录所以上述文件目录为:D:\3DMVS\Development\Includes
第一步:在Mv3dLpDefine.h文件中新增宏定义
///< \~chinese 信息类型 \~english Match Type
#define MV3D_LP_MATCH_TYPE_NET_DETECT 0x00000001
2、添加获取网络信息相关结构体:
/************************************************************************
* @~chinese
* @brief 获取各种类型的信息
* @param handle [IN] 设备句柄
* @param pstInfo [IN][OUT] 返回给调用者有关相机各种类型的信息结构体指针
* @return 成功,返回MV3D_LP_OK,失败,返回错误码
* @~english
* @brief Get various type of information
* @param handle [IN] Device handle
* @param pstInfo [IN][OUT] Structure pointer of various type of information
* @return Success, return MV3D_LP_OK. Failure, return error code
************************************************************************/
MV3D_LP_API int __stdcall MV3D_LP_GetAllMatchInfo(void* handle, MV3D_LP_ALL_MATCH_INFO* pstInfo);
/************************************************************************
* @~chinese
* @brief 获取各种类型的信息
* @param handle [IN] 设备句柄
* @param pstInfo [IN][OUT] 返回给调用者有关相机各种类型的信息结构体指针
* @return 成功,返回MV3D_LP_OK,失败,返回错误码
* @~english
* @brief Get various type of information
* @param handle [IN] Device handle
* @param pstInfo [IN][OUT] Structure pointer of various type of information
* @return Success, return MV3D_LP_OK. Failure, return error code
************************************************************************/
MV3D_LP_API int __stdcall MV3D_LP_GetAllMatchInfo(void* handle, MV3D_LP_ALL_MATCH_INFO* pstInfo);
MV3D_LP_ALL_MATCH_INFO mathchInfo = {0};
MV3D_LP_MATCH_INFO_NET_DETECT netInfo;
memset(&mathchInfo, 0, sizeof(MV3D_LP_ALL_MATCH_INFO));
mathchInfo.nType = MV3D_LP_MATCH_TYPE_NET_DETECT;
mathchInfo.nInfoSize = sizeof(MV3D_LP_MATCH_INFO_NET_DETECT);
mathchInfo.pInfo = &netInfo;
nRet = MV3D_LP_GetAllMatchInfo(handle,&mathchInfo);
if (nRet == 0) {
//MV3D_LP_MATCH_INFO_NET_DETECT info= mathchInfo
int lostInfo = netInfo.nLostFrameCount;
int lostPackInfo = netInfo.nLostPacketCount;
}
注:此文章仅作为接口使用参考,在实际应用中建议将获取网络丢包等信息的操作放在一个单独的线程中实时获取;