My Project
 All Classes
MWProCapture.h
1 /************************************************************************************************/
2 // MWProCapture.h : header file
3 
4 // MAGEWELL PROPRIETARY INFORMATION
5 
6 // The following license only applies to head files and library within Magewell's SDK
7 // and not to Magewell's SDK as a whole.
8 
9 // Copyrights © Nanjing Magewell Electronics Co., Ltd. ("Magewell") All rights reserved.
10 
11 // Magewell grands to any person who obtains the copy of Magewell's head files and library
12 // the rights,including without limitation, to use on the condition that the following terms are met:
13 // - The above copyright notice shall be retained in any circumstances.
14 // -The following disclaimer shall be included in the software and documentation and/or
15 // other materials provided for the purpose of publish, distribution or sublicense.
16 
17 // THE SOFTWARE IS PROVIDED BY MAGEWELL "AS IS" AND ANY EXPRESS, INCLUDING BUT NOT LIMITED TO,
18 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 // IN NO EVENT SHALL MAGEWELL BE LIABLE
20 
21 // FOR ANY CLAIM, DIRECT OR INDIRECT DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT,
22 // TORT OR OTHERWISE, ARISING IN ANY WAY OF USING THE SOFTWARE.
23 
24 // CONTACT INFORMATION:
25 // SDK@magewell.net
26 // http://www.magewell.com/
27 //
28 /************************************************************************************************/
29 #pragma once
30 
31 #ifdef LIBMWCAPTURE_EXPORTS
32 #define LIBMWCAPTURE_API __declspec(dllexport)
33 #elif LIBMWCAPTURE_DLL
34 #define LIBMWCAPTURE_API __declspec(dllimport)
35 #else
36 #define LIBMWCAPTURE_API
37 #endif
38 
39 #include "MWCaptureExtension.h"
40 #include "MWUSBCaptureExtension.h"
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
54 // Channel
55 HCHANNEL
56 LIBMWCAPTURE_API
57 MWOpenChannel(
58  int nBoardValue,
59  int nChannelIndex
60  );
61 
62 // Device Clock
69 MW_RESULT
70 LIBMWCAPTURE_API
71 MWGetDeviceTime(
72  HCHANNEL hChannel,
73  LONGLONG* pllTime
74  );
75 
82 MW_RESULT
83 LIBMWCAPTURE_API
84 MWSetDeviceTime(
85  HCHANNEL hChannel,
86  LONGLONG llTime
87  );
88 
95 MW_RESULT
96 LIBMWCAPTURE_API
97 MWRegulateDeviceTime(
98  HCHANNEL hChannel,
99  LONGLONG llTime
100  );
101 
102 // Timer Event
109 HTIMER
110 LIBMWCAPTURE_API
111 MWRegisterTimer(
112  HCHANNEL hChannel,
113  MWHANDLE hEvent
114  );
115 
122 MW_RESULT
123 LIBMWCAPTURE_API
124 MWUnregisterTimer(
125  HCHANNEL hChannel,
126  HTIMER hTimer
127  );
128 
136 MW_RESULT
137 LIBMWCAPTURE_API
138 MWScheduleTimer(
139  HCHANNEL hChannel,
140  HTIMER hTimer,
141  LONGLONG llExpireTime
142  );
143 
144 // Notify Event
152 HNOTIFY
153 LIBMWCAPTURE_API
154 MWRegisterNotify(
155  HCHANNEL hChannel,
156  MWHANDLE hEvent,
157  DWORD dwEnableBits
158  );
159 
166 MW_RESULT
167  LIBMWCAPTURE_API
168  MWUnregisterNotify(
169  HCHANNEL hChannel,
170  HNOTIFY hNotify
171  );
172 
180 MW_RESULT
181 LIBMWCAPTURE_API
182 MWGetNotifyStatus(
183  HCHANNEL hChannel,
184  HNOTIFY hNotify,
185  ULONGLONG* pullStatus
186  );
187 
188 // Video Capture
195 MW_RESULT
196 LIBMWCAPTURE_API
197 MWStartVideoCapture(
198  HCHANNEL hChannel,
199  MWHANDLE hEvent
200  );
201 
207 MW_RESULT
208 LIBMWCAPTURE_API
209 MWStopVideoCapture(
210  HCHANNEL hChannel
211  );
212 
220 MW_RESULT
221 LIBMWCAPTURE_API
222 MWPinVideoBuffer(
223  HCHANNEL hChannel,
224  MWCAP_PTR pbFrame,
225  DWORD cbFrame
226  );
227 
234 MW_RESULT
235 LIBMWCAPTURE_API
236 MWUnpinVideoBuffer(
237  HCHANNEL hChannel,
238  LPBYTE pbFrame
239  );
240 
255 MW_RESULT
256 LIBMWCAPTURE_API
257 MWCaptureVideoFrameToVirtualAddress(
258  HCHANNEL hChannel,
259  int iFrame,
260  MWCAP_PTR pbFrame,
261  DWORD cbFrame,
262  DWORD cbStride,
263  BOOLEAN bBottomUp,
264  MWCAP_PTR64 pvContext,
265  DWORD dwFOURCC,
266  int cx,
267  int cy
268  );
269 
275 MW_RESULT
276 LIBMWCAPTURE_API
277 MWCaptureVideoFrameToPhysicalAddress(
278  HCHANNEL hChannel,
279  int iFrame,
280  LARGE_INTEGER llFrameAddress,
281  DWORD cbFrame,
282  DWORD cbStride,
283  BOOLEAN bBottomUp,
284  MWCAP_PTR64 pvContext,
285  DWORD dwFOURCC,
286  int cx,
287  int cy
288  );
289 
298 MW_RESULT
299 LIBMWCAPTURE_API
300 MWCaptureVideoFrameWithOSDToVirtualAddress(
301  HCHANNEL hChannel,
302  int iFrame,
303  MWCAP_PTR pbFrame,
304  DWORD cbFrame,
305  DWORD cbStride,
306  BOOLEAN bBottomUp,
307  MWCAP_PTR64 pvContext,
308  DWORD dwFOURCC,
309  int cx,
310  int cy,
311  HOSD hOSDImage,
312  const RECT * pOSDRects,
313  int cOSDRects
314  );
315 
321 MW_RESULT
322 LIBMWCAPTURE_API
323 MWCaptureVideoFrameWithOSDToPhysicalAddress(
324  HCHANNEL hChannel,
325  int iFrame,
326  LARGE_INTEGER llFrameAddress,
327  DWORD cbFrame,
328  DWORD cbStride,
329  BOOLEAN bBottomUp,
330  MWCAP_PTR64 pvContext,
331  DWORD dwFOURCC,
332  int cx,
333  int cy,
334  HOSD hOSDImage,
335  const RECT * pOSDRects,
336  int cOSDRects
337  );
338 
362 MW_RESULT
363 LIBMWCAPTURE_API
364 MWCaptureVideoFrameToVirtualAddressEx(
365  HCHANNEL hChannel,
366  int iFrame,
367  LPBYTE pbFrame,
368  DWORD cbFrame,
369  DWORD cbStride,
370  BOOLEAN bBottomUp,
371  MWCAP_PTR64 pvContext,
372  DWORD dwFOURCC,
373  int cx,
374  int cy,
375  DWORD dwProcessSwitchs,
376  int cyParitalNotify,
377  HOSD hOSDImage,
378  const RECT * pOSDRects,
379  int cOSDRects,
380  SHORT sContrast,
381  SHORT sBrightness,
382  SHORT sSaturation,
383  SHORT sHue,
384  MWCAP_VIDEO_DEINTERLACE_MODE deinterlaceMode,
385  MWCAP_VIDEO_ASPECT_RATIO_CONVERT_MODE aspectRatioConvertMode,
386  const RECT * pRectSrc,
387  const RECT * pRectDest,
388  int nAspectX,
389  int nAspectY,
390  MWCAP_VIDEO_COLOR_FORMAT colorFormat,
391  MWCAP_VIDEO_QUANTIZATION_RANGE quantRange,
392  MWCAP_VIDEO_SATURATION_RANGE satRange
393  );
394 
400 MW_RESULT
401 LIBMWCAPTURE_API
402 MWCaptureVideoFrameToPhysicalAddressEx(
403  HCHANNEL hChannel,
404  int iFrame,
405  LARGE_INTEGER llFrameAddress,
406  DWORD cbFrame,
407  DWORD cbStride,
408  BOOLEAN bBottomUp,
409  MWCAP_PTR64 pvContext,
410  DWORD dwFOURCC,
411  int cx,
412  int cy,
413  DWORD dwProcessSwitchs,
414  int cyParitalNotify,
415  HOSD hOSDImage,
416  const RECT * pOSDRects,
417  int cOSDRects,
418  SHORT sContrast,
419  SHORT sBrightness,
420  SHORT sSaturation,
421  SHORT sHue,
422  MWCAP_VIDEO_DEINTERLACE_MODE deinterlaceMode,
423  MWCAP_VIDEO_ASPECT_RATIO_CONVERT_MODE aspectRatioConvertMode,
424  const RECT * pRectSrc,
425  const RECT * pRectDest,
426  int nAspectX,
427  int nAspectY,
428  MWCAP_VIDEO_COLOR_FORMAT colorFormat,
429  MWCAP_VIDEO_QUANTIZATION_RANGE quantRange,
430  MWCAP_VIDEO_SATURATION_RANGE satRange
431  );
432 
439 MW_RESULT
440 LIBMWCAPTURE_API
441 MWGetVideoBufferInfo(
442  HCHANNEL hChannel,
443  MWCAP_VIDEO_BUFFER_INFO * pVideoBufferInfo
444  );
445 
453 MW_RESULT
454 LIBMWCAPTURE_API
455 MWGetVideoFrameInfo(
456  HCHANNEL hChannel,
457  BYTE i,
458  MWCAP_VIDEO_FRAME_INFO* pVideoFrameInfo
459  );
460 
467 MW_RESULT
468 LIBMWCAPTURE_API
469 MWGetVideoCaptureStatus(
470  HCHANNEL hChannel,
472  );
473 
474 // Audio Capture
480 MW_RESULT
481 LIBMWCAPTURE_API
482 MWStartAudioCapture(
483  HCHANNEL hChannel
484  );
485 
491 MW_RESULT
492 LIBMWCAPTURE_API
493 MWStopAudioCapture(
494  HCHANNEL hChannel
495  );
496 
503 MW_RESULT
504 LIBMWCAPTURE_API
505 MWCaptureAudioFrame(
506  HCHANNEL hChannel,
507  MWCAP_AUDIO_CAPTURE_FRAME* pAudioCaptureFrame
508  );
509 
516 MW_RESULT
517 LIBMWCAPTURE_API
518 MWSetPostReconfig(
519  HCHANNEL hChannel,
520  DWORD dwDelayMS
521  );
522 
523 // OSD
531 HOSD
532 LIBMWCAPTURE_API
533 MWCreateImage(
534  HCHANNEL hChannel,
535  int cx,
536  int cy
537  );
538 
546 MW_RESULT
547 LIBMWCAPTURE_API
548 MWOpenImage(
549  HCHANNEL hChannel,
550  HOSD hImage,
551  LONG* plRet
552  );
553 
561 MW_RESULT
562 LIBMWCAPTURE_API
563 MWCloseImage(
564  HCHANNEL hChannel,
565  HOSD hImage,
566  LONG* plRet
567  );
568 
590 MW_RESULT
591 LIBMWCAPTURE_API
592 MWUploadImageFromVirtualAddress(
593  HCHANNEL hChannel,
594  HOSD hImage,
595  MWCAP_VIDEO_COLOR_FORMAT cfDest,
596  MWCAP_VIDEO_QUANTIZATION_RANGE quantRangeDest,
597  MWCAP_VIDEO_SATURATION_RANGE satRangeDest,
598  WORD xDest,
599  WORD yDest,
600  WORD cxDest,
601  WORD cyDest,
602  MWCAP_PTR64 pvSrcFrame,
603  DWORD cbSrcFrame,
604  DWORD cbSrcStride,
605  WORD cxSrc,
606  WORD cySrc,
607  BOOLEAN bSrcBottomUp,
608  BOOLEAN bSrcPixelAlpha,
609  BOOLEAN bSrcPixelXBGR
610  );
611 
617 MW_RESULT
618 LIBMWCAPTURE_API
619 MWUploadImageFromPhysicalAddress(
620  HCHANNEL hChannel,
621  HOSD hImage,
622  MWCAP_VIDEO_COLOR_FORMAT cfDest,
623  MWCAP_VIDEO_QUANTIZATION_RANGE quantRangeDest,
624  MWCAP_VIDEO_SATURATION_RANGE satRangeDest,
625  WORD xDest,
626  WORD yDest,
627  WORD cxDest,
628  WORD cyDest,
629  LARGE_INTEGER llSrcFrameAddress,
630  DWORD cbSrcFrame,
631  DWORD cbSrcStride,
632  WORD cxSrc,
633  WORD cySrc,
634  BOOLEAN bSrcBottomUp,
635  BOOLEAN bSrcPixelAlpha,
636  BOOLEAN bSrcPixelXBGR
637  );
638 
645 MW_RESULT
646 LIBMWCAPTURE_API
647 MWGetTemperature(
648  HCHANNEL hChannel,
649  unsigned int* pnTemp
650  );
651 
652 //linux
653 // V4l2
660 MW_RESULT
661 LIBMWCAPTURE_API
662 MWGetStreamCount(
663  HCHANNEL hChannel,
664  int * pnCount
665  );
666 
674 MW_RESULT
675 LIBMWCAPTURE_API
676 MWGetStreamInfos(
677  HCHANNEL hChannel,
678  MWCAP_STREAM_INFO * pStreamInfos,
679  int * pnCount
680  );
681 
688 MW_RESULT
689 LIBMWCAPTURE_API
690 MWSetCtrlStreamID(
691  HCHANNEL hChannel,
692  int nCrtlID
693  );
694 
701 MW_RESULT
702 LIBMWCAPTURE_API
703 MWGetVideoConnectFormat(
704  HCHANNEL hChannel,
705  MWCAP_VIDEO_CONNECTION_FORMAT * pConnectFormat
706  );
707 
714 MW_RESULT
715 LIBMWCAPTURE_API
716 MWGetVideoProcessSettings(
717  HCHANNEL hChannel,
718  MWCAP_VIDEO_PROCESS_SETTINGS * pProcessSettings
719  );
720 
727 MW_RESULT
728 LIBMWCAPTURE_API
729 MWSetVideoProcessSettings(
730  HCHANNEL hChannel,
731  MWCAP_VIDEO_PROCESS_SETTINGS processSettings
732  );
733 
740 MW_RESULT
741 LIBMWCAPTURE_API
742 MWGetVideoOSDSettings(
743  HCHANNEL hChannel,
744  MWCAP_VIDEO_OSD_SETTINGS * pOSDSettings
745  );
746 
753 MW_RESULT
754 LIBMWCAPTURE_API
755 MWSetVideoOSDSettings(
756  HCHANNEL hChannel,
757  MWCAP_VIDEO_OSD_SETTINGS OSDSettings
758  );
759 
766 MW_RESULT
767 LIBMWCAPTURE_API
768 MWGetVideoOSDImage(
769  HCHANNEL hChannel,
770  MWCAP_VIDEO_OSD_IMAGE * pOSDImage
771  );
772 
779 MW_RESULT
780 LIBMWCAPTURE_API
781 MWSetVideoOSDImage(
782  HCHANNEL hChannel,
783  MWCAP_VIDEO_OSD_IMAGE OSDImage
784  );
785 
792 MW_RESULT
793 LIBMWCAPTURE_API
794 MWGetVideoBrightness(
795  HCHANNEL hChannel,
796  int *pnBrightness
797  );
798 
805 MW_RESULT
806 LIBMWCAPTURE_API
807 MWSetVideoBrightness(
808  HCHANNEL hChannel,
809  int nBrightness
810  );
811 
818 MW_RESULT
819 LIBMWCAPTURE_API
820 MWGetVideoContrast(
821  HCHANNEL hChannel,
822  int * pnContrast
823  );
824 
831 MW_RESULT
832 LIBMWCAPTURE_API
833 MWSetVideoContrast(
834  HCHANNEL hChannel,
835  int nContrast
836  );
837 
844 MW_RESULT
845 LIBMWCAPTURE_API
846 MWGetVideoHue(
847  HCHANNEL hChannel,
848  int * pnHue
849  );
850 
857 MW_RESULT
858 LIBMWCAPTURE_API
859 MWSetVideoHue(
860  HCHANNEL hChannel,
861  int nHue
862  );
863 
870 MW_RESULT
871 LIBMWCAPTURE_API
872 MWGetVideoSaturation(
873  HCHANNEL hChannel,
874  int * pnSaturation
875  );
876 
883 MW_RESULT
884 LIBMWCAPTURE_API
885 MWSetVideoSaturation(
886  HCHANNEL hChannel,
887  int nSaturation
888  );
889 
895 MW_RESULT
896 LIBMWCAPTURE_API
897 MWSaveSettingsAsPreset(
898  HCHANNEL hChannel
899  );
900 
906 MW_RESULT
907 LIBMWCAPTURE_API
908 MWReloadPreset(
909  HCHANNEL hChannel
910  );
911 
912 // VGA/Component timings
919 MW_RESULT
920 LIBMWCAPTURE_API
921 MWGetVideoAutoHAlign(
922  HCHANNEL hChannel,
923  BOOLEAN * pbAuto
924  );
925 
932 MW_RESULT
933 LIBMWCAPTURE_API
934 MWSetVideoAutoHAlign(
935  HCHANNEL hChannel,
936  BOOLEAN bAuto
937  );
938 
945 MW_RESULT
946 LIBMWCAPTURE_API
947 MWGetVideoSamplingPhase(
948  HCHANNEL hChannel,
949  BYTE * pbyValue
950  );
951 
958 MW_RESULT
959 LIBMWCAPTURE_API
960 MWSetVideoSamplingPhase(
961  HCHANNEL hChannel,
962  BYTE byValue
963  );
964 
971 MW_RESULT
972 LIBMWCAPTURE_API
973 MWGetVideoSamplingPhaseAutoAdjust(
974  HCHANNEL hChannel,
975  BOOLEAN * pbAuto
976  );
977 
984 MW_RESULT
985 LIBMWCAPTURE_API
986 MWSetVideoSamplingPhaseAutoAdjust(
987  HCHANNEL hChannel,
988  BOOLEAN bAuto
989  );
990 
997 MW_RESULT
998 LIBMWCAPTURE_API
999 MWSetVideoTiming(
1000  HCHANNEL hChannel,
1001  MWCAP_VIDEO_TIMING videoTiming
1002  );
1003 
1011 MW_RESULT
1012 LIBMWCAPTURE_API
1013 MWGetVideoPreferredTimingArray(
1014  HCHANNEL hChannel,
1015  MWCAP_VIDEO_TIMING * pVideoTiming,
1016  long * plCount
1017  );
1018 
1025 MW_RESULT
1026 LIBMWCAPTURE_API
1027 MWSetCustomVideoTiming(
1028  HCHANNEL hChannel,
1029  MWCAP_VIDEO_CUSTOM_TIMING videoTiming
1030  );
1031 
1038 MW_RESULT
1039 LIBMWCAPTURE_API
1040 MWGetCustomVideoTimingsCount(
1041  HCHANNEL hChannel,
1042  DWORD * pdwCount
1043  );
1044 
1052 MW_RESULT
1053 LIBMWCAPTURE_API
1054 MWGetCustomVideoTimingsArray(
1055  HCHANNEL hChannel,
1056  MWCAP_VIDEO_CUSTOM_TIMING * pVideoCustomTiming,
1057  DWORD * pdwCount
1058  );
1059 
1067 MW_RESULT
1068 LIBMWCAPTURE_API
1069 MWSetCustomVideoTimingsArray(
1070  HCHANNEL hChannel,
1071  MWCAP_VIDEO_CUSTOM_TIMING * pVideoCustomTiming,
1072  DWORD dwCount
1073  );
1074 
1081 MW_RESULT
1082 LIBMWCAPTURE_API
1083 MWGetCustomVideoResolutionsCount(
1084  HCHANNEL hChannel,
1085  DWORD * pdwCount
1086  );
1087 
1095 MW_RESULT
1096 LIBMWCAPTURE_API
1097 MWGetCustomVideoResolutionsArray(
1098  HCHANNEL hChannel,
1099  MWCAP_SIZE * pResolutionSize,
1100  DWORD * pdwCount
1101  );
1102 
1110 MW_RESULT
1111 LIBMWCAPTURE_API
1112 MWSetCustomVideoResolutionsArray(
1113  HCHANNEL hChannel,
1114  MWCAP_SIZE * pResolutionSize,
1115  DWORD dwCount
1116  );
1117 
1118 // Event
1123 MWCAP_PTR
1124 LIBMWCAPTURE_API
1125 MWCreateEvent(
1126  );
1127 
1133 MW_RESULT
1134 LIBMWCAPTURE_API
1135 MWCloseEvent(
1136  MWCAP_PTR hEvent
1137  );
1138 
1144 MW_RESULT
1145 LIBMWCAPTURE_API
1146 MWSetEvent(
1147  MWCAP_PTR hEvent
1148  );
1149 
1155 MW_RESULT
1156 LIBMWCAPTURE_API
1157 MWClearEvent(
1158  MWCAP_PTR hEvent
1159  );
1160 
1166 BOOLEAN
1167 LIBMWCAPTURE_API
1168 MWIsSetEvent(
1169  MWCAP_PTR hEvent
1170  );
1171 
1177 int
1178 LIBMWCAPTURE_API
1179 MWTryWaitEvent(
1180  MWCAP_PTR hEvent
1181  );
1182 
1189 int
1190 LIBMWCAPTURE_API
1191 MWWaitEvent(
1192  MWCAP_PTR hEvent,
1193  int nTimeout
1194  );
1195 
1203 DWORD
1204 LIBMWCAPTURE_API
1205 MWMultiWaitEvent(
1206  MWCAP_PTR * hEvents,
1207  int nCount,
1208  int nTimeout
1209  );
1210 
1211 #ifdef __cplusplus
1212 }
1213 #endif
Definition: MWCaptureExtension.h:663
Definition: MWCaptureExtension.h:563
Definition: MWCaptureExtension.h:803
Definition: MWCaptureExtension.h:242
Definition: MWCaptureExtension.h:808
Definition: WinTypes.h:62
Definition: MWCaptureExtension.h:748
Definition: MWCaptureExtension.h:730
Definition: MWLinux.h:183
Definition: MWCaptureExtension.h:814
Definition: MWCaptureExtension.h:576
Definition: MWCaptureExtension.h:686
Definition: MWCaptureExtension.h:270
Definition: MWCaptureExtension.h:84