mod_facetracking.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. #include "stdafx.h"
  2. #include "SpBase.h"
  3. #include "SpIni.h"
  4. #include "../mod_assistantchannel/AssistantChannel_client_g.h"
  5. using namespace AssistantChannel;
  6. #include "../mod_assistantchannel/chan_protocol.h"
  7. #include "rvc_media_common.h"
  8. #include "libvideoqueue.h"
  9. #include "jpeg2k.h"
  10. #include "libfacecapture.h"
  11. #include "y2k_time.h"
  12. #include "sysvar.h"
  13. #include "Event.h"
  14. #include "fileutil.h"
  15. #include "EventCode.h"
  16. #include "../mod_mediacontroller/Event.h"
  17. #ifndef MAX_LOG_LEN
  18. #define MAX_LOG_LEN 512
  19. #endif
  20. #ifndef rvc_snprintf
  21. #ifdef RVC_OS_WIN
  22. #define rvc_snprintf _snprintf
  23. #else
  24. #define rvc_snprintf snprintf
  25. #endif // RVC_OS_WIN
  26. #endif // rvc_snprintf
  27. // 脸部跟踪&拍照 devel: 0x302
  28. class CFaceTrackingEntity;
  29. class ChannelClient : public ChannelService_ClientBase
  30. {
  31. public:
  32. ChannelClient(CFaceTrackingEntity *pEntity);
  33. virtual void OnMessage(ErrorCodeEnum Error, ChannelService_Packet_Info &Msg, CSmartPointer<IReleasable> pData);
  34. };
  35. class CFaceTrackingEntity : public CEntityBase, public CHostApi , public CVideoMonitorEvent, public ISysVarListener, public ITimerListener,public ILogListener
  36. {
  37. public:
  38. CFaceTrackingEntity() : m_facecapture(NULL), bIsSessionChange(false),strCustomerID(false),strSessionID(false),bIsCustomerChange(false), m_bSingleCamera(false)
  39. {
  40. // note: this object initialize at DllMain, so it suggests keep your code simple here.
  41. // 1) do simple initializing here
  42. // 2) dont do complex operation, complex operation such as create new process(thread) and so on
  43. }
  44. virtual ~CFaceTrackingEntity() {}
  45. virtual const char *GetEntityName() const { return "FaceTracking"; }
  46. virtual void OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITransactionContext> pTransactionContext)
  47. {
  48. CSmartPointer<IEntityFunction> spFunction = GetFunction();
  49. ErrorCodeEnum Error;
  50. bool bRet = false;
  51. m_facecapture = new Clibfacecapture(&bRet, this, this, REC_COMMON_VIDEO_ENV_SHM_RTP_QUEUE, REC_COMMON_VIDEO_ENV_SHM_SNAPSHOT_QUEUE, REC_COMMON_VIDEO_OPT_SHM_RTP_QUEUE);
  52. if (!bRet)
  53. {
  54. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("load libface capture failed!");
  55. pTransactionContext->SendAnswer(Error_Resource);
  56. return;
  57. }
  58. Error = GetFunction()->RegistSysVarEvent("SessionID", this);
  59. if (Error != Error_Succeed)
  60. {
  61. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", "SessionID");
  62. }
  63. Error = GetFunction()->RegistSysVarEvent("CustomerID", this);
  64. if (Error != Error_Succeed)
  65. {
  66. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", "CustomerID");
  67. }
  68. Error = GetFunction()->RegistSysVarEvent(SYSVAR_CAMERASTATE, this);
  69. if (Error != Error_Succeed)
  70. {
  71. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", SYSVAR_CAMERASTATE);
  72. }
  73. CSimpleStringA strValue;
  74. GetFunction()->GetSysVar(SYSVAR_CAMERASTATE, strValue);
  75. if (strValue[0] == 'N')
  76. {
  77. m_facecapture->SetCameraState(0);
  78. }
  79. else if (strValue[0] == 'E')
  80. {
  81. m_facecapture->SetCameraState(1);
  82. }
  83. else if (strValue[0] == 'O')
  84. {
  85. m_facecapture->SetCameraState(2);
  86. }
  87. else if (strValue[0] == 'B')
  88. {
  89. m_facecapture->SetCameraState(3);
  90. }
  91. //is Pad Version
  92. CSystemStaticInfo stStaticinfo;
  93. spFunction->GetSystemStaticInfo(stStaticinfo);
  94. if (stricmp(stStaticinfo.strMachineType,"RVC.Stand1SPlus")==0){
  95. m_bSingleCamera = true;
  96. }
  97. spFunction->SubscribeLog(m_UUid1, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_HEADLIGHT_GREEN_OFF,NULL,false);
  98. spFunction->SubscribeLog(m_UUid2, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED,NULL,false);
  99. spFunction->SubscribeLog(m_UUid3, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED,NULL,false);
  100. spFunction->SubscribeLog(m_UUid4, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MEDIACONTROLLER_RESET_ACTIVECAMERA, NULL, false);
  101. pTransactionContext->SendAnswer(Error);
  102. }
  103. virtual void OnStarted()
  104. {
  105. LogEvent(Severity_Middle, LOG_EVT_MOD_FACETRACKING_STARTED_SUCCESS, "facetracking entity started successfully.");
  106. }
  107. virtual void OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartPointer<ITransactionContext> pTransactionContext)
  108. {
  109. CSmartPointer<IEntityFunction> spFunction = GetFunction();
  110. delete m_facecapture;
  111. m_facecapture = NULL;
  112. spFunction->UnsubscribeLog(m_UUid1);
  113. spFunction->UnsubscribeLog(m_UUid2);
  114. spFunction->UnsubscribeLog(m_UUid3);
  115. spFunction->UnsubscribeLog(m_UUid4);
  116. spFunction->UnregistSysVarEvent("SessionID");
  117. spFunction->UnregistSysVarEvent("CustomerID");
  118. spFunction->UnregistSysVarEvent(SYSVAR_CAMERASTATE);
  119. pTransactionContext->SendAnswer(Error_Succeed);
  120. }
  121. virtual void OnPaused()
  122. {
  123. Capture(0);
  124. }
  125. int TransCameraStateToInt(char cData)
  126. {
  127. int iRet = 0;
  128. if ('E' == cData){
  129. iRet = 1;
  130. }
  131. else if('O' == cData){
  132. iRet = 2;
  133. }
  134. else if('B' == cData){
  135. iRet = 3;
  136. }
  137. return iRet;
  138. }
  139. void OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
  140. const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
  141. const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext &pLinkInfo)
  142. {
  143. switch (dwUserCode)
  144. {
  145. case LOG_EVT_HEADLIGHT_GREEN_OFF:
  146. m_facecapture->SetLightChange();
  147. break;
  148. case LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED:
  149. {
  150. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED event");
  151. CSimpleStringA strValue;
  152. GetFunction()->GetSysVar(SYSVAR_CAMERASTATE, strValue);
  153. #if defined(RVC_OS_WIN)
  154. int iState = TransCameraStateToInt(strValue[0]);
  155. if (3 != iState) {
  156. m_facecapture->SetCameraState(iState);
  157. m_facecapture->StartFaceCapture();
  158. }
  159. else {
  160. m_facecapture->SetCameraState(3);
  161. }
  162. #else
  163. if (strValue[0] == 'N') {
  164. m_facecapture->SetCameraState(0);
  165. m_facecapture->StartFaceCapture();
  166. }
  167. else if (strValue[0] == 'E')
  168. {
  169. m_facecapture->SetCameraState(1);
  170. m_facecapture->StartFaceCapture();
  171. }
  172. else if (strValue[0] == 'O')
  173. {
  174. m_facecapture->SetCameraState(2);
  175. m_facecapture->StartFaceCapture();
  176. }
  177. else if (strValue[0] == 'B')
  178. {
  179. m_facecapture->SetCameraState(3);
  180. }
  181. #endif //RVC_OS_WIN
  182. if (!m_bSingleCamera) {
  183. GetFunction()->SetTimer(1, this, 1000);
  184. }
  185. }
  186. break;
  187. case LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED:
  188. {
  189. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED event");
  190. m_facecapture->StopFaceCapture();
  191. CSimpleStringA strValue;
  192. GetFunction()->GetSysVar(SYSVAR_CAMERASTATE, strValue);
  193. int iState = TransCameraStateToInt(strValue[0]);
  194. m_facecapture->SetCameraState(iState);
  195. if (!m_bSingleCamera) {
  196. GetFunction()->KillTimer(1);
  197. }
  198. GetFunction()->SetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, ACTIVETRACKINGCAMERA_ENV); // from Operation -> Environment
  199. }
  200. break;
  201. case LOG_EVT_MEDIACONTROLLER_RESET_ACTIVECAMERA:
  202. {
  203. CSimpleStringA strValue;
  204. GetFunction()->GetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, strValue); // E or O
  205. if ('O' == strValue[0]) {
  206. GetFunction()->SetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, ACTIVETRACKINGCAMERA_ENV); // from Operation -> Environment
  207. }
  208. }
  209. break;
  210. default:
  211. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown event.");
  212. break;
  213. }
  214. }
  215. void Capture(int id)
  216. {
  217. #if 0
  218. CImageFrame frm;
  219. frm.data = new unsigned char[REC_COMMON_VIDEO_SNAPSHOT_WIDTH*REC_COMMON_VIDEO_SNAPSHOT_HEIGHT*4];
  220. frm.width = REC_COMMON_VIDEO_SNAPSHOT_WIDTH;
  221. frm.height = REC_COMMON_VIDEO_SNAPSHOT_HEIGHT;
  222. frm.framesize = frm.width * frm.height * 3;
  223. if (m_facecapture->SnapShot(frm)) {
  224. int rc;
  225. jpeg2k_raw_image raw_image;
  226. jpeg2k_coded_image codec_image = {0};
  227. raw_image.data = frm.data;
  228. raw_image.width = frm.width;
  229. raw_image.height = frm.height;
  230. raw_image.len = raw_image.width * raw_image.height * 3;
  231. rc = jpeg2k_encode(&raw_image, &codec_image, 10);
  232. if (rc == 0) {
  233. ChannelService_Send_Info Info;
  234. Info.compress = false;
  235. Info.encrypt = false;
  236. Info.type = ACM_TYPE_PHT;
  237. Info.id = id;
  238. Info.sub_type = ACM_PHT_ANS | ACM_PHT_SNAPSHOT;
  239. Info.data.m_pData = codec_image.data;
  240. Info.data.m_iLength = codec_image.len;
  241. (*m_pChannelClient)(EntityResource::getLink().upgradeLink())->Send(Info);
  242. }
  243. jpeg2k_encode_free(&codec_image);
  244. } else {
  245. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get video frm failed!");
  246. }
  247. delete frm.data;
  248. #endif
  249. }
  250. //////////////////////////////////////////////////////////////////////////////////////////////////////
  251. // ITimerListener implementation
  252. virtual void OnTimeout(DWORD dwTimerID)
  253. {
  254. __int64 uid;
  255. CCustomerStatus status;
  256. //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("before GetMainCustomerStatus");
  257. if (m_facecapture->GetMainCustomerStatus(uid, status))
  258. {
  259. CSmartPointer<IEntityFunction> spFunction = GetFunction();
  260. CSimpleStringA strValue;
  261. //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnTimeout, check value, eCamera = %d", status.stCustomerPos.eCamera);
  262. spFunction->GetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, strValue); // E or O
  263. if (status.stCustomerPos.eCamera == EnvironCamera)
  264. {
  265. if (strValue[0] == 'O')
  266. {
  267. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ActiveTrackingCamera change from Opt->Env!");
  268. spFunction->SetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, ACTIVETRACKINGCAMERA_ENV); // from Operation -> Environment
  269. }
  270. }
  271. else
  272. {
  273. if (strValue[0] == 'E')
  274. {
  275. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ActiveTrackingCamera change from Env->Opt!");
  276. spFunction->SetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, ACTIVETRACKINGCAMERA_OPT); // from Environment -> Operation
  277. }
  278. }
  279. }
  280. else
  281. {
  282. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetMainCustomerStatus failed!");
  283. }
  284. }
  285. //////////////////////////////////////////////////////////////////////////////////////////////////////
  286. // CHostApi implementation
  287. virtual unsigned __int64 GenerateUUID()
  288. {
  289. m_lastUUID = CUUID::Create(m_lastUUID);
  290. return m_lastUUID;
  291. }
  292. virtual bool IsCustomerChange()
  293. {
  294. bool bChange = bIsSessionChange||bIsCustomerChange;
  295. return bChange;
  296. }
  297. virtual void GetFaceImgName(char* FaceName, size_t uLen)
  298. {
  299. CSimpleStringA strPath;
  300. ErrorCodeEnum Error = GetFunction()->GetPath("UploadPhoto", strPath);
  301. if (Error == Error_Succeed)
  302. {
  303. if (((const char*)strCustomerID == NULL)||(_stricmp(strCustomerID,"N") == 0))
  304. {
  305. rvc_snprintf(FaceName, uLen,"%s%s%s_0", strPath.GetData(), SPLIT_SLASH_STR, strSessionID.GetData());
  306. }
  307. else
  308. {
  309. rvc_snprintf(FaceName, uLen, "%s%s%s_%s", strPath.GetData(), SPLIT_SLASH_STR, strSessionID.GetData(), strCustomerID.GetData());
  310. }
  311. bIsSessionChange = false;
  312. bIsCustomerChange = false;
  313. }
  314. else
  315. {
  316. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("getpath uploadphoto failed!");
  317. }
  318. }
  319. virtual bool LoadConfig(CFaceCaptureConfig &config)
  320. {
  321. CSmartPointer<IEntityFunction> spFunction = GetFunction();
  322. CSmartPointer<IConfigInfo> spConfig;
  323. ErrorCodeEnum Error(Error_Succeed);
  324. /*
  325. PrimCamera=1
  326. UpCameraEdgeLimit=3
  327. DownCameraEdgeLimit=2
  328. ServersType=0
  329. ContourMinAera=14400
  330. FaceDataDirPath=facedata
  331. OperateFaceSize=4.2
  332. CloseFaceSize=6.6
  333. FarFaceSize=8.2
  334. SearchFaceSize=8.2
  335. DetectFaceSize=6.6
  336. FaceSizeOffset=18
  337. SleepLong=800
  338. SleepMiddle=600
  339. SleepShort=500
  340. ThresholdNum=10
  341. */
  342. CSimpleStringA strPath;
  343. config.nServersType = 0;
  344. GetFunction()->GetPath("cfg", strPath);
  345. strcpy(config.strFaceDataDirPath, strPath);
  346. strcat(config.strFaceDataDirPath, SPLIT_SLASH_STR "facedata");
  347. config.nPrimCamera = 1;
  348. config.nContourMinAera = 14400;
  349. config.nUpCameraEdgeLimit = 3;
  350. config.nDownCameraEdgeLimit = 2;
  351. config.fOperateFaceSize = 4.2f;
  352. config.fCloseFaceSize = 6.6f;
  353. config.fFarFaceSize = 8.2f;
  354. config.fSearchFaceSize = 8.2f;
  355. config.fDetectFaceSize = 6.6f;
  356. config.nFaceSizeOffset = 18;
  357. config.nSleepLong = 800;
  358. config.nSleepMiddle = 600;
  359. config.nSleepShort = 500;
  360. config.nThresholdNum = 10;
  361. Error = Error_Succeed;
  362. return Error == Error_Succeed;
  363. }
  364. virtual void Debug(const char *fmt, ...)
  365. {
  366. va_list arg;
  367. va_start(arg, fmt);
  368. int n = vsnprintf(NULL, 0, fmt, arg);
  369. if (n >= MAX_LOG_LEN) {
  370. char* buf = (char*)malloc((size_t)(n + 1));
  371. vsnprintf(buf, n + 1, fmt, arg);
  372. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", buf);
  373. free(buf);
  374. }
  375. else{
  376. char strlog[MAX_LOG_LEN] = {0};
  377. vsnprintf(strlog, MAX_LOG_LEN, fmt, arg);
  378. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s", strlog);
  379. }
  380. va_end(arg);
  381. }
  382. ////////////////////////////////////////////////////////////////////////////////////
  383. // CVideoMonitorEvent
  384. virtual void GenerateCloseEvent()
  385. {
  386. LogEvent(Severity_Middle, 0x30200001, "客户接近 1.5m");
  387. }
  388. virtual void GenerateLeaveEvent()
  389. {
  390. LogEvent(Severity_Middle, 0x30200002, "客户消失或退出到接近距离1.5M之外");
  391. }
  392. virtual void GenerateEnterOperateEvent()
  393. {
  394. LogEvent(Severity_Middle, 0x30200003, "客户进入操作距离0.5m");
  395. }
  396. virtual void GenerateBackToCloseEvent()
  397. {
  398. LogEvent(Severity_Middle, 0x30200004, "客户退回到接近距离");
  399. }
  400. virtual void GenerateAppearEvent() //有人出现在视野中
  401. {
  402. LogEvent(Severity_Middle, 0x30200006, "有人出现");
  403. }
  404. virtual void GenerateCustomerChangeEvent()
  405. {
  406. LogEvent(Severity_Middle, 0x30200005, "客户已经换人");
  407. }
  408. virtual void GenerateCaptureFaceEvent()
  409. {
  410. LogEvent(Severity_Middle, 0x30200011, "捕获脸部事件");
  411. }
  412. virtual void GenerateLoseFaceEvent()
  413. {
  414. LogEvent(Severity_Middle, 0x30200012, "失去脸部事件");
  415. }
  416. virtual void GenerateFaceCaptureFC()
  417. {
  418. //发送最高等级错误事件,由健康模块重启对应实体
  419. LogEvent(Severity_High,EVENT_MOD_FACE_BREAKDOWN,"the opencv library breakdown");
  420. }
  421. private:
  422. virtual void OnSysVarEvent(const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName)
  423. {
  424. if (_stricmp(pszKey,"SessionID") == 0)
  425. {
  426. GetFunction()->GetSysVar("SessionID",strSessionID);
  427. //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sessionID change to %s",strSessionID);
  428. bIsSessionChange = true;
  429. }
  430. if (_stricmp(pszKey,"CustomerID") == 0)
  431. {
  432. GetFunction()->GetSysVar("CustomerID",strCustomerID);
  433. //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("customerID change to %s",strCustomerID);
  434. bIsCustomerChange = true;
  435. }
  436. if (_stricmp(pszKey, SYSVAR_CAMERASTATE) == 0)
  437. {
  438. CSimpleStringA str;
  439. GetFunction()->GetSysVar(SYSVAR_CAMERASTATE,str);
  440. //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("customerID change to %s",strCustomerID);
  441. if (str == 'N')
  442. {
  443. m_facecapture->SetCameraState(0);
  444. }
  445. else if (str == 'E')
  446. {
  447. m_facecapture->SetCameraState(1);
  448. }
  449. else if (str == 'O')
  450. {
  451. m_facecapture->SetCameraState(2);
  452. }
  453. else if (str == 'B')
  454. {
  455. m_facecapture->SetCameraState(3);
  456. //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set Camera State to 3");
  457. }
  458. }
  459. }
  460. private:
  461. CUUID m_UUid1,m_UUid2,m_UUid3,m_UUid4;
  462. bool bIsSessionChange;
  463. bool bIsCustomerChange;
  464. CSimpleStringA strCustomerID;
  465. CSimpleStringA strSessionID;
  466. CUUID m_lastUUID;
  467. ChannelClient *m_pChannelClient;
  468. Clibfacecapture *m_facecapture;
  469. bool m_bSingleCamera;
  470. };
  471. void ChannelClient::OnMessage( ErrorCodeEnum Error, ChannelService_Packet_Info &Msg, CSmartPointer<IReleasable> pData )
  472. {
  473. if (Error == Error_Succeed)
  474. {
  475. CFaceTrackingEntity *pEntity = static_cast<CFaceTrackingEntity*>(m_pEntityBase);
  476. int cat = ACM_PHT_CAT(Msg.sub_type);
  477. if (cat == ACM_PHT_REQ)
  478. {
  479. //SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
  480. pEntity->Capture(Msg.id);
  481. //SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
  482. } else
  483. {
  484. _ASSERT(0);
  485. }
  486. }
  487. }
  488. ChannelClient::ChannelClient( CFaceTrackingEntity *pEntity ) : ChannelService_ClientBase(pEntity)
  489. {
  490. }
  491. SP_BEGIN_ENTITY_MAP()
  492. SP_ENTITY(CFaceTrackingEntity)
  493. SP_END_ENTITY_MAP()