PageRenderTime 55ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 2ms

/IntVideoSurv.VideoSource/HCNetSDK.cs

http://longchang.codeplex.com
C# | 11008 lines | 3139 code | 83 blank | 7786 comment | 0 complexity | 24e616ba3cb66e9f359516ba2852f7dc MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. /// ? ??????
  2. /// ? ??over140@gmail.com
  3. /// ? ??http://over140.cnblogs.com/
  4. /// ? ??2009-10-4 —— 2009-10-22
  5. /// ? ???????API??
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Text;
  9. using System.Runtime.InteropServices;
  10. namespace DigitMatrix.VideoProcess
  11. {
  12. public delegate void RealDataCallBack_V30(int lRealHandle, uint dwDataType, byte[] pBuffer, uint dwBufSize, IntPtr pUser);
  13. /// <summary>
  14. /// 5.1.2 ?????????[??connect????????]
  15. /// ??
  16. /// ??????????????????????????????????????????????????????????????????????????NET_DVR_RealPlay?????
  17. /// ???????????????????
  18. /// NET_DVR_API LONG __stdcall NET_DVR_RealPlay_V30(LONG lUserID, LPNET_DVR_CLIENTINFO lpClientInfo, void(CALLBACK *fRealDataCallBack_V30) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, void* pUser) = NULL, void* pUser = NULL, BOOL bBlocked = FALSE);
  19. /// </summary>
  20. /// <param name="lUserID">[in]NET_DVR_Login??NET_DVR_Login_V30????</param>
  21. /// <param name="lpClientInfo">[in]NET_DVR_CLIENTINFO?????</param>
  22. /// <param name="fRealDataCallBack_V30">[in]????????</param>
  23. /// <param name="pUser">[in]????</param>
  24. /// <param name="bBlocked">[in]???????????0???1??</param>
  25. /// <returns>-1??????????NET_DVR_StopRealPlay??????</returns>
  26. ///
  27. #region 2.2 ????
  28. /// <summary>
  29. /// 2.2.1 ???????
  30. /// NET_DVR_Login_V30()????
  31. /// NET_DVR_DEVICEINFO_V30, *LPNET_DVR_DEVICEINFO_V30;
  32. /// </summary>
  33. public struct NET_DVR_DEVICEINFO_V30
  34. {
  35. /// <summary>
  36. /// ???
  37. /// public byte sSerialNumber[SERIALNO_LEN];
  38. /// </summary>
  39. [MarshalAs(UnmanagedType.ByValArray, SizeConst = HCNetSDK.SERIALNO_LEN)]
  40. public byte[] sSerialNumber;
  41. /// <summary>
  42. /// ??????
  43. /// </summary>
  44. public byte byAlarmInPortNum;
  45. /// <summary>
  46. /// ??????
  47. /// </summary>
  48. public byte byAlarmOutPortNum;
  49. /// <summary>
  50. /// ????
  51. /// </summary>
  52. public byte byDiskNum;
  53. /// <summary>
  54. /// ????, 1:DVR 2:ATM DVR 3:DVS ......
  55. /// </summary>
  56. public byte byDVRType;
  57. /// <summary>
  58. /// ??????
  59. /// </summary>
  60. public byte byChanNum;
  61. /// <summary>
  62. /// ?????,??DVS-1,DVR - 1
  63. /// </summary>
  64. public byte byStartChan;
  65. /// <summary>
  66. /// ?????
  67. /// </summary>
  68. public byte byAudioChanNum;
  69. /// <summary>
  70. /// ????????
  71. /// </summary>
  72. public byte byIPChanNum;
  73. /// <summary>
  74. /// ??
  75. /// public byte byRes1[24];
  76. /// </summary>
  77. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
  78. public byte[] byRes1;
  79. }
  80. /// <summary>
  81. /// ???????
  82. /// NET_DVR_Login()????
  83. /// NET_DVR_DEVICEINFO, *LPNET_DVR_DEVICEINFO;
  84. /// </summary>
  85. public struct NET_DVR_DEVICEINFO
  86. {
  87. /// <summary>
  88. /// ???
  89. /// public byte sSerialNumber[SERIALNO_LEN];
  90. /// </summary>
  91. [MarshalAs(UnmanagedType.ByValArray, SizeConst = HCNetSDK.SERIALNO_LEN)]
  92. public byte[] sSerialNumber;
  93. /// <summary>
  94. /// DVR??????
  95. /// </summary>
  96. public byte byAlarmInPortNum;
  97. /// <summary>
  98. /// DVR??????
  99. /// </summary>
  100. public byte byAlarmOutPortNum;
  101. /// <summary>
  102. /// DVR????
  103. /// </summary>
  104. public byte byDiskNum;
  105. /// <summary>
  106. /// DVR??, 1:DVR 2:ATM DVR 3:DVS ......
  107. /// </summary>
  108. public byte byDVRType;
  109. /// <summary>
  110. /// DVR ????
  111. /// </summary>
  112. public byte byChanNum;
  113. /// <summary>
  114. /// ?????,??DVS-1,DVR - 1
  115. /// </summary>
  116. public byte byStartChan;
  117. }
  118. #endregion
  119. #region 3.2 SDK??
  120. /// <summary>
  121. /// 3.2.1 SDK???????(9000??)
  122. /// NET_DVR_SDKSTATE, *LPNET_DVR_SDKSTATE;
  123. /// </summary>
  124. public struct NET_DVR_SDKSTATE
  125. {
  126. /// <summary>
  127. /// ??login???
  128. /// </summary>
  129. public uint dwTotalLoginNum;
  130. /// <summary>
  131. /// ??realplay??
  132. /// </summary>
  133. public uint dwTotalRealPlayNum;
  134. /// <summary>
  135. /// ?????????
  136. /// </summary>
  137. public uint dwTotalPlayBackNum;
  138. /// <summary>
  139. /// ??????????
  140. /// </summary>
  141. public uint dwTotalAlarmChanNum;
  142. /// <summary>
  143. /// ?????????
  144. /// </summary>
  145. public uint dwTotalFormatNum;
  146. /// <summary>
  147. /// ???????????
  148. /// </summary>
  149. public uint dwTotalFileSearchNum;
  150. /// <summary>
  151. /// ???????????
  152. /// </summary>
  153. public uint dwTotalLogSearchNum;
  154. /// <summary>
  155. /// ????????
  156. /// </summary>
  157. public uint dwTotalSerialNum;
  158. /// <summary>
  159. /// ??????
  160. /// </summary>
  161. public uint dwTotalUpgradeNum;
  162. /// <summary>
  163. /// ????????
  164. /// </summary>
  165. public uint dwTotalVoiceComNum;
  166. /// <summary>
  167. /// ????????
  168. /// </summary>
  169. public uint dwTotalBroadCastNum;
  170. /// <summary>
  171. /// ??
  172. /// public uint dwRes[10];
  173. /// </summary>
  174. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
  175. public uint[] dwRes;
  176. }
  177. /// <summary>
  178. /// 3.2.2 SDK?????????(9000??)
  179. /// NET_DVR_SDKABL, *LPNET_DVR_SDKABL;
  180. /// </summary>
  181. public struct NET_DVR_SDKABL
  182. {
  183. /// <summary>
  184. /// ??login??? MAX_LOGIN_USERS
  185. /// </summary>
  186. public uint dwMaxLoginNum;
  187. /// <summary>
  188. /// ??realplay?? WATCH_NUM
  189. /// </summary>
  190. public uint dwMaxRealPlayNum;
  191. /// <summary>
  192. /// ????????? WATCH_NUM
  193. /// </summary>
  194. public uint dwMaxPlayBackNum;
  195. /// <summary>
  196. /// ?????????? ALARM_NUM
  197. /// </summary>
  198. public uint dwMaxAlarmChanNum;
  199. /// <summary>
  200. /// ????????? SERVER_NUM
  201. /// </summary>
  202. public uint dwMaxFormatNum;
  203. /// <summary>
  204. /// ???????? SERVER_NUM
  205. /// </summary>
  206. public uint dwMaxFileSearchNum;
  207. /// <summary>
  208. /// ???????? SERVER_NUM
  209. /// </summary>
  210. public uint dwMaxLogSearchNum;
  211. /// <summary>
  212. /// ???????? SERVER_NUM
  213. /// </summary>
  214. public uint dwMaxSerialNum;
  215. /// <summary>
  216. /// ?????? SERVER_NUM
  217. /// </summary>
  218. public uint dwMaxUpgradeNum;
  219. /// <summary>
  220. /// ???????? SERVER_NUM
  221. /// </summary>
  222. public uint dwMaxVoiceComNum;
  223. /// <summary>
  224. /// ???????? MAX_CASTNUM
  225. /// </summary>
  226. public uint dwMaxBroadCastNum;
  227. /// <summary>
  228. /// ??
  229. /// public uint dwRes[10];
  230. /// </summary>
  231. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
  232. public uint[] dwRes;
  233. }
  234. #endregion
  235. #region 5.2 ????
  236. /// <summary>
  237. /// 5.2.1 ???????
  238. /// ??
  239. /// ???hPlayWnd?????NULL?????????????????????????
  240. /// NET_DVR_CLIENTINFO, *LPNET_DVR_CLIENTINFO;
  241. /// </summary>
  242. public struct NET_DVR_CLIENTINFO
  243. {
  244. /// <summary>
  245. /// ???
  246. /// </summary>
  247. public int lChannel;
  248. /// <summary>
  249. /// ???(31)?0???????1????0?30?????????: 0?TCP??,1?UDP??,2?????,3 - RTP???4-?????(TCP)
  250. /// </summary>
  251. public int lLinkMode;
  252. /// <summary>
  253. /// ???????,?NULL???????
  254. /// IntPtr hPlayWnd;
  255. /// </summary>
  256. public IntPtr hPlayWnd;
  257. /// <summary>
  258. /// ?????
  259. /// char* sMultiCastIP;
  260. /// </summary>
  261. public string sMultiCastIP;
  262. }
  263. /// <summary>
  264. /// ????
  265. /// </summary>
  266. public enum SEND_MODE
  267. {
  268. /// <summary>
  269. /// TCP ??
  270. /// </summary>
  271. PTOPTCPMODE = 0,
  272. /// <summary>
  273. /// UDP ??
  274. /// </summary>
  275. PTOPUDPMODE,
  276. /// <summary>
  277. /// ????
  278. /// </summary>
  279. MULTIMODE,
  280. /// <summary>
  281. /// RTP??
  282. /// </summary>
  283. RTPMODE,
  284. /// <summary>
  285. /// ??
  286. /// </summary>
  287. RESERVEDMODE
  288. }
  289. #endregion
  290. /// <summary>
  291. /// NET_DVR_API????????
  292. /// DS-90xx????????
  293. /// DS-91xx?DS-81xx?DS-80xx?DS-70xx?DS-71xx?DS-7116?DS-72xx?????
  294. /// DS-60xx?DS-61xx???????/???
  295. /// IP?????IP???IP????????“IPC”??IP???
  296. /// </summary>
  297. public sealed class HCNetSDK
  298. {
  299. #region ???
  300. /// <summary>
  301. /// DVR?????
  302. /// </summary>
  303. public const int MAX_NAMELEN = 16;
  304. /// <summary>
  305. /// ????????1-12???????13-32???????
  306. /// </summary>
  307. public const int MAX_RIGHT = 32;
  308. /// <summary>
  309. /// ?????
  310. /// </summary>
  311. public const int NAME_LEN = 32;
  312. /// <summary>
  313. /// /????
  314. /// </summary>
  315. public const int PASSWD_LEN = 16;
  316. /// <summary>
  317. /// ?????
  318. /// </summary>
  319. public const int SERIALNO_LEN = 48;
  320. /// <summary>
  321. /// mac????
  322. /// </summary>
  323. public const int MACADDR_LEN = 6;
  324. /// <summary>
  325. /// ????????
  326. /// </summary>
  327. public const int MAX_ETHERNET = 2;
  328. /// <summary>
  329. /// ????
  330. /// </summary>
  331. public const int PATHNAME_LEN = 128;
  332. /// <summary>
  333. /// 9000????????
  334. /// </summary>
  335. public const int MAX_TIMESEGMENT_V30 = 8;
  336. /// <summary>
  337. /// 8000????????
  338. /// </summary>
  339. public const int MAX_TIMESEGMENT = 4;
  340. /// <summary>
  341. /// 8000?????????
  342. /// </summary>
  343. public const int MAX_SHELTERNUM = 4;
  344. /// <summary>
  345. /// ????
  346. /// </summary>
  347. public const int MAX_DAYS = 7;
  348. /// <summary>
  349. /// pppoe????????
  350. /// </summary>
  351. public const int PHONENUMBER_LEN = 32;
  352. /// <summary>
  353. /// 9000???????/* ??33???(??16???SATA???1?eSATA???16?NFS?) */
  354. /// </summary>
  355. public const int MAX_DISKNUM_V30 = 33;
  356. /// <summary>
  357. /// 8000???????
  358. /// </summary>
  359. public const int MAX_DISKNUM = 16;
  360. /// <summary>
  361. /// 1.2??????
  362. /// </summary>
  363. public const int MAX_DISKNUM_V10 = 8;
  364. /// <summary>
  365. /// 9000?????????????
  366. /// </summary>
  367. public const int MAX_WINDOW_V30 = 32;
  368. /// <summary>
  369. /// 8000???????
  370. /// </summary>
  371. public const int MAX_WINDOW = 16;
  372. /// <summary>
  373. /// 9000??????VGA?
  374. /// </summary>
  375. public const int MAX_VGA_V30 = 4;
  376. /// <summary>
  377. /// 8000??????VGA?
  378. /// </summary>
  379. public const int MAX_VGA = 1;
  380. /// <summary>
  381. /// 9000???????
  382. /// </summary>
  383. public const int MAX_USERNUM_V30 = 32;
  384. /// <summary>
  385. /// 8000???????
  386. /// </summary>
  387. public const int MAX_USERNUM = 16;
  388. /// <summary>
  389. /// 9000?????????
  390. /// </summary>
  391. public const int MAX_EXCEPTIONNUM_V30 = 32;
  392. /// <summary>
  393. /// 8000?????????
  394. /// </summary>
  395. public const int MAX_EXCEPTIONNUM = 16;
  396. /// <summary>
  397. /// 8000?????????????
  398. /// </summary>
  399. public const int MAX_LINK = 6;
  400. /// <summary>
  401. /// ???????????????????
  402. /// </summary>
  403. public const int MAX_DECPOOLNUM = 4;
  404. /// <summary>
  405. /// ????????????????????????????
  406. /// </summary>
  407. public const int MAX_DECNUM = 4;
  408. /// <summary>
  409. /// ???????????????
  410. /// </summary>
  411. public const int MAX_TRANSPARENTNUM = 2;
  412. /// <summary>
  413. /// ????????????
  414. /// </summary>
  415. public const int MAX_CYCLE_CHAN = 16;
  416. /// <summary>
  417. /// ??????
  418. /// </summary>
  419. public const int MAX_DIRNAME_LENGTH = 80;
  420. /// <summary>
  421. /// 9000????OSD?????
  422. /// </summary>
  423. public const int MAX_STRINGNUM_V30 = 8;
  424. /// <summary>
  425. /// 8000????OSD?????
  426. /// </summary>
  427. public const int MAX_STRINGNUM = 4;
  428. /// <summary>
  429. /// 8000????
  430. /// </summary>
  431. public const int MAX_STRINGNUM_EX = 8;
  432. /// <summary>
  433. /// 9000?????????
  434. /// </summary>
  435. public const int MAX_AUXOUT_V30 = 16;
  436. /// <summary>
  437. /// 8000?????????
  438. /// </summary>
  439. public const int MAX_AUXOUT = 4;
  440. /// <summary>
  441. /// 9000????????
  442. /// </summary>
  443. public const int MAX_HD_GROUP = 16;
  444. /// <summary>
  445. /// 8000????NFS???
  446. /// </summary>
  447. public const int MAX_NFS_DISK = 8;
  448. /// <summary>
  449. /// WIFI?SSID???
  450. /// </summary>
  451. public const int IW_ESSID_MAX_SIZE = 32;
  452. /// <summary>
  453. /// WIFI???????
  454. /// </summary>
  455. public const int IW_ENCODING_TOKEN_MAX = 32;
  456. /// <summary>
  457. /// ???????????
  458. /// </summary>
  459. public const int MAX_SERIAL_NUM = 64;
  460. /// <summary>
  461. /// 9000??????ddns?
  462. /// </summary>
  463. public const int MAX_DDNS_NUMS = 10;
  464. /// <summary>
  465. /// /* ?????? */
  466. /// </summary>
  467. public const int MAX_DOMAIN_NAME = 64;
  468. /// <summary>
  469. /// ??email????
  470. /// </summary>
  471. public const int MAX_EMAIL_ADDR_LEN = 48;
  472. /// <summary>
  473. /// ??email????
  474. /// </summary>
  475. public const int MAX_EMAIL_PWD_LEN = 32;
  476. /// <summary>
  477. /// ?????????
  478. /// </summary>
  479. public const int MAXPROGRESS = 100;
  480. /// <summary>
  481. /// 8000???????? 1-232? 2-485
  482. /// </summary>
  483. public const int MAX_SERIALNUM = 2;
  484. /// <summary>
  485. /// ????
  486. /// </summary>
  487. public const int CARDNUM_LEN = 20;
  488. /// <summary>
  489. /// 9000????????
  490. /// </summary>
  491. public const int MAX_VIDEOOUT_V30 = 4;
  492. /// <summary>
  493. /// 8000????????
  494. /// </summary>
  495. public const int MAX_VIDEOOUT = 2;
  496. #region ????
  497. /// <summary>
  498. /// 9000???????????
  499. /// </summary>
  500. public const int MAX_PRESET_V30 = 256;
  501. /// <summary>
  502. /// 9000??????????
  503. /// </summary>
  504. public const int MAX_TRACK_V30 = 256;
  505. /// <summary>
  506. /// 9000??????????
  507. /// </summary>
  508. public const int MAX_CRUISE_V30 = 256;
  509. /// <summary>
  510. /// 8000???????????
  511. /// </summary>
  512. public const int MAX_PRESET = 128;
  513. /// <summary>
  514. /// 8000??????????
  515. /// </summary>
  516. public const int MAX_TRACK = 128;
  517. /// <summary>
  518. /// 8000??????????
  519. /// </summary>
  520. public const int MAX_CRUISE = 128;
  521. /// <summary>
  522. /// ??????????
  523. /// </summary>
  524. public const int CRUISE_MAX_PRESET_NUMS = 32;
  525. /// <summary>
  526. /// 9000????232???
  527. /// </summary>
  528. public const int MAX_SERIAL_PORT = 8;
  529. /// <summary>
  530. /// ???????????? 1??,4??,9??,16??....
  531. /// </summary>
  532. public const int MAX_PREVIEW_MODE = 8;
  533. /// <summary>
  534. /// ??????????
  535. /// </summary>
  536. public const int MAX_MATRIXOUT = 16;
  537. /// <summary>
  538. /// ??????
  539. /// </summary>
  540. public const int LOG_INFO_LEN = 11840;
  541. /// <summary>
  542. /// ?????????
  543. /// </summary>
  544. public const int DESC_LEN = 16;
  545. /// <summary>
  546. /// 9000??????????
  547. /// </summary>
  548. public const int PTZ_PROTOCOL_NUM = 200;
  549. /// <summary>
  550. /// 8000???????
  551. /// </summary>
  552. public const int MAX_AUDIO = 1;
  553. /// <summary>
  554. /// 9000???????
  555. /// </summary>
  556. public const int MAX_AUDIO_V30 = 2;
  557. /// <summary>
  558. /// 8000???????
  559. /// </summary>
  560. public const int MAX_CHANNUM = 16;
  561. /// <summary>
  562. /// 8000?????????
  563. /// </summary>
  564. public const int MAX_ALARMIN = 16;
  565. /// <summary>
  566. /// 8000?????????
  567. /// </summary>
  568. public const int MAX_ALARMOUT = 4;
  569. #endregion
  570. #region 9000 IPC??
  571. /// <summary>
  572. /// ??32?????
  573. /// </summary>
  574. public const int MAX_ANALOG_CHANNUM = 32;
  575. /// <summary>
  576. /// ??32???????
  577. /// </summary>
  578. public const int MAX_ANALOG_ALARMOUT = 32;
  579. /// <summary>
  580. /// ??32???????
  581. /// </summary>
  582. public const int MAX_ANALOG_ALARMIN = 32;
  583. /// <summary>
  584. /// ???????IP???
  585. /// </summary>
  586. public const int MAX_IP_DEVICE = 32;
  587. /// <summary>
  588. /// ???????IP???
  589. /// </summary>
  590. public const int MAX_IP_CHANNEL = 32;
  591. /// <summary>
  592. /// ????????????
  593. /// </summary>
  594. public const int MAX_IP_ALARMIN = 128;
  595. /// <summary>
  596. /// ????????????
  597. /// </summary>
  598. public const int MAX_IP_ALARMOUT = 64;
  599. /* ???????? ????????IP?? */
  600. public const int MAX_CHANNUM_V30 = (MAX_ANALOG_CHANNUM + MAX_IP_CHANNEL);//64
  601. public const int MAX_ALARMOUT_V30 = (MAX_ANALOG_ALARMOUT + MAX_IP_ALARMOUT);//96
  602. public const int MAX_ALARMIN_V30 = (MAX_ANALOG_ALARMIN + MAX_IP_ALARMIN);//160
  603. #endregion
  604. #endregion
  605. #region 1. ???
  606. #region 1.1 ???
  607. /// <summary>
  608. /// 1.1.1 ???SDK
  609. /// </summary>
  610. /// <returns>TRUE?????FALSE????</returns>
  611. [DllImport("HCNetSDK.dll")]
  612. public static extern bool NET_DVR_Init();
  613. /// <summary>
  614. /// 1.1.2 ??SDK??
  615. /// </summary>
  616. /// <returns>TRUE?????FALSE????</returns>
  617. [DllImport("HCNetSDK.dll")]
  618. public static extern bool NET_DVR_Cleanup();
  619. #region 1.1.3 NET_DVR_IsSupport
  620. /*************************************************
  621. NET_DVR_IsSupport()???
  622. 1?9?????????????TRUE)?????
  623. **************************************************/
  624. /// <summary>
  625. /// ??DIRECTDRAW????????????????
  626. /// </summary>
  627. public const int NET_DVR_SUPPORT_DDRAW = 0x01;//
  628. /// <summary>
  629. /// ????BLT??????????????????
  630. /// </summary>
  631. public const int NET_DVR_SUPPORT_BLT = 0x02;//
  632. /// <summary>
  633. /// ??BLT???????????????????????RGB???
  634. /// </summary>
  635. public const int NET_DVR_SUPPORT_BLTFOURCC = 0x04;//
  636. /// <summary>
  637. /// ??BLT??X?????????????????????
  638. /// </summary>
  639. public const int NET_DVR_SUPPORT_BLTSHRINKX = 0x08;//
  640. /// <summary>
  641. /// ??BLT??Y?????????????????????
  642. /// </summary>
  643. public const int NET_DVR_SUPPORT_BLTSHRINKY = 0x10;//
  644. /// <summary>
  645. /// ??BLT??X?????????????????????
  646. /// </summary>
  647. public const int NET_DVR_SUPPORT_BLTSTRETCHX = 0x20;//
  648. /// <summary>
  649. /// ??BLT??Y?????????????????????
  650. /// </summary>
  651. public const int NET_DVR_SUPPORT_BLTSTRETCHY = 0x40;//
  652. /// <summary>
  653. /// CPU??SSE???Intel Pentium3????SSE???
  654. /// </summary>
  655. public const int NET_DVR_SUPPORT_SSE = 0x80;//
  656. /// <summary>
  657. /// CPU??MMX????Intel Pentium3????SSE???
  658. /// </summary>
  659. public const int NET_DVR_SUPPORT_MMX = 0x100;//
  660. /// <summary>
  661. /// 1.1.3 ????????PC????????(?????)
  662. /// NET_DVR_API int __stdcall NET_DVR_IsSupport();
  663. /// </summary>
  664. /// <returns>
  665. /// 1?9?????????????TRUE??????
  666. /// #define NET_DVR_SUPPORT_DDRAW 0x01 ??DIRECTDRAW???????????????
  667. /// #define NET_DVR_SUPPORT_BLT 0x02 ????BLT?????????????????
  668. /// #define NET_DVR_SUPPORT_BLTFOURCC 0x04 ??BLT???????????????????????RGB??
  669. /// #define NET_DVR_SUPPORT_BLTSHRINKX 0x08 ??BLT??X????????????????????
  670. /// #define NET_DVR_SUPPORT_BLTSHRINKY 0x10 ??BLT??Y????????????????????
  671. /// #define NET_DVR_SUPPORT_BLTSTRETCHX 0x20 ??BLT??X????????????????????
  672. /// #define NET_DVR_SUPPORT_BLTSTRETCHY 0x40 ??BLT??Y????????????????????
  673. /// #define NET_DVR_SUPPORT_SSE 0x80 CPU??SSE???Intel Pentium3????SSE??
  674. /// #define NET_DVR_SUPPORT_MMX 0x100 CPU??MMX????Intel Pentium3????SSE??
  675. /// </returns>
  676. [DllImport("HCNetSDK.dll")]
  677. public static extern int NET_DVR_IsSupport();
  678. #endregion
  679. /// <summary>
  680. /// 1.1.4 ???????????????
  681. /// NET_DVR_API BOOL __stdcall NET_DVR_SetConnectTime(DWORD dwWaitTime = 5000, DWORD dwTryTimes = 3);
  682. /// </summary>
  683. /// <param name="dwWaitTime">[in]?????????? ??????>300?<60*1000?</param>
  684. /// <param name="dwTryTimes">[in]????????????</param>
  685. /// <returns></returns>
  686. [DllImport("HCNetSDK.dll")]
  687. public static extern bool NET_DVR_SetConnectTime(uint dwWaitTime, uint dwTryTimes);
  688. /// <summary>
  689. /// 1.1.5 ??IPServer??????IP??
  690. /// ??
  691. /// ?????????????????
  692. /// IPServer???????????????????
  693. /// NET_DVR_API BOOL __stdcall NET_DVR_GetDVRIPByResolveSvr(char *sServerIP, WORD wServerPort, BYTE *sDVRName,WORD wDVRNameLen,BYTE *sDVRSerialNumber,WORD wDVRSerialLen,char* sGetIP);
  694. /// </summary>
  695. /// <param name="sServerIP">[in]??????IP??</param>
  696. /// <param name="wServerPort">[in]?????????????????????IPServer?????7071</param>
  697. /// <param name="sDVRName">[in]????????NULL</param>
  698. /// <param name="wDVRNameLen">[in]???????</param>
  699. /// <param name="sDVRSerialNumber">[in]??????????NULL</param>
  700. /// <param name="wDVRSerialLen">[in]????????</param>
  701. /// <param name="sGetIP">[out]??????IP?????</param>
  702. /// <returns></returns>
  703. [DllImport("HCNetSDK.dll")]
  704. public static extern bool NET_DVR_GetDVRIPByResolveSvr(string sServerIP, ushort wServerPort, string sDVRName, ushort wDVRNameLen, string sDVRSerialNumber, ushort wDVRSerialLen, StringBuilder sGetIP);
  705. #endregion
  706. #region 1.2 ??????
  707. #region 1.2.1 ???????
  708. /// <summary>
  709. /// ???????
  710. /// </summary>
  711. public const int EXCEPTION_EXCHANGE = 0x8000;
  712. /// <summary>
  713. /// ??????
  714. /// </summary>
  715. public const int EXCEPTION_AUDIOEXCHANGE = 0x8001;
  716. /// <summary>
  717. /// ????
  718. /// </summary>
  719. public const int EXCEPTION_ALARM = 0x8002;
  720. /// <summary>
  721. /// ??????
  722. /// </summary>
  723. public const int EXCEPTION_PREVIEW = 0x8003;
  724. /// <summary>
  725. /// ??????
  726. /// </summary>
  727. public const int EXCEPTION_SERIAL = 0x8004;
  728. /// <summary>
  729. /// ?????
  730. /// </summary>
  731. public const int EXCEPTION_RECONNECT = 0x8005;
  732. /// <summary>
  733. /// ?????
  734. /// </summary>
  735. public const int EXCEPTION_ALARMRECONNECT = 0x8006;
  736. /// <summary>
  737. /// ??????
  738. /// </summary>
  739. public const int EXCEPTION_SERIALRECONNECT = 0x8007;
  740. /// <summary>
  741. /// ????
  742. /// </summary>
  743. public const int EXCEPTION_PLAYBACK = 0x8010;
  744. /// <summary>
  745. /// ?????
  746. /// </summary>
  747. public const int EXCEPTION_DISKFMT = 0x8011;
  748. #endregion
  749. /// <summary>
  750. /// ????????
  751. /// void (CALLBACK* fExceptionCallBack)(uint dwType, int lUserID, int lHandle, void *pUser)
  752. /// </summary>
  753. /// <param name="dwType">???????????</param>
  754. /// <param name="lUserID">??ID</param>
  755. /// <param name="lHandle">????????????</param>
  756. /// <param name="pUser">???????</param>
  757. public delegate void ExceptionCallBack(uint dwType, int lUserID, int lHandle, int pUser);
  758. /// <summary>
  759. /// 1.2.2 ??????????????????????
  760. /// NET_DVR_API BOOL __stdcall NET_DVR_SetExceptionCallBack_V30(UINT nMessage, HWND hWnd, void (CALLBACK* fExceptionCallBack)(DWORD dwType, LONG lUserID, LONG lHandle, void *pUser), void *pUser);
  761. /// </summary>
  762. /// <param name="nMessage">[in]???????WM_USER + 1</param>
  763. /// <param name="hWnd">[in]?????????</param>
  764. /// <param name="fExceptionCallBack">[in]????????</param>
  765. /// <param name="pUser">[in]????</param>
  766. /// <returns></returns>
  767. [DllImport("HCNetSDK.dll")]
  768. public static extern bool NET_DVR_SetExceptionCallBack_V30(uint nMessage, IntPtr hWnd, ExceptionCallBack fExceptionCallBack, IntPtr pUser);
  769. /// <summary>
  770. /// 1.2.3 ???????????????
  771. /// NET_DVR_API BOOL __stdcall NET_DVR_SetDVRMessage(UINT nMessage,HWND hWnd);
  772. /// </summary>
  773. /// <param name="nMessage">[in]??</param>
  774. /// <param name="hWnd">[in]?????????????</param>
  775. /// <returns></returns>
  776. [DllImport("HCNetSDK.dll")]
  777. public static extern bool NET_DVR_SetDVRMessage(uint nMessage, IntPtr hWnd);
  778. #endregion
  779. #endregion
  780. #region 2. ????
  781. #region 2.1 ????
  782. #region 2.1.1 ????
  783. /// <summary>
  784. /// 2.1.1 ????(????)
  785. /// NET_DVR_API LONG __stdcall NET_DVR_Login_V30(char *sDVRIP, WORD wDVRPort, char *sUserName, char *sPassword, LPNET_DVR_DEVICEINFO_V30 lpDeviceInfo);
  786. /// </summary>
  787. /// <param name="sDVRIP">[in]???IP??</param>
  788. /// <param name="wDVRPort">[in]??????</param>
  789. /// <param name="sUserName">[in]??????</param>
  790. /// <param name="sPassword">[in]????</param>
  791. /// <param name="lpDeviceInfo">[out]??NET_DVR_DEVICEINFO_V30??</param>
  792. /// <returns>?????ID?</returns>
  793. [DllImport("HCNetSDK.dll")]
  794. public static extern int NET_DVR_Login_V30(string sDVRIP, ushort wDVRPort, string sUserName, string sPassword, out NET_DVR_DEVICEINFO_V30 lpDeviceInfo);
  795. /// <summary>
  796. /// ????(????)
  797. /// NET_DVR_API LONG __stdcall NET_DVR_Login(char *sDVRIP,WORD wDVRPort,char *sUserName,char *sPassword,LPNET_DVR_DEVICEINFO lpDeviceInfo);
  798. /// </summary>
  799. /// <param name="sDVRIP">[in]???IP??</param>
  800. /// <param name="wDVRPort">[in]??????</param>
  801. /// <param name="sUserName">[in]??????</param>
  802. /// <param name="sPassword">[in]????</param>
  803. /// <param name="lpDeviceInfo">[out]??NET_DVR_DEVICEINFO??</param>
  804. /// <returns>-1???????????????ID???ID???SDK???????ID?????????</returns>
  805. [DllImport("HCNetSDK.dll")]
  806. public static extern int NET_DVR_Login(string sDVRIP, ushort wDVRPort, string sUserName, string sPassword, out NET_DVR_DEVICEINFO lpDeviceInfo);
  807. #endregion
  808. #region 2.1.2 ????
  809. /// <summary>
  810. /// 2.1.2 ????
  811. /// ??
  812. /// ????????????????????????ID??????????????????
  813. /// ??
  814. /// NET_DVR_Logout_V30?????????????????????????????
  815. /// ? NET_DVR_Logout????????????????????
  816. /// NET_DVR_API BOOL __stdcall NET_DVR_Logout_V30(LONG lUserID);
  817. /// </summary>
  818. /// <param name="lUserID">[in] NET_DVR_Login??NET_DVR_Login_V30????</param>
  819. /// <returns></returns>
  820. [DllImport("HCNetSDK.dll")]
  821. public static extern bool NET_DVR_Logout_V30(int lUserID);
  822. /// <summary>
  823. /// ????
  824. /// NET_DVR_API BOOL __stdcall NET_DVR_Logout(LONG lUserID);
  825. /// </summary>
  826. /// <param name="lUserID">[in]??ID???NET_DVR_Login??NET_DVR_Login_V30???ID?</param>
  827. /// <returns></returns>
  828. [DllImport("HCNetSDK.dll")]
  829. public static extern bool NET_DVR_Logout(int lUserID);
  830. #endregion
  831. #endregion
  832. #endregion
  833. #region 3. SDK??
  834. #region 3.1 SDK??
  835. /// <summary>
  836. /// 3.1.1 ??SDK???
  837. /// NET_DVR_API DWORD __stdcall NET_DVR_GetSDKVersion();
  838. /// </summary>
  839. /// <returns>2??????????2????????????0x00020001????2.1</returns>
  840. [DllImport("HCNetSDK.dll")]
  841. public static extern uint NET_DVR_GetSDKVersion();
  842. /// <summary>
  843. /// 3.1.2 ??SDK build?
  844. /// NET_DVR_API DWORD __stdcall NET_DVR_GetSDKBuildVersion();
  845. /// </summary>
  846. /// <returns></returns>
  847. [DllImport("HCNetSDK.dll")]
  848. public static extern uint NET_DVR_GetSDKBuildVersion();
  849. /// <summary>
  850. /// 3.1.3 ????SDK???
  851. /// NET_DVR_API BOOL __stdcall NET_DVR_GetSDKState(LPNET_DVR_SDKSTATE pSDKState);
  852. /// </summary>
  853. /// <param name="pSDKState">[out]??NET_DVR_SDKSTATE????</param>
  854. /// <returns></returns>
  855. [DllImport("HCNetSDK.dll")]
  856. public static extern bool NET_DVR_GetSDKState(out NET_DVR_SDKSTATE pSDKState);
  857. /// <summary>
  858. /// 3.1.4 ??SDK?????
  859. /// NET_DVR_API BOOL __stdcall NET_DVR_GetSDKAbility(LPNET_DVR_SDKABL pSDKAbl);
  860. /// </summary>
  861. /// <param name="pSDKAbl">[out]??NET_DVR_SDKABL????</param>
  862. /// <returns></returns>
  863. [DllImport("HCNetSDK.dll")]
  864. public static extern bool NET_DVR_GetSDKAbility(out NET_DVR_SDKABL pSDKAbl);
  865. /// <summary>
  866. /// 3.1.5 SDK?????????????
  867. /// NET_DVR_API BOOL __stdcall NET_DVR_SetLogToFile(BOOL bLogEnable = FALSE, char * strLogDir = NULL, BOOL bAutoDel = TRUE);
  868. /// ??
  869. /// ????????? ???????????????????
  870. /// ???????????????"\\"??, ??"C:\\SdkLog\\"
  871. /// ?????????????????????????
  872. /// ????strLogDir?NULL????????"C:\\SdkLog\\"
  873. /// ???????????????????????????????????????????????????????????????????
  874. /// ????SDK??????10????????bAutoDel?TRUE????????????
  875. /// </summary>
  876. /// <param name="bLogEnable">[in]????</param>
  877. /// <param name="strLogDir">[in]???????</param>
  878. /// <param name="bAutoDel">[in]??????????</param>
  879. /// <returns></returns>
  880. [DllImport("HCNetSDK.dll")]
  881. public static extern bool NET_DVR_SetLogToFile(bool bLogEnable, string strLogDir, bool bAutoDel);
  882. #endregion
  883. #endregion
  884. #region 4. ??????
  885. #region 4.1 ??????
  886. /// <summary>
  887. /// 4.1.1 ??????
  888. /// ?????[4.2.1 ????????]
  889. /// </summary>
  890. /// <returns></returns>
  891. [DllImport("HCNetSDK.dll")]
  892. public static extern uint NET_DVR_GetLastError();
  893. /// <summary>
  894. /// 4.1.2 ???????
  895. /// NET_DVR_API char* __stdcall NET_DVR_GetErrorMsg(LONG *pErrorNo = NULL);
  896. /// </summary>
  897. /// <param name="pErrorNo">[out]????????????????????????</param>
  898. /// <returns></returns>
  899. [DllImport("HCNetSDK.dll")]
  900. public static extern string NET_DVR_GetErrorMsg(out int pErrorNo);
  901. #endregion
  902. #region 4.2 ????
  903. #region 4.2.1 ????????
  904. public const int NET_DVR_FAIL = -1;
  905. /// <summary>
  906. /// ????
  907. /// </summary>
  908. public const int NET_DVR_NOERROR = 0;
  909. /// <summary>
  910. /// ???????
  911. /// </summary>
  912. public const int NET_DVR_PASSWORD_ERROR = 1;
  913. /// <summary>
  914. /// ????
  915. /// </summary>
  916. public const int NET_DVR_NOENOUGHPRI = 2;
  917. /// <summary>
  918. /// ?????
  919. /// </summary>
  920. public const int NET_DVR_NOINIT = 3;
  921. /// <summary>
  922. /// ?????
  923. /// </summary>
  924. public const int NET_DVR_CHANNEL_ERROR = 4;
  925. /// <summary>
  926. /// ???DVR??????????
  927. /// </summary>
  928. public const int NET_DVR_OVER_MAXLINK = 5;
  929. /// <summary>
  930. /// ?????
  931. /// </summary>
  932. public const int NET_DVR_VERSIONNOMATCH = 6;
  933. /// <summary>
  934. /// ???????
  935. /// </summary>
  936. public const int NET_DVR_NETWORK_FAIL_CONNECT = 7;
  937. /// <summary>
  938. /// ????????
  939. /// </summary>
  940. public const int NET_DVR_NETWORK_SEND_ERROR = 8;
  941. /// <summary>
  942. /// ??????????
  943. /// </summary>
  944. public const int NET_DVR_NETWORK_RECV_ERROR = 9;
  945. /// <summary>
  946. /// ??????????
  947. /// </summary>
  948. public const int NET_DVR_NETWORK_RECV_TIMEOUT = 10;
  949. /// <summary>
  950. /// ???????
  951. /// </summary>
  952. public const int NET_DVR_NETWORK_ERRORDATA = 11;
  953. /// <summary>
  954. /// ??????
  955. /// </summary>
  956. public const int NET_DVR_ORDER_ERROR = 12;
  957. /// <summary>
  958. /// ????
  959. /// </summary>
  960. public const int NET_DVR_OPERNOPERMIT = 13;
  961. /// <summary>
  962. /// DVR??????
  963. /// </summary>
  964. public const int NET_DVR_COMMANDTIMEOUT = 14;
  965. /// <summary>
  966. /// ?????
  967. /// </summary>
  968. public const int NET_DVR_ERRORSERIALPORT = 15;
  969. /// <summary>
  970. /// ??????
  971. /// </summary>
  972. public const int NET_DVR_ERRORALARMPORT = 16;
  973. /// <summary>
  974. /// ????
  975. /// </summary>
  976. public const int NET_DVR_PARAMETER_ERROR = 17;
  977. /// <summary>
  978. /// ???????????
  979. /// </summary>
  980. public const int NET_DVR_CHAN_EXCEPTION = 18;
  981. /// <summary>
  982. /// ????
  983. /// </summary>
  984. public const int NET_DVR_NODISK = 19;
  985. /// <summary>
  986. /// ?????
  987. /// </summary>
  988. public const int NET_DVR_ERRORDISKNUM = 20;
  989. /// <summary>
  990. /// ??????
  991. /// </summary>
  992. public const int NET_DVR_DISK_FULL = 21;
  993. /// <summary>
  994. /// ???????
  995. /// </summary>
  996. public const int NET_DVR_DISK_ERROR = 22;
  997. /// <summary>
  998. /// ??????
  999. /// </summary>
  1000. public const int NET_DVR_NOSUPPORT = 23;
  1001. /// <summary>
  1002. /// ????
  1003. /// </summary>
  1004. public const int NET_DVR_BUSY = 24;
  1005. /// <summary>
  1006. /// ????????
  1007. /// </summary>
  1008. public const int NET_DVR_MODIFY_FAIL = 25;
  1009. /// <summary>
  1010. /// ?????????
  1011. /// </summary>
  1012. public const int NET_DVR_PASSWORD_FORMAT_ERROR = 26;
  1013. /// <summary>
  1014. /// ??????????????
  1015. /// </summary>
  1016. public const int NET_DVR_DISK_FORMATING = 27;
  1017. /// <summary>
  1018. /// DVR????
  1019. /// </summary>
  1020. public const int NET_DVR_DVRNORESOURCE = 28;
  1021. /// <summary>
  1022. /// DVR????
  1023. /// </summary>
  1024. public const int NET_DVR_DVROPRATEFAILED = 29;
  1025. /// <summary>
  1026. /// ??PC????
  1027. /// </summary>
  1028. public const int NET_DVR_OPENHOSTSOUND_FAIL = 30;
  1029. /// <summary>
  1030. /// ??????????
  1031. /// </summary>
  1032. public const int NET_DVR_DVRVOICEOPENED = 31;
  1033. /// <summary>
  1034. /// ???????
  1035. /// </summary>
  1036. public const int NET_DVR_TIMEINPUTERROR = 32;
  1037. /// <summary>
  1038. /// ?????????????
  1039. /// </summary>
  1040. public const int NET_DVR_NOSPECFILE = 33;
  1041. /// <summary>
  1042. /// ??????
  1043. /// </summary>
  1044. public const int NET_DVR_CREATEFILE_ERROR = 34;
  1045. /// <summary>
  1046. /// ??????
  1047. /// </summary>
  1048. public const int NET_DVR_FILEOPENFAIL = 35;
  1049. /// <summary>
  1050. /// ??????????
  1051. /// </summary>
  1052. public const int NET_DVR_OPERNOTFINISH = 36;
  1053. /// <summary>
  1054. /// ???????????
  1055. /// </summary>
  1056. public const int NET_DVR_GETPLAYTIMEFAIL = 37;
  1057. /// <summary>
  1058. /// ????
  1059. /// </summary>
  1060. public const int NET_DVR_PLAYFAIL = 38;
  1061. /// <summary>
  1062. /// ???????
  1063. /// </summary>
  1064. public const int NET_DVR_FILEFORMAT_ERROR = 39;
  1065. /// <summary>
  1066. /// ????
  1067. /// </summary>
  1068. public const int NET_DVR_DIR_ERROR = 40;
  1069. /// <summary>
  1070. /// ??????
  1071. /// </summary>
  1072. public const int NET_DVR_ALLOC_RESOURCE_ERROR = 41;
  1073. /// <summary>
  1074. /// ??????
  1075. /// </summary>
  1076. public const int NET_DVR_AUDIO_MODE_ERROR = 42;
  1077. /// <summary>
  1078. /// ?????
  1079. /// </summary>
  1080. public const int NET_DVR_NOENOUGH_BUF = 43;
  1081. /// <summary>
  1082. /// ??SOCKET??
  1083. /// </summary>
  1084. public const int NET_DVR_CREATESOCKET_ERROR = 44;
  1085. /// <summary>
  1086. /// ??SOCKET??
  1087. /// </summary>
  1088. public const int NET_DVR_SETSOCKET_ERROR = 45;
  1089. /// <summary>
  1090. /// ??????
  1091. /// </summary>
  1092. public const int NET_DVR_MAX_NUM = 46;
  1093. /// <summary>
  1094. /// ?????
  1095. /// </summary>
  1096. public const int NET_DVR_USERNOTEXIST = 47;
  1097. /// <summary>
  1098. /// ?FLASH??
  1099. /// </summary>
  1100. public const int NET_DVR_WRITEFLASHERROR = 48;
  1101. /// <summary>
  1102. /// DVR????
  1103. /// </summary>
  1104. public const int NET_DVR_UPGRADEFAIL = 49;
  1105. /// <summary>
  1106. /// ?????????
  1107. /// </summary>
  1108. public const int NET_DVR_CARDHAVEINIT = 50;
  1109. /// <summary>
  1110. /// ????????????
  1111. /// </summary>
  1112. public const int NET_DVR_PLAYERFAILED = 51;
  1113. /// <summary>
  1114. /// ??????????
  1115. /// </summary>
  1116. public const int NET_DVR_MAX_USERNUM = 52;
  1117. /// <summary>
  1118. /// ??????IP?????????
  1119. /// </summary>
  1120. public const int NET_DVR_GETLOCALIPANDMACFAIL = 53;
  1121. /// <summary>
  1122. /// ???????
  1123. /// </summary>
  1124. public const int NET_DVR_NOENCODEING = 54;
  1125. /// <summary>
  1126. /// IP?????
  1127. /// </summary>
  1128. public const int NET_DVR_IPMISMATCH = 55;
  1129. /// <summary>
  1130. /// MAC?????
  1131. /// </summary>
  1132. public const int NET_DVR_MACMISMATCH = 56;
  1133. /// <summary>
  1134. /// ?????????
  1135. /// </summary>
  1136. public const int NET_DVR_UPGRADELANGMISMATCH = 57;
  1137. /// <summary>
  1138. /// ?????????
  1139. /// </summary>
  1140. public const int NET_DVR_MAX_PLAYERPORT = 58;
  1141. /// <summary>
  1142. /// ???????????????
  1143. /// </summary>
  1144. public const int NET_DVR_NOSPACEBACKUP = 59;
  1145. /// <summary>
  1146. /// ???????????
  1147. /// </summary>
  1148. public const int NET_DVR_NODEVICEBACKUP = 60;
  1149. /// <summary>
  1150. /// ?????????24?
  1151. /// </summary>
  1152. public const int NET_DVR_PICTURE_BITS_ERROR = 61;
  1153. /// <summary>
  1154. /// ???*???? ?128*256
  1155. /// </summary>
  1156. public const int NET_DVR_PICTURE_DIMENSION_ERROR = 62;
  1157. /// <summary>
  1158. /// ????????100K
  1159. /// </summary>
  1160. public const int NET_DVR_PICTURE_SIZ_ERROR = 63;
  1161. /// <summary>
  1162. /// ???????Player Sdk??
  1163. /// </summary>
  1164. public const int NET_DVR_LOADPLAYERSDKFAILED = 64;
  1165. /// <summary>
  1166. /// ???Player Sdk???????
  1167. /// </summary>
  1168. public const int NET_DVR_LOADPLAYERSDKPROC_ERROR = 65;
  1169. /// <summary>
  1170. /// ???????DSsdk??
  1171. /// </summary>
  1172. public const int NET_DVR_LOADDSSDKFAILED = 66;
  1173. /// <summary>
  1174. /// ???DsSdk???????
  1175. /// </summary>
  1176. public const int NET_DVR_LOADDSSDKPROC_ERROR = 67;
  1177. /// <summary>
  1178. /// ??????DsSdk???????
  1179. /// </summary>
  1180. public const int NET_DVR_DSSDK_ERROR = 68;
  1181. /// <summary>
  1182. /// ?????
  1183. /// </summary>
  1184. public const int NET_DVR_VOICEMONOPOLIZE = 69;
  1185. /// <summary>
  1186. /// ???????
  1187. /// </summary>
  1188. public const int NET_DVR_JOINMULTICASTFAILED = 70;
  1189. /// <summary>
  1190. /// ??????????
  1191. /// </summary>
  1192. public const int NET_DVR_CREATEDIR_ERROR = 71;
  1193. /// <summary>
  1194. /// ???????
  1195. /// </summary>
  1196. public const int NET_DVR_BINDSOCKET_ERROR = 72;
  1197. /// <summary>
  1198. /// socket????????????????????????
  1199. /// </summary>
  1200. public const int NET_DVR_SOCKETCLOSE_ERROR = 73;
  1201. /// <summary>
  1202. /// ?????ID???????
  1203. /// </summary>
  1204. public const int NET_DVR_USERID_ISUSING = 74;
  1205. /// <summary>
  1206. /// ????
  1207. /// </summary>
  1208. public const int NET_DVR_SOCKETLISTEN_ERROR = 75;
  1209. /// <summary>
  1210. /// ????
  1211. /// </summary>
  1212. public const int NET_DVR_PROGRAM_EXCEPTION = 76;
  1213. /// <summary>
  1214. /// ?????
  1215. /// </summary>
  1216. public const int NET_DVR_WRITEFILE_FAILED = 77;
  1217. /// <summary>
  1218. /// ?????????
  1219. /// </summary>
  1220. public const int NET_DVR_FORMAT_READONLY = 78;
  1221. /// <summary>
  1222. /// ???????????????
  1223. /// </summary>
  1224. public const int NET_DVR_WITHSAMEUSERNAME = 79;
  1225. /// <summary>
  1226. /// ????????????
  1227. /// </summary>
  1228. public const int NET_DVR_DEVICETYPE_ERROR = 80;
  1229. /// <summary>
  1230. /// ??????????
  1231. /// </summary>
  1232. public const int NET_DVR_LANGUAGE_ERROR = 81;
  1233. /// <summary>
  1234. /// ????????????
  1235. /// </summary>
  1236. public const int NET_DVR_PARAVERSION_ERROR = 82;
  1237. /// <summary>
  1238. /// ?????IP?????
  1239. /// </summary>
  1240. public const int NET_DVR_IPCHAN_NOTALIVE = 83;
  1241. /// <summary>
  1242. /// ????IPC???StreamTransClient??
  1243. /// </summary>
  1244. public const int NET_DVR_RTSP_SDK_ERROR = 84;
  1245. /// <summary>
  1246. /// ?????CVT_StdToHik??
  1247. /// </summary>
  1248. public const int NET_DVR_CONVERT_SDK_ERROR = 85;
  1249. /// <summary>
  1250. /// ?????ip?????
  1251. /// </summary>
  1252. public const int NET_DVR_IPC_COUNT_OVERFLOW = 86;
  1253. #endregion
  1254. #region 4.2.1 ???????
  1255. /// <summary>
  1256. /// no error.
  1257. /// </summary>
  1258. public const int NET_PLAYM4_NOERROR = 500;
  1259. /// <summary>
  1260. /// input parameter is invalid.
  1261. /// </summary>
  1262. public const int NET_PLAYM4_PARA_OVER = 501;
  1263. /// <summary>
  1264. /// The order of the function to be called is error.
  1265. /// </summary>
  1266. public const int NET_PLAYM4_ORDER_ERROR = 502;
  1267. /// <summary>
  1268. /// Create multimedia clock failed.
  1269. /// </summary>
  1270. public const int NET_PLAYM4_TIMER_ERROR = 503;
  1271. /// <summary>
  1272. /// Decode video data failed.
  1273. /// </summary>
  1274. public const int NET_PLAYM4_DEC_VIDEO_ERROR = 504;
  1275. /// <summary>
  1276. /// Decode audio data failed.
  1277. /// </summary>
  1278. public const int NET_PLAYM4_DEC_AUDIO_ERROR = 505;
  1279. /// <summary>
  1280. /// Allocate memory failed.
  1281. /// </summary>
  1282. public const int NET_PLAYM4_ALLOC_MEMORY_ERROR = 506;
  1283. /// <summary>
  1284. /// Open the file failed.
  1285. /// </summary>
  1286. public const int NET_PLAYM4_OPEN_FILE_ERROR = 507;
  1287. /// <summary>
  1288. /// Create thread or event failed.
  1289. /// </summary>
  1290. public const int NET_PLAYM4_CREATE_OBJ_ERROR = 508;
  1291. /// <summary>
  1292. /// Create DirectDraw object failed.
  1293. /// </summary>
  1294. public const int NET_PLAYM4_CREATE_DDRAW_ERROR = 509;
  1295. /// <summary>
  1296. /// failed when creating off-screen surface.
  1297. /// </summary>
  1298. public const int NET_PLAYM4_CREATE_OFFSCREEN_ERROR = 510;
  1299. /// <summary>
  1300. /// buffer is overflow.
  1301. /// </summary>
  1302. public const int NET_PLAYM4_BUF_OVER = 511;
  1303. /// <summary>
  1304. /// failed when creating audio device.
  1305. /// </summary>
  1306. public const int NET_PLAYM4_CREATE_SOUND_ERROR = 512;
  1307. /// <summary>
  1308. /// Set volume failed.
  1309. /// </summary>
  1310. public const int NET_PLAYM4_SET_VOLUME_ERROR = 513;
  1311. /// <summary>
  1312. /// The function only support play file.
  1313. /// </summary>
  1314. public const int NET_PLAYM4_SUPPORT_FILE_ONLY = 514;
  1315. /// <summary>
  1316. /// The function only support play stream.
  1317. /// </summary>
  1318. public const int NET_PLAYM4_SUPPORT_STREAM_ONLY = 515;
  1319. /// <summary>
  1320. /// System not support.
  1321. /// </summary>
  1322. public const int NET_PLAYM4_SYS_NOT_SUPPORT = 516;
  1323. /// <summary>
  1324. /// No file header.
  1325. /// </summary>
  1326. public const int NET_PLAYM4_FILEHEADER_UNKNOWN = 517;
  1327. /// <summary>
  1328. /// The version of decoder and encoder is not adapted.
  1329. /// </summary>
  1330. public const int NET_PLAYM4_VERSION_INCORRECT = 518;
  1331. /// <summary>
  1332. /// Initialize decoder failed.
  1333. /// </summary>
  1334. public const int NET_PALYM4_INIT_DECODER_ERROR = 519;
  1335. /// <summary>
  1336. /// The file data is unknown.
  1337. /// </summary>
  1338. public const int NET_PLAYM4_CHECK_FILE_ERROR = 520;
  1339. /// <summary>
  1340. /// Initialize multimedia clock failed.
  1341. /// </summary>
  1342. public const int NET_PLAYM4_INIT_TIMER_ERROR = 521;
  1343. /// <summary>
  1344. /// Blt failed.
  1345. /// </summary>
  1346. public const int NET_PLAYM4_BLT_ERROR = 522;
  1347. /// <summary>
  1348. /// Update failed.
  1349. /// </summary>
  1350. public const int NET_PLAYM4_UPDATE_ERROR = 523;
  1351. /// <summary>
  1352. /// openfile error, streamtype is multi.
  1353. /// </summary>
  1354. public const int NET_PLAYM4_OPEN_FILE_ERROR_MULTI = 524;
  1355. /// <summary>
  1356. /// openfile error, streamtype is video.
  1357. /// </summary>
  1358. public const int NET_PLAYM4_OPEN_FILE_ERROR_VIDEO = 525;
  1359. /// <summary>
  1360. /// JPEG compress error
  1361. /// </summary>
  1362. public const int NET_PLAYM4_JPEG_COMPRESS_ERROR = 526;
  1363. /// <summary>
  1364. /// Don't support the version of this file.
  1365. /// </summary>
  1366. public const int NET_PLAYM4_EXTRACT_NOT_SUPPORT = 527;
  1367. /// <summary>
  1368. /// extract video data failed.
  1369. /// </summary>
  1370. public const int NET_PLAYM4_EXTRACT_DATA_ERROR = 528;
  1371. #endregion
  1372. #endregion
  1373. #endregion
  1374. #region 5. ?????
  1375. #region 5.1 ?????
  1376. /// <summary>
  1377. /// ????
  1378. /// </summary>
  1379. public enum DISPLAY_MODE : uint
  1380. {
  1381. /// <summary>
  1382. /// ?????????????????????
  1383. /// </summary>
  1384. NORMALMODE = 0,
  1385. /// <summary>
  1386. /// ??????????????????????
  1387. /// </summary>
  1388. OVERLAYMODE
  1389. }
  1390. /// <summary>
  1391. /// 5.1.1 ????????
  1392. /// ??
  1393. /// ??????????????????????????????????????????????????????????????????????????
  1394. /// ????????????colorKey???32???0x00rrggbb??????0??????????r?g?b???
  1395. /// ???????????????????????????????????OVERLAY?????OVERLAY???????????????OVERLAY???????BLT?????????????(?SIS????)??OVERLAY?????????CPU??????????(??????????????)????????????????????????????
  1396. /// ???????????????OVERLAY????????????????????????OVERLAY????????????OVERLAY???????????????????FALSE????????????????????????OVERLAY???????????SDK????OVERALY????????????????OVERLAY???
  1397. /// NET_DVR_API BOOL __stdcall NET_DVR_SetShowMode(DWORD dwShowType,COLORREF colorKey);
  1398. /// </summary>
  1399. /// <param name="dwShowType">[in]???????????????{NORMALMODE = 0,OVERLAYMODE}</param>
  1400. /// <param name="colorKey">[in]??????????OVERLAY???????</param>
  1401. /// <returns></returns>
  1402. [DllImport("HCNetSDK.dll")]
  1403. public static extern bool NET_DVR_SetShowMode(DISPLAY_MODE dwShowType, int colorKey);
  1404. #region ???????
  1405. /// <summary>
  1406. /// ?????
  1407. /// </summary>
  1408. public const int NET_DVR_SYSHEAD = 1;
  1409. /// <summary>
  1410. /// ????????????????????????
  1411. /// </summary>
  1412. public const int NET_DVR_STREAMDATA = 2;
  1413. /// <summary>
  1414. /// ?????
  1415. /// </summary>
  1416. public const int NET_DVR_AUDIOSTREAMDATA = 3;
  1417. /// <summary>
  1418. /// void(CALLBACK *fRealDataCallBack_V30) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, void* pUser)
  1419. /// </summary>
  1420. /// <param name="lRealHandle">NET_DVR_RealPlay_V30???</param>
  1421. /// <param name="dwDat…

Large files files are truncated, but you can click here to view the full file