MWCapture SDK Mac 3.4.62314

- Home
- Development Library
- Release Notes

Functions
Pro Capture Family Functions

## Functions
HCHANNEL LIBMWCAPTURE_API | MWOpenChannel (int nBoardValue, int nChannelIndex)
| Opens capture channel by the rotary number and channel number.
MW_RESULT LIBMWCAPTURE_API | MWGetDeviceTime (HCHANNEL hChannel, LONGLONG *pllTime)
| Gets time of capture channel.
MW_RESULT LIBMWCAPTURE_API | MWSetDeviceTime (HCHANNEL hChannel, LONGLONG llTime)
| Sets time of capture channel.
MW_RESULT LIBMWCAPTURE_API | MWRegulateDeviceTime (HCHANNEL hChannel, LONGLONG llTime)
| Adjusts time of capture channel.
HTIMER LIBMWCAPTURE_API | MWRegisterTimer (HCHANNEL hChannel, MWHANDLE hEvent)
| Registers a time event object.
MW_RESULT LIBMWCAPTURE_API | MWUnregisterTimer (HCHANNEL hChannel, HTIMER hTimer)
| Unregisters a time event object.
MW_RESULT LIBMWCAPTURE_API | MWScheduleTimer (HCHANNEL hChannel, HTIMER hTimer, LONGLONG llExpireTime)
| Schedules time event objects.
HNOTIFY LIBMWCAPTURE_API | MWRegisterNotify (HCHANNEL hChannel, MWHANDLE hEvent, DWORD dwEnableBits)
| Registers an event notification.
MW_RESULT LIBMWCAPTURE_API | MWUnregisterNotify (HCHANNEL hChannel, HNOTIFY hNotify)
| Unregisters an event notification object.
MW_RESULT LIBMWCAPTURE_API | MWGetNotifyStatus (HCHANNEL hChannel, HNOTIFY hNotify, ULONGLONG *pullStatus)
| Gets current notification type.
MW_RESULT LIBMWCAPTURE_API | MWStartVideoCapture (HCHANNEL hChannel, MWHANDLE hEvent)
| Starts video capture.
MW_RESULT LIBMWCAPTURE_API | MWStopVideoCapture (HCHANNEL hChannel)
| Stops the video capture.
MW_RESULT LIBMWCAPTURE_API | MWCaptureVideoFrameToVirtualAddress (HCHANNEL hChannel, int iFrame, MWCAP_PTR pbFrame, DWORD cbFrame, DWORD cbStride, BOOLEAN bBottomUp, MWCAP_PTR64 pvContext, DWORD dwFOURCC, int cx, int cy)
| ‍**
MW_RESULT LIBMWCAPTURE_API | MWCaptureVideoFrameToVirtualAddressEx (HCHANNEL hChannel, int iFrame, LPBYTE pbFrame, DWORD cbFrame, DWORD cbStride, BOOLEAN bBottomUp, MWCAP_PTR64 pvContext, DWORD dwFOURCC, int cx, int cy, DWORD dwProcessSwitchs, int cyParitalNotify, HOSD hOSDImage, const RECT *pOSDRects, int cOSDRects, SHORT sContrast, SHORT sBrightness, SHORT sSaturation, SHORT sHue, MWCAP_VIDEO_DEINTERLACE_MODE deinterlaceMode, MWCAP_VIDEO_ASPECT_RATIO_CONVERT_MODE aspectRatioConvertMode, const RECT *pRectSrc, const RECT *pRectDest, int nAspectX, int nAspectY, MWCAP_VIDEO_COLOR_FORMAT colorFormat, MWCAP_VIDEO_QUANTIZATION_RANGE quantRange, MWCAP_VIDEO_SATURATION_RANGE satRange)
| ‍**
MW_RESULT LIBMWCAPTURE_API | MWGetVideoBufferInfo (HCHANNEL hChannel, MWCAP_VIDEO_BUFFER_INFO *pVideoBufferInfo)
| ‍**
MW_RESULT LIBMWCAPTURE_API | MWGetVideoFrameInfo (HCHANNEL hChannel, BYTE i, MWCAP_VIDEO_FRAME_INFO *pVideoFrameInfo)
| Gets video frame information.
MW_RESULT LIBMWCAPTURE_API | MWGetVideoCaptureStatus (HCHANNEL hChannel, MWCAP_VIDEO_CAPTURE_STATUS *pStatus)
| Gets video capture state, and frees up system storage.
MW_RESULT LIBMWCAPTURE_API | MWStartAudioCapture (HCHANNEL hChannel)
| Starts audio capturing of specified channel.
MW_RESULT LIBMWCAPTURE_API | MWStopAudioCapture (HCHANNEL hChannel)
| Stops audio capturing of specified channel.
MW_RESULT LIBMWCAPTURE_API | MWCaptureAudioFrame (HCHANNEL hChannel, MWCAP_AUDIO_CAPTURE_FRAME *pAudioCaptureFrame)
| Captures an audio frame.
MW_RESULT LIBMWCAPTURE_API | MWSetPostReconfig (HCHANNEL hChannel, DWORD dwDelayMS)
| Sends instructions for rereading configurations to delay the execution.
MW_RESULT LIBMWCAPTURE_API | MWGetTemperature (HCHANNEL hChannel, unsigned int *pnTemp)
| ‍**
MW_RESULT LIBMWCAPTURE_API | MWGetVideoAutoHAlign (HCHANNEL hChannel, BOOLEAN *pbAuto)
| ‍**
MW_RESULT LIBMWCAPTURE_API | MWSetVideoAutoHAlign (HCHANNEL hChannel, BOOLEAN bAuto)
| Sets whether the horizontal direction of the video is automatically adjusted according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWGetVideoSamplingPhase (HCHANNEL hChannel, BYTE *pbyValue)
| Gets the sampling phase according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWSetVideoSamplingPhase (HCHANNEL hChannel, BYTE byValue)
| Sets the sampling phase according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWGetVideoSamplingPhaseAutoAdjust (HCHANNEL hChannel, BOOLEAN *pbAuto)
| Gets whether the video sampling phase is automatically adjusted according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWSetVideoSamplingPhaseAutoAdjust (HCHANNEL hChannel, BOOLEAN bAuto)
| Sets whether the video sampling phase is automatically adjusted according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWSetVideoTiming (HCHANNEL hChannel, MWCAP_VIDEO_TIMING videoTiming)
| Sets the video timing according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWGetVideoPreferredTimingArray (HCHANNEL hChannel, MWCAP_VIDEO_TIMING *pVideoTiming, long *plCount)
| Gets the preset video timing array according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWSetCustomVideoTiming (HCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING videoTiming)
| Sets the customized video timing according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWGetCustomVideoTimingsCount (HCHANNEL hChannel, DWORD *pdwCount)
| Gets the number of customized video timing according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWGetCustomVideoTimingsArray (HCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING *pVideoCustomTiming, DWORD *pdwCount)
| Gets customized video timing array according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWSetCustomVideoTimingsArray (HCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING *pVideoCustomTiming, DWORD dwCount)
| Sets customized video timing array according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWGetCustomVideoResolutionsCount (HCHANNEL hChannel, DWORD *pdwCount)
| Gets the number of customized video resolution according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWGetCustomVideoResolutionsArray (HCHANNEL hChannel, MWCAP_SIZE *pResolutionSize, DWORD *pdwCount)
| Gets customized video resolution array according to channel handle.
MW_RESULT LIBMWCAPTURE_API | MWSetCustomVideoResolutionsArray (HCHANNEL hChannel, MWCAP_SIZE *pResolutionSize, DWORD dwCount)
| Sets customized video resolution array according to channel handle.
MWCAP_PTR LIBMWCAPTURE_API | MWCreateEvent ()
| Creates events.
MW_RESULT LIBMWCAPTURE_API | MWCloseEvent (MWCAP_PTR hEvent)
| Destroys the event.
MW_RESULT LIBMWCAPTURE_API | MWSetEvent (MWCAP_PTR hEvent)
| Triggers the event.
MW_RESULT LIBMWCAPTURE_API | MWClearEvent (MWCAP_PTR hEvent)
| Resets the event.
BOOLEAN LIBMWCAPTURE_API | MWIsSetEvent (MWCAP_PTR hEvent)
| Querys whether the event is triggered.
int LIBMWCAPTURE_API | MWTryWaitEvent (MWCAP_PTR hEvent)
| Waits for the event.
int LIBMWCAPTURE_API | MWWaitEvent (MWCAP_PTR hEvent, int nTimeout)
| Waits for the event.
DWORD LIBMWCAPTURE_API | MWMultiWaitEvent (MWCAP_PTR *hEvents, int nCount, int nTimeout)
| Waits for the events.

## Detailed Description

## Function Documentation

## ◆ MWCaptureAudioFrame()

MW_RESULT LIBMWCAPTURE_API MWCaptureAudioFrame | ( | HCHANNEL | hChannel,
|  | MWCAP_AUDIO_CAPTURE_FRAME * | pAudioCaptureFrame
| ) |  |

Captures an audio frame.

Parameters

  [in] | hChannel | Channel handle of opened audio capture
  [out] | pAudioCaptureFrame | Returns an audio frame

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Captures audio frames.
The usage of the API refers to example AudioCapture.
Related function(s): MWStartAudioCapture
For LPCM to capture up to 8 channel data, the channel correspondence are 0L, 1L, 2L, 3L, 0R, 1R, 2R, 3R.

## ◆ MWCaptureVideoFrameToVirtualAddress()

MW_RESULT LIBMWCAPTURE_API MWCaptureVideoFrameToVirtualAddress | ( | HCHANNEL | hChannel,
|  | int | iFrame,
|  | MWCAP_PTR | pbFrame,
|  | DWORD | cbFrame,
|  | DWORD | cbStride,
|  | BOOLEAN | bBottomUp,
|  | MWCAP_PTR64 | pvContext,
|  | DWORD | dwFOURCC,
|  | int | cx,
|  | int | cy
| ) |  |

‍**

‍**

Captures and saves video frames to system memory.

Parameters

  [in] | hChannel | Opened video capture channel handle
  [in] | iFrame | Video frame number to be captured
  [out] | pbFrame | Stores virtual memory pointers for captured data
  [in] | cbFrame | Byte length of memory that stores the captured data
  [in] | cbStride | Step of memory that stores the captured data
  [in] | bBottomUp | Whether to store the captured video frames from bottom to top
  [in] | pvContext | Custom context pointers
  [in] | dwFOURCC | Color format of captured video frames, see MWFOURCC.h.
  [in] | cx | Width of captured video frames
  [in] | cy | Height of captured video frames

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Detailed usage refers to the related examples: CaptureByInput, CaptureByTimer.
Related function(s): MWRegisterNotify
MWRegisterTimer

## ◆ MWCaptureVideoFrameToVirtualAddressEx()

MW_RESULT LIBMWCAPTURE_API MWCaptureVideoFrameToVirtualAddressEx | ( | HCHANNEL | hChannel,
|  | int | iFrame,
|  | LPBYTE | pbFrame,
|  | DWORD | cbFrame,
|  | DWORD | cbStride,
|  | BOOLEAN | bBottomUp,
|  | MWCAP_PTR64 | pvContext,
|  | DWORD | dwFOURCC,
|  | int | cx,
|  | int | cy,
|  | DWORD | dwProcessSwitchs,
|  | int | cyParitalNotify,
|  | HOSD | hOSDImage,
|  | const RECT * | pOSDRects,
|  | int | cOSDRects,
|  | SHORT | sContrast,
|  | SHORT | sBrightness,
|  | SHORT | sSaturation,
|  | SHORT | sHue,
|  | MWCAP_VIDEO_DEINTERLACE_MODE | deinterlaceMode,
|  | MWCAP_VIDEO_ASPECT_RATIO_CONVERT_MODE | aspectRatioConvertMode,
|  | const RECT * | pRectSrc,
|  | const RECT * | pRectDest,
|  | int | nAspectX,
|  | int | nAspectY,
|  | MWCAP_VIDEO_COLOR_FORMAT | colorFormat,
|  | MWCAP_VIDEO_QUANTIZATION_RANGE | quantRange,
|  | MWCAP_VIDEO_SATURATION_RANGE | satRange
| ) |  |

‍**

‍** ‍**

Save captured video frames to system memory. It is the extended MWCaptureVideoFrameToVirtualAddress.

Parameters

  [in] | hChannel | Video channel handle that has started video capturing
  [in] | iFrame | Video frame number to be captured
  [out] | pbFrame | Physical addresses that store the captured video frames
  [in] | cbFrame | Byte length of memory that stores the captured data
  [in] | cbStride | Step of memory that stores the captured data
  [in] | bBottomUp | Whether to store the captured video frames from bottom to top
  [in] | pvContext | Custom context pointers
  [in] | dwFOURCC | Color format of captured video frames, see MWFOURCC.h.
  [in] | cx | width of captured video frames
  [in] | cy | Height of captured video frames
  [in] | dwProcessSwitchs | Image processing mask. Refers to MWCAP_VIDEO_PROCESS_xx
  [in] | cyParitalNotify | Number of rows captured by lines
  [in] | hOSDImage | OSD image handle which is geted using MWCreateImage.
  [in] | pOSDRects | Target area of OSD image
  [in] | cOSDRects | Number of OSD image target areas
  [in] | sContrast | Contrast [50,200]
  [in] | sBrightness | Brightness [-100,100]
  [in] | sSaturation | Saturation [0,200]
  [in] | sHue | Hue [-90,90]
  [in] | deinterlaceMode | Deinterlace Mode
  [in] | aspectRatioConvertMode | Aspect Ratio Convert Mode
  [in] | pRectSrc | The source area of the image to capture
  [in] | pRectDest | The destination area of the image to capture
  [in] | nAspectX | Width of the aspect ratio
  [in] | nAspectY | Height of the aspect ratio
  [in] | colorFormat | Color Format
  [in] | quantRange | Quantization Range
  [in] | satRange | Saturation Range

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Captures video frames and saves the data to system memory. The extended version of MWCaptureVideoFrameToVirtualAddress which has more parameters for controlling.
Related example: AVCapture.

char path[128];
MWGetDevicePath(k,path);
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
HANDLE hNotifyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
HANDLE hCaptureEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
MW_RESULT xr;
HOSD hOSD = MWCreateImage(t_channel, CAPTURE_WIDTH, CAPTURE_HEIGHT);
...
xr = MWStartVideoCapture(t_channel, hCaptureEvent);
...
HNOTIFY hNotify = MWRegisterNotify(t_channel, hNotifyEvent, MWCAP_NOTIFY_VIDEO_FRAME_BUFFERED);
...
WaitForSingleObject(hNotifyEvent, INFINITE);
xr = MWGetNotifyStatus(t_channel, hNotify, &ullStatusBits);
MWCAP_VIDEO_BUFFER_INFO videoBufferInfo;
xr = MWGetVideoBufferInfo(t_channel, &videoBufferInfo);
MWCAP_VIDEO_FRAME_INFO videoFrameInfo;
xr = MWGetVideoFrameInfo(t_channel, videoBufferInfo.iNewestBufferedFullFrame, &videoFrameInfo);
xr =MWCaptureVideoFrameToVirtualAddressEx(t_channel,
MWCAP_VIDEO_FRAME_ID_NEWEST_BUFFERED,
m_p_buffer,m_cb_buffer,t_n_stride,FALSE,NULL,m_dw_fourcc,t_n_width,t_n_height,
0,0,NULL,NULL,0,100,0,100,0,MWCAP_VIDEO_DEINTERLACE_BLEND,
MWCAP_VIDEO_ASPECT_RATIO_IGNORE,NULL,NULL,
0,0,MWCAP_VIDEO_COLOR_FORMAT_UNKNOWN,
MWCAP_VIDEO_QUANTIZATION_UNKNOWN,
MWCAP_VIDEO_SATURATION_UNKNOWN);
MWCAP_VIDEO_CAPTURE_STATUS captureStatus;
xr = MWGetVideoCaptureStatus(t_channel, &captureStatus);
...
xr = MWUnregisterNotify(t_channel, hNotify);
xr = MWStopVideoCapture(t_channel);
...
MWCloseChannel(t_channel);
MWOpenChannelByPath
HCHANNEL LIBMWCAPTURE_API MWOpenChannelByPath(const char *pszDevicePath)
Opens capture channel by device instance path.
MWGetDevicePath
MW_RESULT LIBMWCAPTURE_API MWGetDevicePath(int nIndex, char *pDevicePath)
Gets the instance path of capture device based on the index.
MWRegisterNotify
HNOTIFY LIBMWCAPTURE_API MWRegisterNotify(HCHANNEL hChannel, MWHANDLE hEvent, DWORD dwEnableBits)
Registers an event notification.
MWGetVideoBufferInfo
MW_RESULT LIBMWCAPTURE_API MWGetVideoBufferInfo(HCHANNEL hChannel, MWCAP_VIDEO_BUFFER_INFO *pVideoBufferInfo)
‍**
MWCaptureVideoFrameToVirtualAddressEx
MW_RESULT LIBMWCAPTURE_API MWCaptureVideoFrameToVirtualAddressEx(HCHANNEL hChannel, int iFrame, LPBYTE pbFrame, DWORD cbFrame, DWORD cbStride, BOOLEAN bBottomUp, MWCAP_PTR64 pvContext, DWORD dwFOURCC, int cx, int cy, DWORD dwProcessSwitchs, int cyParitalNotify, HOSD hOSDImage, const RECT *pOSDRects, int cOSDRects, SHORT sContrast, SHORT sBrightness, SHORT sSaturation, SHORT sHue, MWCAP_VIDEO_DEINTERLACE_MODE deinterlaceMode, MWCAP_VIDEO_ASPECT_RATIO_CONVERT_MODE aspectRatioConvertMode, const RECT *pRectSrc, const RECT *pRectDest, int nAspectX, int nAspectY, MWCAP_VIDEO_COLOR_FORMAT colorFormat, MWCAP_VIDEO_QUANTIZATION_RANGE quantRange, MWCAP_VIDEO_SATURATION_RANGE satRange)
‍**
MWGetNotifyStatus
MW_RESULT LIBMWCAPTURE_API MWGetNotifyStatus(HCHANNEL hChannel, HNOTIFY hNotify, ULONGLONG *pullStatus)
Gets current notification type.
MWGetVideoCaptureStatus
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureStatus(HCHANNEL hChannel, MWCAP_VIDEO_CAPTURE_STATUS *pStatus)
Gets video capture state, and frees up system storage.
MWStartVideoCapture
MW_RESULT LIBMWCAPTURE_API MWStartVideoCapture(HCHANNEL hChannel, MWHANDLE hEvent)
Starts video capture.
MWGetVideoFrameInfo
MW_RESULT LIBMWCAPTURE_API MWGetVideoFrameInfo(HCHANNEL hChannel, BYTE i, MWCAP_VIDEO_FRAME_INFO *pVideoFrameInfo)
Gets video frame information.
MWStopVideoCapture
MW_RESULT LIBMWCAPTURE_API MWStopVideoCapture(HCHANNEL hChannel)
Stops the video capture.
MWUnregisterNotify
MW_RESULT LIBMWCAPTURE_API MWUnregisterNotify(HCHANNEL hChannel, HNOTIFY hNotify)
Unregisters an event notification object.
MWCAP_VIDEO_SATURATION_UNKNOWN
@ MWCAP_VIDEO_SATURATION_UNKNOWN
The default saturation range.
Definition: MWCaptureExtension.h:255
MWCAP_VIDEO_QUANTIZATION_UNKNOWN
@ MWCAP_VIDEO_QUANTIZATION_UNKNOWN
The default quantization range.
Definition: MWCaptureExtension.h:244
MWCAP_VIDEO_ASPECT_RATIO_IGNORE
@ MWCAP_VIDEO_ASPECT_RATIO_IGNORE
Ignore: Ignores the original aspect ratio and stretches to full-screen.
Definition: MWCaptureExtension.h:292
MWCAP_VIDEO_COLOR_FORMAT_UNKNOWN
@ MWCAP_VIDEO_COLOR_FORMAT_UNKNOWN
unknown color format
Definition: MWCaptureExtension.h:230
MWCAP_VIDEO_DEINTERLACE_BLEND
@ MWCAP_VIDEO_DEINTERLACE_BLEND
Blend mode.
Definition: MWCaptureExtension.h:281
MWCAP_NOTIFY_VIDEO_FRAME_BUFFERED
#define MWCAP_NOTIFY_VIDEO_FRAME_BUFFERED
MWCAP_NOTIFY_VIDEO_FRAME_BUFFERED.
Definition: MWCaptureExtension.h:884
MWCAP_VIDEO_FRAME_ID_NEWEST_BUFFERED
#define MWCAP_VIDEO_FRAME_ID_NEWEST_BUFFERED
MWCAP_VIDEO_FRAME_ID_NEWEST_BUFFERED.
Definition: MWCaptureExtension.h:1173
_MWCAP_VIDEO_BUFFER_INFO
MWCAP_VIDEO_BUFFER_INFO.
Definition: MWCaptureExtension.h:1116
_MWCAP_VIDEO_BUFFER_INFO::iNewestBufferedFullFrame
BYTE iNewestBufferedFullFrame
The sequence number of the latest bufferred frame.
Definition: MWCaptureExtension.h:1125
_MWCAP_VIDEO_CAPTURE_STATUS
MWCAP_VIDEO_CAPTURE_STATUS.
Definition: MWCaptureExtension.h:1301
_MWCAP_VIDEO_FRAME_INFO
MWCAP_VIDEO_FRAME_INFO.
Definition: MWCaptureExtension.h:1136

## ◆ MWClearEvent()

MW_RESULT LIBMWCAPTURE_API MWClearEvent | ( | MWCAP_PTR | hEvent | ) |

Resets the event.

Parameters

  [in] | hEvent | Event

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWCloseEvent()

MW_RESULT LIBMWCAPTURE_API MWCloseEvent | ( | MWCAP_PTR | hEvent | ) |

Destroys the event.

Parameters

  [in] | hEvent | Event handle

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWCreateEvent()

MWCAP_PTR LIBMWCAPTURE_API MWCreateEvent | ( |  | ) |

Creates events.

Returns
  Returns event handle if succeeded, otherwise return 0

## ◆ MWGetCustomVideoResolutionsArray()

MW_RESULT LIBMWCAPTURE_API MWGetCustomVideoResolutionsArray | ( | HCHANNEL | hChannel,
|  | MWCAP_SIZE * | pResolutionSize,
|  | DWORD * | pdwCount
| ) |  |

Gets customized video resolution array according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [out] | pResolutionSize | Customized video resolution
  [out] | pdwCount | The number of customized video resolution

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWGetCustomVideoResolutionsCount()

MW_RESULT LIBMWCAPTURE_API MWGetCustomVideoResolutionsCount | ( | HCHANNEL | hChannel,
|  | DWORD * | pdwCount
| ) |  |

Gets the number of customized video resolution according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [out] | pdwCount | The number of customized video resolution

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWGetCustomVideoTimingsArray()

MW_RESULT LIBMWCAPTURE_API MWGetCustomVideoTimingsArray | ( | HCHANNEL | hChannel,
|  | MWCAP_VIDEO_CUSTOM_TIMING * | pVideoCustomTiming,
|  | DWORD * | pdwCount
| ) |  |

Gets customized video timing array according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [out] | pVideoCustomTiming | Customized video timing
  [out] | pdwCount | The number of customized video timing

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWGetCustomVideoTimingsCount()

MW_RESULT LIBMWCAPTURE_API MWGetCustomVideoTimingsCount | ( | HCHANNEL | hChannel,
|  | DWORD * | pdwCount
| ) |  |

Gets the number of customized video timing according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [out] | pdwCount | The number of customized video timing

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWGetDeviceTime()

MW_RESULT LIBMWCAPTURE_API MWGetDeviceTime | ( | HCHANNEL | hChannel,
|  | LONGLONG * | pllTime
| ) |  |

Gets time of capture channel.

Parameters

  [in] | hChannel | Opened video channel handle
  [out] | pllTime | Returns time of capture channel in 100ns

Returns
  Returns MW_RESULT values as follows:

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Note
  Use the same clock for different channels on the same capture device, which plays an important role in audio and video data synchronization and multichannel data synchronization.

Usage:
Gets device time, uses the same clock for different channels on the same capture device.
It is used by most examples.

char path[128];
MWGetDevicePath(k,path);
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
LONGLONG t_time = 0;
MWGetDeviceTime(t_channel, &t_time);
...
MWCloseChannel(t_channel);
MWGetDeviceTime
MW_RESULT LIBMWCAPTURE_API MWGetDeviceTime(HCHANNEL hChannel, LONGLONG *pllTime)
Gets time of capture channel.

## ◆ MWGetNotifyStatus()

MW_RESULT LIBMWCAPTURE_API MWGetNotifyStatus | ( | HCHANNEL | hChannel,
|  | HNOTIFY | hNotify,
|  | ULONGLONG * | pullStatus
| ) |  |

Gets current notification type.

Parameters

  [in] | hChannel | Opened video channel handle
  [in] | hNotify | Handle of registerred notify event object
  [out] | pullStatus | Returns notification type. The value refers to the note of MWRegisterNotify

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
The function is used for Pro capture cards to capture video clips by notification type.
The detailed usage refers to example CaptureByInput.
Related function(s): MWRegisterNotify

## ◆ MWGetTemperature()

MW_RESULT LIBMWCAPTURE_API MWGetTemperature | ( | HCHANNEL | hChannel,
|  | unsigned int * | pnTemp
| ) |  |

‍**

‍** ‍** ‍** ‍**

Gets the temperature of capture card.

Parameters

  [in] | hChannel | Opened channel handle
  [out] | pnTemp | Capture card temperature

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWGetVideoAutoHAlign()

MW_RESULT LIBMWCAPTURE_API MWGetVideoAutoHAlign | ( | HCHANNEL | hChannel,
|  | BOOLEAN * | pbAuto
| ) |  |

‍**

‍** ‍** ‍** ‍** ‍** ‍** ‍** ‍** ‍**

Gets whether the horizontal direction of the video is automatically adjusted according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [out] | pbAuto | Whether the horizontal direction of the video is automatically adjusted

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWGetVideoBufferInfo()

MW_RESULT LIBMWCAPTURE_API MWGetVideoBufferInfo | ( | HCHANNEL | hChannel,
|  | MWCAP_VIDEO_BUFFER_INFO * | pVideoBufferInfo
| ) |  |

‍**

Gets video bufferring information

Parameters

  [in] | hChannel | Video channel handle that has started video capturing
  [out] | pVideoBufferInfo | Video bufferring information

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Gets video buffer on-board storage information that gives you the current number of video buffer frames and the frame id being cached.
Detailed usage refers to the related examples: CaptureByInput, CaptureByTimer.
Related function(s): MWRegisterNotify
MWRegisterTimer

## ◆ MWGetVideoCaptureStatus()

MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureStatus | ( | HCHANNEL | hChannel,
|  | MWCAP_VIDEO_CAPTURE_STATUS * | pStatus
| ) |  |

Gets video capture state, and frees up system storage.

Parameters

  [in] | hChannel | Video channel handle that has started video capturing
  [out] | pStatus | Returns video capture state

Returns
  Function return values are as follows:

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Gets video capture state. After the capture function call is completed, call the function, which gets the capture state while cleaning up the occupied system storage.
Detailed usage refers to the related examples: CaptureByInput, CaptureByTimer.
Related function(s): MWRegisterNotify
MWRegisterTimer

## ◆ MWGetVideoFrameInfo()

MW_RESULT LIBMWCAPTURE_API MWGetVideoFrameInfo | ( | HCHANNEL | hChannel,
|  | BYTE | i,
|  | MWCAP_VIDEO_FRAME_INFO * | pVideoFrameInfo
| ) |  |

Gets video frame information.

Parameters

  [in] | hChannel | Video channel handle that has started video capturing
  [in] | i | Video frame index
  [out] | pVideoFrameInfo | Returns video frame information

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Gets video frame information, including bufferring start and end time with time code.
Detailed usage refers to the related examples: CaptureByInput, CaptureByTimer.
Related function(s): MWRegisterNotify
MWRegisterTimer

## ◆ MWGetVideoPreferredTimingArray()

MW_RESULT LIBMWCAPTURE_API MWGetVideoPreferredTimingArray | ( | HCHANNEL | hChannel,
|  | MWCAP_VIDEO_TIMING * | pVideoTiming,
|  | long * | plCount
| ) |  |

Gets the preset video timing array according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [out] | pVideoTiming | Preset video timing array
  [out] | plCount | Count

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWGetVideoSamplingPhase()

MW_RESULT LIBMWCAPTURE_API MWGetVideoSamplingPhase | ( | HCHANNEL | hChannel,
|  | BYTE * | pbyValue
| ) |  |

Gets the sampling phase according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [out] | pbyValue | Sampling phase

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWGetVideoSamplingPhaseAutoAdjust()

MW_RESULT LIBMWCAPTURE_API MWGetVideoSamplingPhaseAutoAdjust | ( | HCHANNEL | hChannel,
|  | BOOLEAN * | pbAuto
| ) |  |

Gets whether the video sampling phase is automatically adjusted according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [out] | pbAuto | Whether the video sampling phase is automatically adjusted

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWIsSetEvent()

BOOLEAN LIBMWCAPTURE_API MWIsSetEvent | ( | MWCAP_PTR | hEvent | ) |

Querys whether the event is triggered.

Parameters

  [in] | hEvent | Event

Returns
  Returns TRUE if succeeded, otherwise returns FALSE

## ◆ MWMultiWaitEvent()

DWORD LIBMWCAPTURE_API MWMultiWaitEvent | ( | MWCAP_PTR * | hEvents,
|  | int | nCount,
|  | int | nTimeout
| ) |  |

Waits for the events.

Parameters

  [in] | hEvents | Events
  [in] | nCount | The number of event objects
  [in] | nTimeout | Timeout period

Returns
  Returns event flag if succeeded

## ◆ MWOpenChannel()

HCHANNEL LIBMWCAPTURE_API MWOpenChannel | ( | int | nBoardValue,
|  | int | nChannelIndex
| ) |  |

Opens capture channel by the rotary number and channel number.

Parameters

  [in] | nBoardValue | Rotary number on the capture device, 0 to f
  [in] | nChannelIndex | Channel index, starts from 0

Returns
  If the call succeeds, which returns the video channel handle; the call fails, which returns the empty value.

Note
  If there are 2 devices with the same rotary number, the one with a smaller PCI-e number will be opened.
  The same channel can be opened multiple times at the same time, and the handles that open the same channel are independent of each other and do not affect each other.

Usage:
It is used by all examples.

MWCAP_CHANNEL_INFO info;
MWGetChannelInfoByIndex(0,&info);
HCHANNEL t_channel=MWOpenChannel(info.byBoardIndex,info.byChannelIndex);
...
MWCloseChannel(t_channel);
MWGetChannelInfoByIndex
MW_RESULT LIBMWCAPTURE_API MWGetChannelInfoByIndex(int nIndex, MWCAP_CHANNEL_INFO *pChannelInfo)
Gets the channel info by its index.
MWOpenChannel
HCHANNEL LIBMWCAPTURE_API MWOpenChannel(int nBoardValue, int nChannelIndex)
Opens capture channel by the rotary number and channel number.
_MWCAP_CHANNEL_INFO
MWCAP_CHANNEL_INFO.
Definition: MWCaptureExtension.h:410
_MWCAP_CHANNEL_INFO::byBoardIndex
BYTE byBoardIndex
Rotary ID located on the capture card, 0~F.
Definition: MWCaptureExtension.h:421
_MWCAP_CHANNEL_INFO::byChannelIndex
BYTE byChannelIndex
Channel index of the capture card, which starts from 0.
Definition: MWCaptureExtension.h:422

## ◆ MWRegisterNotify()

HNOTIFY LIBMWCAPTURE_API MWRegisterNotify | ( | HCHANNEL | hChannel,
|  | MWHANDLE | hEvent,
|  | DWORD | dwEnableBits
| ) |  |

Registers an event notification.

Parameters

  [in] | hChannel | Opened video channel handle
  [in] | hEvent | An event handle, created by the function MWCreateEvent()
  [in] | dwEnableBits | Type mask for notifications

Returns
  Returns the handle to the notification event object if succeeded, otherwise returns NULL.

Note
  dwEnableBits can be set to one or more of the following notification types.
  MWCAP_NOTIFY_xx
  When the notification type you set occurs, the event associated with the notification event object will be set to the signaled state.

Usage:
The API is used to trigger Pro capture cards to capture video clips by notification type.
Detailed usage refers to example CaptureByInput.

char path[128];
MWGetDevicePath(k,path);
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
HANDLE hNotifyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
HANDLE hCaptureEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
MW_RESULT xr;
xr = MWStartVideoCapture(t_channel, hCaptureEvent);
...
HNOTIFY hNotify = MWRegisterNotify(t_channel, hNotifyEvent, MWCAP_NOTIFY_VIDEO_FRAME_BUFFERED);
...
WaitForSingleObject(hNotifyEvent, INFINITE);
xr = MWGetNotifyStatus(t_channel, hNotify, &ullStatusBits);
MWCAP_VIDEO_BUFFER_INFO videoBufferInfo;
xr = MWGetVideoBufferInfo(t_channel, &videoBufferInfo);
MWCAP_VIDEO_FRAME_INFO videoFrameInfo;
xr = MWGetVideoFrameInfo(t_channel, videoBufferInfo.iNewestBufferedFullFrame, &videoFrameInfo);
xr = MWCaptureVideoFrameToVirtualAddress(t_channel, -1, (LPBYTE)bitmapData.Scan0, bitmapData.Stride * cy, bitmapData.Stride, bBottomUp, NULL, MWFOURCC_BGRA, cx, cy);
WaitForSingleObject(hCaptureEvent, INFINITE);
MWCAP_VIDEO_CAPTURE_STATUS captureStatus;
xr = MWGetVideoCaptureStatus(t_channel, &captureStatus);
...
xr = MWUnregisterNotify(t_channel, hNotify);
xr = MWStopVideoCapture(t_channel);
...
MWCloseChannel(t_channel);
MWFOURCC_BGRA
#define MWFOURCC_BGRA
32bits B8G8R8A8
Definition: MWFOURCC.h:166
MWCaptureVideoFrameToVirtualAddress
MW_RESULT LIBMWCAPTURE_API MWCaptureVideoFrameToVirtualAddress(HCHANNEL hChannel, int iFrame, MWCAP_PTR pbFrame, DWORD cbFrame, DWORD cbStride, BOOLEAN bBottomUp, MWCAP_PTR64 pvContext, DWORD dwFOURCC, int cx, int cy)
‍**

## ◆ MWRegisterTimer()

HTIMER LIBMWCAPTURE_API MWRegisterTimer | ( | HCHANNEL | hChannel,
|  | MWHANDLE | hEvent
| ) |  |

Registers a time event object.

Parameters

  [in] | hChannel | Opened video channel handle
  [in] | hEvent | Event handle, creates with MWCreateEvent()

Returns
  If the function succeeds, the return value is a handle to the time event object, otherwise it is NULL.

The API is used for pro capture cards to specify the capture interval between adjacent video frames
Detailed usage refers to example CaptureByTimer.

char path[128];
MWGetDevicePath(k,path);
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
HANDLE hNotifyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
HANDLE hCaptureEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
MW_RESULT xr;
xr = MWStartVideoCapture(t_channel, hCaptureEvent);
HTIMER hTimerEvent = MWRegisterTimer(t_channel, hNotifyEvent);
LONGLONG llBegin = 0LL;
xr = MWGetDeviceTime(t_channel, &llBegin);
...
xr = MWScheduleTimer(t_channel, hTimerEvent, llBegin + i * TIMER_DURATION);
WaitForSingleObject(hNotifyEvent, INFINITE);
MWCAP_VIDEO_BUFFER_INFO videoBufferInfo;
xr = MWGetVideoBufferInfo(t_channel, &videoBufferInfo);
MWCAP_VIDEO_FRAME_INFO videoFrameInfo;
xr = MWGetVideoFrameInfo(t_channel, videoBufferInfo.iNewestBufferedFullFrame, &videoFrameInfo);
xr = MWCaptureVideoFrameToVirtualAddress(t_channel, -1, (LPBYTE)bitmapData.Scan0, bitmapData.Stride * cy, bitmapData.Stride, bBottomUp, NULL, MWFOURCC_BGRA, cx, cy);
WaitForSingleObject(hCaptureEvent, INFINITE);
MWCAP_VIDEO_CAPTURE_STATUS captureStatus;
xr = MWGetVideoCaptureStatus(t_channel, &captureStatus);
...
xr = MWUnregisterTimer(t_channel, hTimerEvent);
xr = MWStopVideoCapture(t_channel);
...
MWCloseChannel(t_channel);
MWUnregisterTimer
MW_RESULT LIBMWCAPTURE_API MWUnregisterTimer(HCHANNEL hChannel, HTIMER hTimer)
Unregisters a time event object.
MWScheduleTimer
MW_RESULT LIBMWCAPTURE_API MWScheduleTimer(HCHANNEL hChannel, HTIMER hTimer, LONGLONG llExpireTime)
Schedules time event objects.
MWRegisterTimer
HTIMER LIBMWCAPTURE_API MWRegisterTimer(HCHANNEL hChannel, MWHANDLE hEvent)
Registers a time event object.

## ◆ MWRegulateDeviceTime()

MW_RESULT LIBMWCAPTURE_API MWRegulateDeviceTime | ( | HCHANNEL | hChannel,
|  | LONGLONG | llTime
| ) |  |

Adjusts time of capture channel.

Parameters

  [in] | hChannel | Opened video channel handle
  [in] | llTime | Adjusts time in 100ns.

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Note
  Synchronizes clocks of different channels.
  The difference between this API and MWSetDeviceTime is that the clock value of the capture channel will calibrate to the set value in a gradual manner instead of a sudden change for this API. The clock value of the capture channel becomes the set time value immediately after setting MWSetDeviceTime if you are using MWSetDeviceTime.

Usage:
Adjusts device time.

char path[128];
MWGetDevicePath(k,path);
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
LONGLONG llStandardTime = 0LL;
xr = MWRegulateDeviceTime(t_channel, llStandardTime);
...
MWCloseChannel(t_channel);
MWRegulateDeviceTime
MW_RESULT LIBMWCAPTURE_API MWRegulateDeviceTime(HCHANNEL hChannel, LONGLONG llTime)
Adjusts time of capture channel.

## ◆ MWScheduleTimer()

MW_RESULT LIBMWCAPTURE_API MWScheduleTimer | ( | HCHANNEL | hChannel,
|  | HTIMER | hTimer,
|  | LONGLONG | llExpireTime
| ) |  |

Schedules time event objects.

Parameters

  [in] | hChannel | Opened video channel handle
  [in] | hTimer | Scheduled time event objects
  [in] | llExpireTime | Sets the time value of the scheduled time event, which is the absolute value of the capture device's clock.

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Note
  When the scheduled time is reached, the event associated with the time event object will be set to be the signaled state.

Usage:
The API is used for pro capture cards to set the time when the time event object is triggered.
Detailed usage refers to example CaptureByTimer.
Related function(s): MWRegisterTimer

## ◆ MWSetCustomVideoResolutionsArray()

MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoResolutionsArray | ( | HCHANNEL | hChannel,
|  | MWCAP_SIZE * | pResolutionSize,
|  | DWORD | dwCount
| ) |  |

Sets customized video resolution array according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [in] | pResolutionSize | Customized video resolution
  [in] | dwCount | The number of customized video resolution

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWSetCustomVideoTiming()

MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoTiming | ( | HCHANNEL | hChannel,
|  | MWCAP_VIDEO_CUSTOM_TIMING | videoTiming
| ) |  |

Sets the customized video timing according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [in] | videoTiming | Customized video timing

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWSetCustomVideoTimingsArray()

MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoTimingsArray | ( | HCHANNEL | hChannel,
|  | MWCAP_VIDEO_CUSTOM_TIMING * | pVideoCustomTiming,
|  | DWORD | dwCount
| ) |  |

Sets customized video timing array according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [in] | pVideoCustomTiming | Customized video timing
  [in] | dwCount | The number of customized video timing

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWSetDeviceTime()

MW_RESULT LIBMWCAPTURE_API MWSetDeviceTime | ( | HCHANNEL | hChannel,
|  | LONGLONG | llTime
| ) |  |

Sets time of capture channel.

Parameters

  [in] | hChannel | Opened video channel handle
  [in] | llTime | Sets the time of the capture channel, which is in 100 nanoseconds

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Note
  Synchronizes clocks of different devices.

Usage:
Sets the clock of capture device.

char path[128];
MWGetDevicePath(k,path);
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
LONGLONG t_time = 0;
t_time=...;
...
MWSetDeviceTime(t_channel, t_time);
...
MWCloseChannel(t_channel);

## ◆ MWSetEvent()

MW_RESULT LIBMWCAPTURE_API MWSetEvent | ( | MWCAP_PTR | hEvent | ) |

Triggers the event.

Parameters

  [in] | hEvent | Event

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWSetPostReconfig()

MW_RESULT LIBMWCAPTURE_API MWSetPostReconfig | ( | HCHANNEL | hChannel,
|  | DWORD | dwDelayMS
| ) |  |

Sends instructions for rereading configurations to delay the execution.

Parameters

  [in] | hChannel | Opened channel handle
  [in] | dwDelayMS | Delay time in milliseconds

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWSetVideoAutoHAlign()

MW_RESULT LIBMWCAPTURE_API MWSetVideoAutoHAlign | ( | HCHANNEL | hChannel,
|  | BOOLEAN | bAuto
| ) |  |

Sets whether the horizontal direction of the video is automatically adjusted according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [in] | bAuto | Whether the horizontal direction of the video is automatically adjusted

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWSetVideoSamplingPhase()

MW_RESULT LIBMWCAPTURE_API MWSetVideoSamplingPhase | ( | HCHANNEL | hChannel,
|  | BYTE | byValue
| ) |  |

Sets the sampling phase according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [in] | byValue | Sampling phase

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWSetVideoSamplingPhaseAutoAdjust()

MW_RESULT LIBMWCAPTURE_API MWSetVideoSamplingPhaseAutoAdjust | ( | HCHANNEL | hChannel,
|  | BOOLEAN | bAuto
| ) |  |

Sets whether the video sampling phase is automatically adjusted according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [in] | bAuto | Whether the video sampling phase is automatically adjusted

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWSetVideoTiming()

MW_RESULT LIBMWCAPTURE_API MWSetVideoTiming | ( | HCHANNEL | hChannel,
|  | MWCAP_VIDEO_TIMING | videoTiming
| ) |  |

Sets the video timing according to channel handle.

Parameters

  [in] | hChannel | Channel handle
  [in] | videoTiming | Video timing

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWStartAudioCapture()

MW_RESULT LIBMWCAPTURE_API MWStartAudioCapture | ( | HCHANNEL | hChannel | ) |

Starts audio capturing of specified channel.

Parameters

  [in] | hChannel | Opened channel handle

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Starts audio capturing of specified channel.
The usage of the API refers to example AudioCapture.

char path[128];
MWGetDevicePath(k,path);
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
HNOTIFY hNotify=MWRegisterNotify(t_channel, hEvent, MWCAP_NOTIFY_AUDIO_SIGNAL_CHANGE | MWCAP_NOTIFY_AUDIO_FRAME_BUFFERED);
...
xr = MWStartAudioCapture(t_channel);
...
WaitForSingleObject(hEvent, INFINITE);
ULONGLONG ullStatusBits = 0LL;
MWGetNotifyStatus(t_channel, hNotify, &ullStatusBits);
if (ullStatusBits & MWCAP_NOTIFY_AUDIO_FRAME_BUFFERED) {
MWCAP_AUDIO_CAPTURE_FRAME audioFrame;
xr = MWCaptureAudioFrame(t_channel, &audioFrame);
...
}
...
xr = MWUnregisterNotify(t_channel, hNotify);
xr = MWStopVideoCapture(t_channel);
...
MWCloseChannel(t_channel);
MWStartAudioCapture
MW_RESULT LIBMWCAPTURE_API MWStartAudioCapture(HCHANNEL hChannel)
Starts audio capturing of specified channel.
MWCaptureAudioFrame
MW_RESULT LIBMWCAPTURE_API MWCaptureAudioFrame(HCHANNEL hChannel, MWCAP_AUDIO_CAPTURE_FRAME *pAudioCaptureFrame)
Captures an audio frame.
MWCAP_NOTIFY_AUDIO_FRAME_BUFFERED
#define MWCAP_NOTIFY_AUDIO_FRAME_BUFFERED
MWCAP_NOTIFY_AUDIO_FRAME_BUFFERED.
Definition: MWCaptureExtension.h:905
MWCAP_NOTIFY_AUDIO_SIGNAL_CHANGE
#define MWCAP_NOTIFY_AUDIO_SIGNAL_CHANGE
MWCAP_NOTIFY_AUDIO_SIGNAL_CHANGE.
Definition: MWCaptureExtension.h:843
_MWCAP_AUDIO_CAPTURE_FRAME
MWCAP_AUDIO_CAPTURE_FRAME.
Definition: MWCaptureExtension.h:1343

## ◆ MWStartVideoCapture()

MW_RESULT LIBMWCAPTURE_API MWStartVideoCapture | ( | HCHANNEL | hChannel,
|  | MWHANDLE | hEvent
| ) |  |

Starts video capture.

Parameters

  [in] | hChannel | Opened video channel handle
  [in] | hEvent | An event handle, which is created by MWCreateEvent().

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
It is uses for Pro capture cards.
Detailed usage refers to the related examples: CaptureByInput, CaptureByTimer.
Related function(s): MWRegisterNotify
MWRegisterTimer

## ◆ MWStopAudioCapture()

MW_RESULT LIBMWCAPTURE_API MWStopAudioCapture | ( | HCHANNEL | hChannel | ) |

Stops audio capturing of specified channel.

Parameters

  [in] | hChannel | channel handle of opened audio capture

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Stops audio capturing of specified channel.
Usage:\nRelated example: AudioCapture
The API is used together with MWStartAudioCapture.

## ◆ MWStopVideoCapture()

MW_RESULT LIBMWCAPTURE_API MWStopVideoCapture | ( | HCHANNEL | hChannel | ) |

Stops the video capture.

Parameters

  [in] | hChannel | Opened handle of video capture channel

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
Detailed usage refers to the related examples: CaptureByInput, CaptureByTimer.
Related function(s): MWRegisterNotify
MWRegisterTimer

## ◆ MWTryWaitEvent()

int LIBMWCAPTURE_API MWTryWaitEvent | ( | MWCAP_PTR | hEvent | ) |

Waits for the event.

Parameters

  [in] | hEvent | Event

Returns
  Returns 1 if succeeded

## ◆ MWUnregisterNotify()

MW_RESULT LIBMWCAPTURE_API MWUnregisterNotify | ( | HCHANNEL | hChannel,
|  | HNOTIFY | hNotify
| ) |  |

Unregisters an event notification object.

Parameters

  [in] | hChannel | Channel handle
  [in] | hNotify | Event notification

Returns
  Function return values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
The API is used for Pro capture cards to capture by the notification type.
Detailed usage refers to example CaptureByInput.
Related function(s): MWRegisterNotify

## ◆ MWUnregisterTimer()

MW_RESULT LIBMWCAPTURE_API MWUnregisterTimer | ( | HCHANNEL | hChannel,
|  | HTIMER | hTimer
| ) |  |

Unregisters a time event object.

Parameters

  [in] | hChannel | Opened video channel handle
  [in] | hTimer | Handle of time event object that has been registered

Returns
  Returns MW_RESULT, the values are as follows

  MW_SUCCEEDED | Function call succeeded.
  MW_FAILED | Function call failed.
  MW_INVALID_PARAMS | Input invalid value(s).

Usage:
The API is used for pro capture cards that specify the capture interval between adjacent video frames.
Detailed usage refers to example CapturebyTimer.
Related function(s): MWRegisterTimer(HCHANNEL hChannel, HANDLE hEvent)

## ◆ MWWaitEvent()

int LIBMWCAPTURE_API MWWaitEvent | ( | MWCAP_PTR | hEvent,
|  | int | nTimeout
| ) |  |

Waits for the event.

Parameters

  [in] | hEvent | Event
  [in] | nTimeout | Timeout period

Returns
  Returns 1 if succeeded