MWCapture SDK Linux  3.3.1.LAST_SVN_COMMIT_NUM
Functions
Universal Functions

Functions

MW_RESULT LIBMWCAPTURE_API MWGetVersion (BYTE *pbyMaj, BYTE *pbyMin, WORD *pwBuild)
 Gets the version number of SDK. More...
 
BOOL LIBMWCAPTURE_API MWCaptureInitInstance ()
 Initializes the MWCapture interfaces. More...
 
void LIBMWCAPTURE_API MWCaptureExitInstance ()
 Quits instance. More...
 
MW_RESULT LIBMWCAPTURE_API MWRefreshDevice ()
 Refreshes device list. More...
 
int LIBMWCAPTURE_API MWGetChannelCount ()
 Gets the total number of channels. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetChannelInfoByIndex (int nIndex, MWCAP_CHANNEL_INFO *pChannelInfo)
 Gets the channel info by its index. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetFamilyInfoByIndex (int nIndex, LPVOID pFamilyInfo, DWORD dwSize)
 Gets the product family based on the index. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetDevicePath (int nIndex, char *pDevicePath)
 Gets the instance path of capture device based on the index. More...
 
HCHANNEL LIBMWCAPTURE_API MWOpenChannelByPath (const char *pszDevicePath)
 Opens capture channel by device instance path. More...
 
void LIBMWCAPTURE_API MWCloseChannel (HCHANNEL hChannel)
 Closes capture channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetChannelInfo (HCHANNEL hChannel, MWCAP_CHANNEL_INFO *pChannelInfo)
 Gets channel information. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetFamilyInfo (HCHANNEL hChannel, LPVOID pFamilyInfo, DWORD dwSize)
 Gets attributions of product family which the capture device belongs to. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaps (HCHANNEL hChannel, MWCAP_VIDEO_CAPS *pVideoCaps)
 Gets video capture capability of the specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioCaps (HCHANNEL hChannel, MWCAP_AUDIO_CAPS *pAudioCaps)
 Gets audio capture capability of the channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputSourceArray (HCHANNEL hChannel, DWORD *pdwInputSource, DWORD *pdwInputCount)
 Gets the input video signal types supported by the channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSourceArray (HCHANNEL hChannel, DWORD *pdwInputSource, DWORD *pdwInputCount)
 Gets the input audio signal types supported by the channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetInputSourceScan (HCHANNEL hChannel, BOOLEAN *pbScan)
 Gets the scan state of input source. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetInputSourceScan (HCHANNEL hChannel, BOOLEAN bScan)
 Sets the scan state of input source. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetAVInputSourceLink (HCHANNEL hChannel, BOOLEAN *pbLink)
 Gets whether the input audio input source is related to video input source. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetAVInputSourceLink (HCHANNEL hChannel, BOOLEAN bLink)
 Sets whether the input video source is linked to its audio automatically. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputSource (HCHANNEL hChannel, DWORD *pdwSource)
 Gets current video input source of the channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputSource (HCHANNEL hChannel, DWORD dwSource)
 Sets the video input source of the specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSource (HCHANNEL hChannel, DWORD *pdwSource)
 Gets current input audio source of the specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetAudioInputSource (HCHANNEL hChannel, DWORD dwSource)
 Sets current audio input source of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetEDID (HCHANNEL hChannel, BYTE *pbyData, ULONG *pulSize)
 Gets the EDID of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetEDID (HCHANNEL hChannel, BYTE *pbyData, ULONG ulSize)
 Sets EDID of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetInputSpecificStatus (HCHANNEL hChannel, MWCAP_INPUT_SPECIFIC_STATUS *pInputStatus)
 Gets the specific status of input signal. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoSignalStatus (HCHANNEL hChannel, MWCAP_VIDEO_SIGNAL_STATUS *pSignalStatus)
 Gets video signal status of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioSignalStatus (HCHANNEL hChannel, MWCAP_AUDIO_SIGNAL_STATUS *pSignalStatus)
 Gets the audio signal status of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetHDMIInfoFrameValidFlag (HCHANNEL hChannel, DWORD *pdwValidFlag)
 Gets valid flag of HDMI InfoFrame. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetHDMIInfoFramePacket (HCHANNEL hChannel, MWCAP_HDMI_INFOFRAME_ID id, HDMI_INFOFRAME_PACKET *pPacket)
 Gets HDMI InfoFrame data. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputAspectRatio (HCHANNEL hChannel, int nAspectX, int nAspectY)
 Sets aspect ratio of input video source. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputAspectRatio (HCHANNEL hChannel, int *pnAspectX, int *pnAspectY)
 Gets aspect ratio of input video source. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputColorFormat (HCHANNEL hChannel, MWCAP_VIDEO_COLOR_FORMAT colorFormat)
 Sets color format of input video. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputColorFormat (HCHANNEL hChannel, MWCAP_VIDEO_COLOR_FORMAT *pColorFormat)
 Gets color format of input video. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputQuantizationRange (HCHANNEL hChannel, MWCAP_VIDEO_QUANTIZATION_RANGE quantRange)
 Sets quantization range of input video. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputQuantizationRange (HCHANNEL hChannel, MWCAP_VIDEO_QUANTIZATION_RANGE *pQuantRange)
 Gets quantization range of input video. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetLEDMode (HCHANNEL hChannel, DWORD dwMode)
 Sets LED mode. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetFirmwareStorageInfo (HCHANNEL hChannel, MWCAP_FIRMWARE_STORAGE *pFirmwareStorageInfo)
 Gets firmware storage information. More...
 
MW_RESULT LIBMWCAPTURE_API MWEraseFirmwareData (HCHANNEL hChannel, DWORD cbOffset, DWORD cbErase)
 Erases firmware data. More...
 
MW_RESULT LIBMWCAPTURE_API MWReadFirmwareData (HCHANNEL hChannel, DWORD cbOffset, BYTE *pbyData, DWORD cbToRead, DWORD *pcbRead)
 Read firmware data from specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWWriteFirmwareData (HCHANNEL hChannel, DWORD cbOffset, BYTE *pbyData, DWORD cbData)
 Writes firmware data to specified channel. More...
 
HANDLE LIBMWCAPTURE_API MWCreateVideoCapture (HCHANNEL hChannel, int nWidth, int nHeight, int nFourcc, int nFrameDuration, VIDEO_CAPTURE_CALLBACK callback, void *pParam)
 Uses the v4l function to create video capture. More...
 
MW_RESULT LIBMWCAPTURE_API MWDestoryVideoCapture (HANDLE hVideo)
 Stops video capturing. More...
 
HANDLE LIBMWCAPTURE_API MWCreateAudioCapture (HCHANNEL hChannel, MWCAP_AUDIO_CAPTURE_NODE captureNode, DWORD dwSamplesPerSec, WORD wBitsPerSample, WORD wChannels, AUDIO_CAPTURE_CALLBACK callback, void *pParam)
 Create audio capture using the v4l function. More...
 
MW_RESULT LIBMWCAPTURE_API MWDestoryAudioCapture (HANDLE hAudio)
 Stops audio capturing. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioVolume (HCHANNEL hChannel, MWCAP_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
 Gets the volume value of audio capture device. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetAudioVolume (HCHANNEL hChannel, MWCAP_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
 Sets the volume of audio capture device. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoAutoHAlign (HCHANNEL hChannel, BOOLEAN *pbAutoHAlign)
 Gets whether to adjust horizontal alignment of the vga timing automatically. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoAutoHAlign (HCHANNEL hChannel, BOOLEAN bAutoHAlign)
 Sets whether to adjust horizontal alignment of the vga timing automatically. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoSamplingPhase (HCHANNEL hChannel, BYTE *puSamplingPhase)
 Gets the phase of the specified input vga timing. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoSamplingPhase (HCHANNEL hChannel, BYTE puSamplingPhase)
 Sets the phase of the specified input vga timing. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoSamplingPhaseAutoAdjust (HCHANNEL hChannel, BOOLEAN *pbAutoSamplingPhase)
 Gets whether to adjust the phase of the specified input vga timing automatically. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoSamplingPhaseAutoAdjust (HCHANNEL hChannel, BOOLEAN bAutoSamplingPhase)
 Sets whether to automatically adjust the phase of vga timing sampling. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoTiming (HCHANNEL hChannel, MWCAP_VIDEO_TIMING *pTiming)
 Sets the vga timing of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetPreferredVideoTimings (HCHANNEL hChannel, MWCAP_VIDEO_TIMING_ARRAY *paTimings)
 Gets the preffered vga timing array of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoTiming (HCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING *pCustomTiming)
 Sets the custom vga timing of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetCustomVideoTimings (HCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING_ARRAY *paCustomTimings)
 Gets the custom vga timing of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoTimings (HCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING_ARRAY *paCustomTimings)
 Sets the custom vga timing array of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetCustomVideoResolutions (HCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY *paCustomResolutions)
 Gets the custom resolutions in vga timing of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoResolutions (HCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY *paCustomResolutions)
 Sets the custom resolutions in vga timing of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWCaptureSetSDIANCType (HCHANNEL hChannel, BYTE byIndex, BOOLEAN bHANC, BOOLEAN bVANC, BYTE byDID, BYTE bySDID)
 Sets the ANC data types to be captured for SDI signal. More...
 
MW_RESULT LIBMWCAPTURE_API MWCaptureGetSDIANCPacket (HCHANNEL hChannel, MWCAP_SDI_ANC_PACKET *pPacket)
 Captures specified SDI ANC data. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportResolutionMode (HCHANNEL hChannel, MWCAP_VIDEO_RESOLUTION_MODE *pMode, int *pCount)
 Gets resolution mode supported by devices, including MWCAP_VIDEO_RESOLUTION_MODE_LIST when the resolutions are discrete values, and MWCAP_VIDEO_RESOLUTION_MODE_RANGE when the resolutions are continuous values. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportRangeResolution (HCHANNEL hChannel, MWCAP_VIDEO_RESOLUTION_RANGE *pRange)
 Gets resolution range supported by the device, when the return mode of MWGetVideoCaptureSupportResolutionMode is MWCAP_VIDEO_RESOLUTION_MODE_RANGE. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportListResolution (HCHANNEL hChannel, MWCAP_VIDEO_RESOLUTION_LIST *pList)
 Gets resolutions supported by devices when the return mode of MWGetVideoCaptureSupportResolutionMode is MWCAP_VIDEO_RESOLUTION_MODE_LIST. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportColorFormat (HCHANNEL hChannel, DWORD *pColorFourcc, int *nCount)
 Uses v4l2 to get the device supported color spaces. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoProcParamRange (HANDLE hVideo, MWCAP_VIDEO_PROC_PARAM_TYPE videoProcParamType, long *plParamValueMin, long *plParamValueMax, long *plParamValueDef)
 Gets range of video processing parameters. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoProcParam (HANDLE hVideo, MWCAP_VIDEO_PROC_PARAM_TYPE videoProcParamType, long *plParamValue)
 Gets current video processing settings. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoProcParam (HANDLE hVideo, MWCAP_VIDEO_PROC_PARAM_TYPE videoProcParamType, long lParamValue)
 Sets the specified video processing parameters. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetPostReconfig (HCHANNEL hChannel, DWORD dwDelayMS)
 Sends instructions for rereading configurations to delay the execution. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureConnectionFormat (HCHANNEL hChannel, MWCAP_VIDEO_CONNECTION_FORMAT *pConnFormat)
 Gets the connection format of capture pin. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetInputSourceScanState (HCHANNEL hChannel, BOOLEAN *pbInputSourceScanning)
 Gets whether to scan the input signal source of specified channel automatically. More...
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureProcessSettings (HCHANNEL hChannel, MWCAP_VIDEO_PROCESS_SETTINGS *paProcessSettings)
 Gets the video process settings of specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoCaptureProcessSettings (HCHANNEL hChannel, MWCAP_VIDEO_PROCESS_SETTINGS *paProcessSettings)
 Sets the video process parameters of specified channel. More...
 

Detailed Description

Function Documentation

void LIBMWCAPTURE_API MWCaptureExitInstance ( )

Quits instance.

The API is used to quit the current instance. It always used with MWCaptureInitInstance.

MW_RESULT LIBMWCAPTURE_API MWCaptureGetSDIANCPacket ( HCHANNEL  hChannel,
MWCAP_SDI_ANC_PACKET pPacket 
)

Captures specified SDI ANC data.

Parameters
[in]hChannelChannel handle
[in]pPacketANC data packet
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:
Sets capture cc data types of SDI signal and get ANC data packet.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCaptureSetSDIANCType(t_channel, 0, FALSE, TRUE, 0x61, 0x01);
6 ...
7 MWCAP_SDI_ANC_PACKET t_packet;
8 MWCaptureGetSDIANCPacket(t_channel,&t_packet);
9 ...
10 MWCloseChannel(t_channel);
BOOL LIBMWCAPTURE_API MWCaptureInitInstance ( )

Initializes the MWCapture interfaces.

  • Returns
    A Boolean variable. True if the initialization is successful, otherwise returns False.
    Mainly uses the API to start a device-monitoring thread.
    It is recommended to call this api once before using SDK to initialize MWCapture. It works with MWCaptureExitInstance.
MW_RESULT LIBMWCAPTURE_API MWCaptureSetSDIANCType ( HCHANNEL  hChannel,
BYTE  byIndex,
BOOLEAN  bHANC,
BOOLEAN  bVANC,
BYTE  byDID,
BYTE  bySDID 
)

Sets the ANC data types to be captured for SDI signal.

Parameters
[in]hChannelThe opened channel handle
[in]byIndexIndex of ANC data types, from 0 to 3.
[in]bHANCWhether it is HANC
[in]bVANCWhether it is VANC
[in]byDIDSMPTE ANC DID
[in]bySDIDSMPTE ANC SDID
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:
Sets the ANC data types of SDI signal, 4 types at most.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 //DID=0x61 and SDID=0x01 indicate to capture CC data.
6 MWCaptureSetSDIANCType(t_channel, 0, FALSE, TRUE, 0x61, 0x01);
7 ...
8 MWCloseChannel(t_channel);
void LIBMWCAPTURE_API MWCloseChannel ( HCHANNEL  hChannel)

Closes capture channel.

Parameters
[in]hChannelThe opened channel handle

Usage:
Closes the capture channel according to the channel handle of the capture device.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCloseChannel(t_channel);
HANDLE LIBMWCAPTURE_API MWCreateAudioCapture ( HCHANNEL  hChannel,
MWCAP_AUDIO_CAPTURE_NODE  captureNode,
DWORD  dwSamplesPerSec,
WORD  wBitsPerSample,
WORD  wChannels,
AUDIO_CAPTURE_CALLBACK  callback,
void *  pParam 
)

Create audio capture using the v4l function.

Parameters
[in]hChannelThe opened channel handle
[in]captureNodeAudio capture device type
[in]dwSamplesPerSecSampling rate
[in]wBitsPerSampleDepth
[in]wChannelschannels
[in]callbackThe callback function
[in]pParamThe parameter passed to the callback function
Returns
Returns the HANDLE value. Function return values are as follows.
Not null Function call succeeded. The device is ready to start to capture audio.
NULL Function call failed. Failed to start capturing.

Usage:
use v4l2, just support one channel. It is supported by all capture devices.

1 static void OnAudioCaptureCallback(const BYTE * pbFrame, int cbFrame, UINT64 u64TimeStamp, void* pParam)
2 {
3 ...
4 }
5 ...
6 ...
7 char path[128];
8 MWGetDevicePath(k,path);
9 HCHANNEL t_channel=MWOpenChannelByPath(path);
10 ...
11 HANDEL m_hAudio=NULL;
12 m_hAudio=MWCreateAudioCapture(t_channel, MWCAP_AUDIO_CAPTURE_NODE_DEFAULT, 48000, 16, 2, OnAudioCaptureCallback, this);
13 ...
14 MWDestoryAudioCapture(m_hAudio);
15 ...
16 MWCloseChannel(t_channel);
HANDLE LIBMWCAPTURE_API MWCreateVideoCapture ( HCHANNEL  hChannel,
int  nWidth,
int  nHeight,
int  nFourcc,
int  nFrameDuration,
VIDEO_CAPTURE_CALLBACK  callback,
void *  pParam 
)

Uses the v4l function to create video capture.

Parameters
[in]hChannelChannel handle opened
[in]nWidthWidth of video capture
[in]nHeightHeight of video capture
[in]nFourccColor format
[in]nFrameDurationFrame rate of video capture
[in]callbackCallback of video capture
[in]pParamThe parameter passed to the callback function
Returns
Returns a HANDLE type handle if succeeded, otherwise returns NULL
Not null Function call succeeded. The device is ready to start to capture videos.
NULL Function call failed. Failed to start capturing.

Usage:
Captures videos from the specified channel.

1 static void OnVideoCaptureCallback(BYTE *pbFrame, int cbFrame, UINT64 u64TimeStamp, void* pParam)
2 {
3 ...
4 }
5 ...
6 ...
7 char path[128];
8 MWGetDevicePath(k,path);
9 HCHANNEL t_channel=MWOpenChannelByPath(path);
10 ...
11 HANDEL m_hVideo=NULL;
12 m_hVideo= MWCreateVideoCapture(t_channel,1920, 1080, MWFOURCC_YUY2, 166667, OnVideoCaptureCallback, this);
13 ...
14 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWDestoryAudioCapture ( HANDLE  hAudio)

Stops audio capturing.

Parameters
[in]hAudioOpened audio capture 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).

Works with MWCreateAudioCapture or MWCreateAudioCaptureWithStdCallBack.

1 static void OnAudioCaptureCallback(const BYTE * pbFrame, int cbFrame, UINT64 u64TimeStamp, void* pParam)
2 {
3 ...
4 }
5 ...
6 ...
7 char path[128];
8 MWGetDevicePath(k,path);
9 HCHANNEL t_channel=MWOpenChannelByPath(path);
10 ...
11 HANDEL m_hAudio=NULL;
12 m_hAudio=MWCreateAudioCapture(t_channel, MWCAP_AUDIO_CAPTURE_NODE_DEFAULT, 48000, 16, 2, OnAudioCaptureCallback, this);
13 ...
14 MWDestoryAudioCapture(m_hAudio);
15 ...
16 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWDestoryVideoCapture ( HANDLE  hVideo)

Stops video capturing.

Parameters
[in]hVideoThe opened video capture 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:
Stops video capturing. Works with MWCreateVideoCapture or
MWCreateVideoCaptureWithStdCallBack.

1 static void OnVideoCaptureCallback(BYTE *pbFrame, int cbFrame, UINT64 u64TimeStamp, void* pParam)
2 {
3 ...
4 }
5 ...
6 ...
7 char path[128];
8 MWGetDevicePath(k,path);
9 HCHANNEL t_channel=MWOpenChannelByPath(path);
10 ...
11 HANDEL m_hVideo=NULL;
12 m_hVideo= MWCreateVideoCapture(t_channel,1920, 1080, MWFOURCC_YUY2, 166667, OnVideoCaptureCallback, this);
13 ...
14 MWDestoryVideoCapture (m_hVideo);
15 ...
16 MWCloseChannel(t_channel);
17 @encode
18 or \n
19 @code
20 static void __stdcall OnVideoCaptureCallback(BYTE *pbFrame, int cbFrame, UINT64 u64TimeStamp, void* pParam)
21 {
22 ...
23 }
24 ...
25 ...
26 char path[128];
27 MWGetDevicePath(k,path);
28 HCHANNEL t_channel=MWOpenChannelByPath(path);
29 ...
30 HANDEL m_hVideo=NULL;
31 m_hVideo= MWCreateVideoCaptureWithStdCallBack(t_channel,1920, 1080, MWFOURCC_YUY2, 166667, OnVideoCaptureCallback, this);
32 ...
33 MWDestoryVideoCapture (m_hVideo);
34 ...
35 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWEraseFirmwareData ( HCHANNEL  hChannel,
DWORD  cbOffset,
DWORD  cbErase 
)

Erases firmware data.

Parameters
[in]hChannelThe opened channel handle
[in]cbOffsetThe starting position of the data to erase
[in]cbEraseThe length of the data to erase
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:
Erases firmware data of specified channel/device. It is not recommended to call this API.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_FIRMWARE_STORAGE t_storage_info;
6 MWGetFirmwareStorageInfo(t_channel,& t_storage_info);
7 ...
8 MWEraseFirmwareData(t_channel, info.cbHeaderOffset, firmware.GetHeadLen());
9 ...
10 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioCaps ( HCHANNEL  hChannel,
MWCAP_AUDIO_CAPS pAudioCaps 
)

Gets audio capture capability of the channel.

Parameters
[in]hChannelChannel handle
[out]pAudioCapsA pointer to struct MWCAP_AUDIO_CAPS, which returns audio capture capability of the 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:

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_AUDIO_CAPS t_caps;
6 MWGetAudioCaps(t_channel,&t_caps);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSource ( HCHANNEL  hChannel,
DWORD *  pdwSource 
)

Gets current input audio source of the specified channel.

Parameters
[in]hChannelChannel handle
[out]pdwSourceReturns current input audio source.
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 current input audio of the specified channel. The definition of pdwSource refers to INPUT_TYPE.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 DWORD dwAudioInput = 0;
6 MWGetAudioInputSource(t_channel, &dwAudioInput);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSourceArray ( HCHANNEL  hChannel,
DWORD *  pdwInputSource,
DWORD *  pdwInputCount 
)

Gets the input audio signal types supported by the channel.

Parameters
[in]hChannelChannel handle
[out]pdwInputSourceReturns the input audio signal types supported by the channel. When being set to NULL, pdwInputCount returns the number of audio signal types supported by the channel.
[in,out]pdwInputCountAs an input parameter, it indicates the size of array that pdwInputSource points to. As an output parameter, it returns the number of audio signal types supported by the 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:

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 DWORD dwAudioInputCount = 0;
6 xr = MWGetAudioInputSourceArray(hChannel, NULL, &dwAudioInputCount);
7 if (xr == MW_SUCCEEDED && dwAudioInputCount > 0) {
8  DWORD* pAudioInput = new DWORD[dwAudioInputCount];
9  xr=MWGetAudioInputSourceArray(hChannel,pAudioInput,&dwAudioInputCount);
10  if (xr == MW_SUCCEEDED) {
11  char szInputName[16] = { 0 };
12  for (DWORD i = 0; i < dwAudioInputCount; i++) {
13  GetAudioInputName(pAudioInput[i], szInputName, 16);
14 ...
15  }
16  }
17  delete[] pAudioInput;
18 }
19 ...
20 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioSignalStatus ( HCHANNEL  hChannel,
MWCAP_AUDIO_SIGNAL_STATUS pSignalStatus 
)

Gets the audio signal status of specified channel.

Parameters
[in]hChannelChannel handle
[out]pSignalStatusA pointer to struct MWCAP_AUDIO_SIGNAL_STATUS, which returns the audio signal status.
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 the audio signal status of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_AUDIO_SIGNAL_STATUS t_audio_status;
6 MWGetAudioSignalStatus(t_channel, &t_audio_status);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioVolume ( HCHANNEL  hChannel,
MWCAP_AUDIO_NODE  audioNode,
MWCAP_AUDIO_VOLUME pVolume 
)

Gets the volume value of audio capture device.

Parameters
[in]hChannelChannel handle
[in]audioNodeAudio device type
[out]pVolumeReturns the volume of audio capture device
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 volume of audio capture device.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_AUDIO_VOLUME t_volume;
6 MWGetAudioVolume(t_channel, MWCAP_AUDIO_CAPTURE_NODE_DEFAULT, &t_volume);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAVInputSourceLink ( HCHANNEL  hChannel,
BOOLEAN *  pbLink 
)

Gets whether the input audio input source is related to video input source.

Parameters
[in]hChannelChannel handle
[out]pbLinkReturns whether the audio input source is related to the video input source
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 whether the audio input source is linked to video according to the channel handle. If it is TRUE, audio link video source is enabled by default. Which means when there are multiple input sources, the video input source will automate link its audio. If it returns FALSE, the video input would not match probably, you can use MWSetVideoInputSource and MWSetAudioInputSource to set the related link state.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_b_link;
6 MWGetAVInputSourceLink(t_channel,&t_b_link);
7 ...
8 MWCloseChannel(t_channel);
int LIBMWCAPTURE_API MWGetChannelCount ( )

Gets the total number of channels.

Returns
The total number of channels

Usage:

1 MWRefreshDevice();
2 int t_n_channel_count=MWGetChannelCount();
MW_RESULT LIBMWCAPTURE_API MWGetChannelInfo ( HCHANNEL  hChannel,
MWCAP_CHANNEL_INFO pChannelInfo 
)

Gets channel information.

Parameters
[in]hChannelThe Channel handle
[out]pChannelInfoChannel 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:

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_CHANNEL_INFO t_info;
6 MWGetChannelInfo(t_channel,&t_info);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetChannelInfoByIndex ( int  nIndex,
MWCAP_CHANNEL_INFO pChannelInfo 
)

Gets the channel info by its index.

Parameters
[in]nIndexChannel index, ranges from 0 to (MWGetChannelCount() - 1).
[out]pChannelInfoChannel infomation
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:

1 MWCAP_CHANNEL_INFO t_info;
2 MWGetChannelInfoByIndex(k,&t_info);
MW_RESULT LIBMWCAPTURE_API MWGetCustomVideoResolutions ( HCHANNEL  hChannel,
MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY paCustomResolutions 
)

Gets the custom resolutions in vga timing of specified channel.

Parameters
[in]hChannelChannel handle
[out]paCustomResolutionsCustom resolution array
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 the custom resolutions in vga timing of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY t_resolution;
6 MWGetCustomVideoResolutions(t_channel, &t_resolution);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetCustomVideoTimings ( HCHANNEL  hChannel,
MWCAP_VIDEO_CUSTOM_TIMING_ARRAY paCustomTimings 
)

Gets the custom vga timing of specified channel.

Parameters
[in]hChannelChannel handle
[out]paCustomTimingsCustom vga timing array
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 the custom vga timing of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_CUSTOM_TIMING_ARRAY t_timing;
6 MWGetCustomVideoTimings(t_channel, &t_timing);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetDevicePath ( int  nIndex,
char *  pDevicePath 
)

Gets the instance path of capture device based on the index.

Parameters
[in]nIndexChannel index, from 0 to (MWGetChannelCount() - 1)
[out]pDevicePathPath of the device
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 the instance path of capture device on its index

1 char path[128];
2 MWGetDevicePath(k,path);
MW_RESULT LIBMWCAPTURE_API MWGetEDID ( HCHANNEL  hChannel,
BYTE *  pbyData,
ULONG *  pulSize 
)

Gets the EDID of specified channel.

Parameters
[in]hChannelChannel handle
[out]pbyDataReturns EDID
[in,out]pulSizeAs input parameter, it indicates the memory size that pbyData points to. As output parameter, it returns the data length of EDID.
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 the EDID of specified channel.
EDID is supplied by HDMI capture device. It is invalid for other capture devices.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 ULONG ulSize = 256;
6 BYTE byData[256];
7 MWGetEDID(t_channel, byData, &ulSize);
8 ...
9 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetFamilyInfo ( HCHANNEL  hChannel,
LPVOID  pFamilyInfo,
DWORD  dwSize 
)

Gets attributions of product family which the capture device belongs to.

Parameters
[in]hChannelChannel handle
[out]pFamilyInfoReturns attributions of product family which the capture device belongs to.
[in]dwSizeThe size of the struct which pFamilyInfo points to.
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 attributions of product family which the capture device belongs to, according to its channel handle.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 //Pro:
6 MWCAP_PRO_CAPTURE_INFO t_pro_info;
7 MWGetFamilyInfo(t_channel,&t_pro_info,sizeof(MWCAP_PRO_CAPTURE_INFO));
8 //Eco:
9 MWCAP_ECO_CAPTURE_INFO t_eco_info;
10 MWGetFamilyInfo(t_channel,&t_t_eco_info,sizeof(MWCAP_ECO_CAPTURE_INFO));
11 //USB:
12 MWUSBCAP_CAPTURE_INFO t_usb_info;
13 MWGetFamilyInfo(t_channel,&t_usb_info,sizeof(MWUSBCAP_CAPTURE_INFO));
14 ...
15 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetFamilyInfoByIndex ( int  nIndex,
LPVOID  pFamilyInfo,
DWORD  dwSize 
)

Gets the product family based on the index.

Parameters
[in]nIndexChannel index, from 0 to (MWGetChannelCount() - 1)
[out]pFamilyInfoA pointer to the struct of MWCAP_PRO_CAPTURE_INFO, MWCAP_ECO_CAPTURE_INFO or MWUSBCAP_CAPTURE_INFO that returns the product family of your device.
[in]dwSizeThe size of the struct that the pFamilyInfo points to.
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 the product family of the device based on the index.
It is supported by the Pro/Eco/USB family.
Code for Pro capture family:

1 MWCAP_PRO_CAPTURE_INFO t_pro_info;
2 MWGetFamilyInfoByIndex(k,&t_pro_info,sizeof(MWCAP_PRO_CAPTURE_INFO));

Code for Eco capture family:

1 MWCAP_ECO_CAPTURE_INFO t_eco_info;
2 MWGetFamilyInfoByIndex(k,&t_t_eco_info,sizeof(MWCAP_ECO_CAPTURE_INFO));

Code for USB capture family:

1 MWUSBCAP_CAPTURE_INFO t_usb_info;
2 MWGetFamilyInfoByIndex(k,&t_usb_info,sizeof(MWUSBCAP_CAPTURE_INFO));
MW_RESULT LIBMWCAPTURE_API MWGetFirmwareStorageInfo ( HCHANNEL  hChannel,
MWCAP_FIRMWARE_STORAGE pFirmwareStorageInfo 
)

Gets firmware storage information.

Parameters
[in]hChannelThe opened channel handle
[out]pFirmwareStorageInfoA pointer to MWCAP_FIRMWARE_STORAGE, which returns firmware storage 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 firmware storage information of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_FIRMWARE_STORAGE t_storage_info;
6 MWGetFirmwareStorageInfo(t_channel,& t_storage_info);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetHDMIInfoFramePacket ( HCHANNEL  hChannel,
MWCAP_HDMI_INFOFRAME_ID  id,
HDMI_INFOFRAME_PACKET pPacket 
)

Gets HDMI InfoFrame data.

Parameters
[in]hChannelChannel handle
[in]idHDMI InfoFrame ID
[out]pPacketA pointer to struct HDMI_INFOFRAME_PACKET, which returns HDMI InfoFrame data.
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 data of HDMI InfoFrame.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 DWORD dwValidFlag = 0;
6 MWGetHDMIInfoFrameValidFlag(t_channel, &dwValidFlag);
7 HDMI_INFOFRAME_PACKET packet;
8 if (dwValidFlag & MWCAP_HDMI_INFOFRAME_MASK_AVI) {
9  xr= MWGetHDMIInfoFramePacket(t_channel, MWCAP_HDMI_INFOFRAME_ID_AVI, &packet);
10 }
11 else if(dwValidFlag & MWCAP_HDMI_INFOFRAME_MASK_AUDIO){
12  ...
13 }
14 ...
15 ...
16 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetHDMIInfoFrameValidFlag ( HCHANNEL  hChannel,
DWORD *  pdwValidFlag 
)

Gets valid flag of HDMI InfoFrame.

Parameters
[in]hChannelChannel handle
[out]pdwValidFlagReturns valid flag of HDMI InfoFrame
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 valid flag of HDMI InfoFrame. Only supported by HDMI capture devices, other devices are not supported.
The value of pdwValidFlag refers to MWCAP_HDMI_INFOFRAME_MASK.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 DWORD dwValidFlag = 0;
6 MWGetHDMIInfoFrameValidFlag(t_channel, &dwValidFlag);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetInputSourceScan ( HCHANNEL  hChannel,
BOOLEAN *  pbScan 
)

Gets the scan state of input source.

Parameters
[in]hChannelChannel handle
[out]pbScanThe return value indicates whether it is in scanning. 1 indicates true, AutoScan; 0 indicates false, not Autoscan.
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 the scan state of input source. That is whether the input source is automatically scanned. If multiple sources are connected, the device will automatically capture the valid one.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_b_scan;
6 MWGetInputSourceScan(t_channel,&t_b_scan);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetInputSourceScanState ( HCHANNEL  hChannel,
BOOLEAN *  pbInputSourceScanning 
)

Gets whether to scan the input signal source of specified channel automatically.

Parameters
[in]hChannelChannel handle
[out]pbInputSourceScanningWhether to scan the input signal resource
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 whether to scan the input signal resources of specified channel automatically.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_b_scan;
6 MWGetInputSourceScanState(t_channel, &t_b_scan);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetInputSpecificStatus ( HCHANNEL  hChannel,
MWCAP_INPUT_SPECIFIC_STATUS pInputStatus 
)

Gets the specific status of input signal.

Parameters
[in]hChannelChannel handle
[out]pInputStatusA pointer to struct MWCAP_INPUT_SPECIFIC_STATUS, which returns the input signal 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 the detailed state of specified input source.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_INPUT_SPECIFIC_STATUS t_status;
6 MWGetInputSpecificStatus(t_channel, &t_status);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetPreferredVideoTimings ( HCHANNEL  hChannel,
MWCAP_VIDEO_TIMING_ARRAY paTimings 
)

Gets the preffered vga timing array of specified channel.

Parameters
[in]hChannelChannel handle
[out]paTimingsTiming array
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 the preffered vga timing array of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_TIMING_ARRAY t_array;
6 MWGetPreferredVideoTimings(t_channel, &t_array);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVersion ( BYTE *  pbyMaj,
BYTE *  pbyMin,
WORD *  pwBuild 
)

Gets the version number of SDK.

Parameters
[out]pbyMajMajor version number
[out]pbyMinMinor version number
[out]pwBuildBuild version number
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
Always returns MW_SUCCEEDED, but the specified version number would not be filled in if an invalid value is input.

Usage:
Calls the API wherever you need, even before the MWCaptureInitInstance().

MW_RESULT LIBMWCAPTURE_API MWGetVideoAutoHAlign ( HCHANNEL  hChannel,
BOOLEAN *  pbAutoHAlign 
)

Gets whether to adjust horizontal alignment of the vga timing automatically.

Parameters
[in]hChannelChannel handle
[out]pbAutoHAlignWhether to adjust horizontal automatically
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 whether to adjust horizontal alignment of the vga timing automatically.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_auto_h=FALSE;
6 MWGetVideoAutoHAlign(t_channel, &t_auto_h);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaps ( HCHANNEL  hChannel,
MWCAP_VIDEO_CAPS pVideoCaps 
)

Gets video capture capability of the specified channel.

Parameters
[in]hChannelChannel handle
[out]pVideoCapsA pointer to struct MWCAP_VIDEO_CAPS, which returns video capture capability of the 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:

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_CAPS t_caps;
6 MWGetVideoCaps(t_channel,&t_caps);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureConnectionFormat ( HCHANNEL  hChannel,
MWCAP_VIDEO_CONNECTION_FORMAT pConnFormat 
)

Gets the connection format of capture pin.

Parameters
[in]hChannelChannel handle
[out]paConnectionFormatConnection format
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:

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_CONNECTION_FORMAT t_format;
6 MWGetVideoCaptureConnectionFormat(t_channel, &t_format);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureProcessSettings ( HCHANNEL  hChannel,
MWCAP_VIDEO_PROCESS_SETTINGS paProcessSettings 
)

Gets the video process settings of specified channel.

Parameters
[in]hChannelChannel handle
[out]paProcessSettingsVideo process settings
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 the video process parameters of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_PROCESS_SETTINGS t_b_setting;
6 MWGetVideoCaptureProcessSettings(t_channel, &t_b_setting);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportColorFormat ( HCHANNEL  hChannel,
DWORD *  pColorFourcc,
int *  nCount 
)

Uses v4l2 to get the device supported color spaces.

Parameters
[in]hChannelThe opened channel handle
[out]pColorFourccReturns the device supported color spaces. For details, see MWFOURCC.h. When being set to NULL, the returned value is the number of device supported color spaces.
[out]nCountThe number of color formats supported by the capture device.
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 capture formats supported by devices.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 int t_n_count=0;
6 MWGetVideoCaptureSupportFormat(t_channel,NULL,&t_n_count);
7 if(t_n_count>0){
8  DWORD* t_p_format=new DWORD[t_n_count];
9  MWGetVideoCaptureSupportColorFormat(t_channel,t_p_format,&t_n_count);
10 }
11 ...
12 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportListResolution ( HCHANNEL  hChannel,
MWCAP_VIDEO_RESOLUTION_LIST pList 
)

Gets resolutions supported by devices when the return mode of MWGetVideoCaptureSupportResolutionMode is MWCAP_VIDEO_RESOLUTION_MODE_LIST.

Parameters
[in]hChannelThe opened channel handle
[out]pListSupported discrete resolution values
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:

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 int t_n_count=0;
6 MWCAP_VIDEO_RESOLUTION_MODE t_mode;
7 MWGetVideoCaptureSupportResolutionMode(t_channel,&t_mode,&t_n_count);
8 if(t_mode == MWCAP_VIDEO_RESOLUTION_MODE_LIST){
9  MWCAP_VIDEO_RESOLUTION_LIST* t_p_list = new MWCAP_VIDEO_RESOLUTION_LIST[t_n_count];
10  MWGetVideoCaptureSupportListResolution(t_channel,t_p_list);
11  ...
12 }
13 ...
14 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportRangeResolution ( HCHANNEL  hChannel,
MWCAP_VIDEO_RESOLUTION_RANGE pRange 
)

Gets resolution range supported by the device, when the return mode of MWGetVideoCaptureSupportResolutionMode is MWCAP_VIDEO_RESOLUTION_MODE_RANGE.

Parameters
[in]hChannelThe opened channel handle
[out]pRangeSupported resolution 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:

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 int t_n_count=0;
6 MWCAP_VIDEO_RESOLUTION_MODE t_mode;
7 MWGetVideoCaptureSupportResolutionMode(t_channel,&t_mode,&t_n_count);
8 if(t_mode == MWCAP_VIDEO_RESOLUTION_MODE_RANGE){
9  MWCAP_VIDEO_RESOLUTION_RANGE t_range;
10  MWGetVideoCaptureSupportRangeResolution(hChannel,&t_range);
11  ...
12 }
13 ...
14 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportResolutionMode ( HCHANNEL  hChannel,
MWCAP_VIDEO_RESOLUTION_MODE pMode,
int *  pCount 
)

Gets resolution mode supported by devices, including MWCAP_VIDEO_RESOLUTION_MODE_LIST when the resolutions are discrete values, and MWCAP_VIDEO_RESOLUTION_MODE_RANGE when the resolutions are continuous values.

Parameters
[in]hChannelThe opened channel handle
[out]pModeReturns the device supported resolution mode: MWCAP_VIDEO_RESOLUTION_MODE_LIST, MWCAP_VIDEO_RESOLUTION_MODE_RANGE.
[out]pCountOnly available when the mode is MWCAP_VIDEO_RESOLUTION_MODE_LIST, indicates the device supported number of resolutions.
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:

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 int t_n_count=0;
6 MWCAP_VIDEO_RESOLUTION_MODE t_mode;
7 MWGetVideoCaptureSupportResolutionMode(t_channel,&t_mode,&t_n_count);
8 ...
9 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputAspectRatio ( HCHANNEL  hChannel,
int *  pnAspectX,
int *  pnAspectY 
)

Gets aspect ratio of input video source.

Parameters
[in]hChannelThe opened channel handle
[out]pnAspectXThe returned width of aspect ratio
[out]pnAspectYThe returned height of aspect ratio
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 aspect ratio of specified input video source.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 int t_aspect_x = 0;
6 int t_aspect_y = 0;
7 MWGetVideoInputAspectRatio(t_channel, &t_aspect_x, &t_aspect_y);
8 ...
9 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputColorFormat ( HCHANNEL  hChannel,
MWCAP_VIDEO_COLOR_FORMAT pColorFormat 
)

Gets color format of input video.

Parameters
[in]hChannelThe opened channel handle
[out]pColorFormatA pointer to MWCAP_VIDEO_COLOR_FORMAT, which returns color format value
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 color format of specified input channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_COLOR_FORMAT t_colorformat;
6 MWGetVideoInputColorFormat (t_channel,&t_colorformat);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputQuantizationRange ( HCHANNEL  hChannel,
MWCAP_VIDEO_QUANTIZATION_RANGE pQuantRange 
)

Gets quantization range of input video.

Parameters
[in]hChannelThe opened channel handle
[out]pQuantRangeA pointer to MWCAP_VIDEO_QUANTIZATION_RANGE, which returns the quantization range value
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 quantization range of specified input channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_QUANTIZATION_RANGE t_quantrange;
6 MWGetVideoInputQuantizationRange(t_channel,&t_quantrange);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputSource ( HCHANNEL  hChannel,
DWORD *  pdwSource 
)

Gets current video input source of the channel.

Parameters
[in]hChannelChannel handle
[out]pdwSourceReturns current video input source
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 current video input source of the channel.
The definition of pdwSource refers to MWCAP_VIDEO_INPUT_TYPE.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 DWORD dwVideoInput = 0;
6 MWGetVideoInputSource(t_channel, &dwVideoInput);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputSourceArray ( HCHANNEL  hChannel,
DWORD *  pdwInputSource,
DWORD *  pdwInputCount 
)

Gets the input video signal types supported by the channel.

Parameters
[in]hChannelChannel handle
[out]pdwInputSourceReturns the input video signal types supported by the channel. When being set to NULL, pdwInputCount returns the number of video signal types supported by the channel.
[in,out]pdwInputCountAs an input parameter, it indicates the size of array that pdwInputSource points to. As an output parameter, it returns the number of video signal types supported by the 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:

1  .
2 char path[128];
3 MWGetDevicePath(k,path);
4 HCHANNEL t_channel=MWOpenChannelByPath(path);
5 ...
6 DWORD dwVideoInputCount = 0;
7 MW_RESULT xr = MWGetVideoInputSourceArray(hChannel, NULL, &dwVideoInputCount);
8 if (xr == MW_SUCCEEDED && dwVideoInputCount > 0) {
9  DWORD* pVideoInput = new DWORD[dwVideoInputCount];
10  xr=MWGetVideoInputSourceArray(hChannel,pVideoInput, &dwVideoInputCount);
11  if (xr == MW_SUCCEEDED) {
12  char szInputName[16] = { 0 };
13  for (DWORD i = 0; i < dwVideoInputCount; i++) {
14  GetVideoInputName(pVideoInput[i], szInputName, 16);
15  printf("[%d] %s\n", i, szInputName);
16  }
17  }
18  delete[] pVideoInput;
19 }
20 ...
21 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoProcParam ( HANDLE  hVideo,
MWCAP_VIDEO_PROC_PARAM_TYPE  videoProcParamType,
long *  plParamValue 
)

Gets current video processing settings.

Parameters
[in]hVideoOpened video capture channel handle
[in]videoProcParamTypeVideo processing parameters, including brightness, contrast, hue, saturation.
[out]plParamValueThe returned default value
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:

1 static void OnVideoCaptureCallback(BYTE *pbFrame, int cbFrame, UINT64 u64TimeStamp, void* pParam)
2 {
3 ...
4 }
5 ...
6 ...
7 char path[128];
8 MWGetDevicePath(k,path);
9 HCHANNEL t_channel=MWOpenChannelByPath(path);
10 ...
11 HANDEL m_hVideo=NULL;
12 m_hVideo= MWCreateVideoCapture(t_channel,1920, 1080, MWFOURCC_YUY2, 166667, OnVideoCaptureCallback, this);
13 ...
14 long t_l_val=0;
15 MWGetVideoProcParam(m_hVideo,MWCAP_VIDEO_PROC_BRIGHTNESS,&t_l_val);
16 ...
17 MWDestoryVideoCapture (m_hVideo);
18 ...
19 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoProcParamRange ( HANDLE  hVideo,
MWCAP_VIDEO_PROC_PARAM_TYPE  videoProcParamType,
long *  plParamValueMin,
long *  plParamValueMax,
long *  plParamValueDef 
)

Gets range of video processing parameters.

Parameters
[in]hVideoThe opened video capture handle
[in]videoProcParamTypeVideo processing parameter type, including brightness, contrast, hue, saturation.
[out]plParamValueMinThe returned minimum value
[out]plParamValueMaxThe returned maximum value
[out]plParamValueDefThe returned default value
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:

1 static void OnVideoCaptureCallback(BYTE *pbFrame, int cbFrame, UINT64 u64TimeStamp, void* pParam)
2 {
3 ...
4 }
5 ...
6 ...
7 char path[128];
8 MWGetDevicePath(k,path);
9 HCHANNEL t_channel=MWOpenChannelByPath(path);
10 ...
11 HANDEL m_hVideo=NULL;
12 m_hVideo= MWCreateVideoCapture(t_channel,1920, 1080, MWFOURCC_YUY2, 166667, OnVideoCaptureCallback, this);
13 ...
14 long t_l_min=0;
15 long t_l_max=0;
16 long t_l_def=0;
17 MWGetVideoProcParamRange(m_hVideo,MWCAP_VIDEO_PROC_BRIGHTNESS,&t_l_min,&t_l_max,&t_l_def);
18 ...
19 MWDestoryVideoCapture (m_hVideo);
20 ...
21 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoSamplingPhase ( HCHANNEL  hChannel,
BYTE *  puSamplingPhase 
)

Gets the phase of the specified input vga timing.

Parameters
[in]hChannelThe opened channel handle
[out]puSamplingPhasePhase
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 the phase of the specified input vga timing.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BYTE t_phase=0;
6 MWGetVideoSamplingPhase(t_channel, &t_phase);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoSamplingPhaseAutoAdjust ( HCHANNEL  hChannel,
BOOLEAN *  pbAutoSamplingPhase 
)

Gets whether to adjust the phase of the specified input vga timing automatically.

Parameters
[in]hChannelChannel handle
[out]pbAutoSamplingPhaseReturns whether to automatically adjust the phase of vga timing sampling
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 whether to adjust the phase of the specified vga timing automatically.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_auto=FALSE;
6 MWGetVideoSamplingPhaseAutoAdjust(t_channel, &t_auto);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoSignalStatus ( HCHANNEL  hChannel,
MWCAP_VIDEO_SIGNAL_STATUS pSignalStatus 
)

Gets video signal status of specified channel.

Parameters
[in]hChannelChannel handle
[out]pSignalStatusA pointer to struct MWCAP_VIDEO_SIGNAL_STATUS, which returns video signal status.
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 the video signal status of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_SIGNAL_STATUS t_video_status;
6 MWGetVideoSignalStatus(t_channel, &t_video_status);
7 ...
8 MWCloseChannel(t_channel);
HCHANNEL LIBMWCAPTURE_API MWOpenChannelByPath ( const char *  pszDevicePath)

Opens capture channel by device instance path.

Parameters
[in]pszDevicePathDevice instance path
Returns
Returns channel handle if the API call succeeded, otherwise returns NULL.

Usage:
Opens capture channel according to device instance path. Gets ready for work.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
MW_RESULT LIBMWCAPTURE_API MWReadFirmwareData ( HCHANNEL  hChannel,
DWORD  cbOffset,
BYTE *  pbyData,
DWORD  cbToRead,
DWORD *  pcbRead 
)

Read firmware data from specified channel.

Parameters
[in]hChannelThe opened channel handle
[in]cbOffsetThe starting position of the data to read
[out]pbyDataReturns the read data
[in]cbToReadThe data length to read
[out]pcbReadReturns the actual length of the read data
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:
Reads the firmware data from specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_FIRMWARE_STORAGE t_storage_info;
6 MWGetFirmwareStorageInfo(t_channel,& t_storage_info);
7 ...
8 MWReadFirmwareData(t_channel,info.cbHeaderOffset+sizeof(MW_FIRMWARE_INFO_HEADER), (BYTE*)header.aSectionHeaders, cbSectionHeaders, &cbRead)
9 ...
10 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWRefreshDevice ( )

Refreshes device list.

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:
Calls the API to refresh device list when the connected devices changed.

MW_RESULT LIBMWCAPTURE_API MWSetAudioInputSource ( HCHANNEL  hChannel,
DWORD  dwSource 
)

Sets current audio input source of specified channel.

Parameters
[in]hChannelChannel handle
[in]dwSourceSets current audio input source
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:
Sets current audio input source of specified channel.
The definition of dwSource refers to INPUT_TYPE.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 DWORD dwAudioInput =INPUT_TYPE(MWCAP_AUDIO_INPUT_TYPE_HDMI, 0);
6 MWSetAudioInputSource(hChannel, dwAudioInput);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetAudioVolume ( HCHANNEL  hChannel,
MWCAP_AUDIO_NODE  audioNode,
MWCAP_AUDIO_VOLUME pVolume 
)

Sets the volume of audio capture device.

Parameters
[in]hChannelChannel handle
[in]audioNodeAudio device type
[in]pVolumeThe volume of audio capture device
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:
Sets the volume of audio capture device.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_AUDIO_VOLUME t_volume;
6 MWGetAudioVolume(t_channel, MWCAP_AUDIO_CAPTURE_NODE_DEFAULT, &t_volume);
7 ...
8 for(int i=0;i<MWCAP_MAX_NUM_AUDIO_CHANNEL;i++){
9  t_volume.asVolume[i]=t_volume.sVolumeMax;
10 }
11 MWSetAudioVolume(t_channel, MWCAP_AUDIO_CAPTURE_NODE_DEFAULT, &t_volume);
12 ...
13 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetAVInputSourceLink ( HCHANNEL  hChannel,
BOOLEAN  bLink 
)

Sets whether the input video source is linked to its audio automatically.

Parameters
[in]hChannelChannel handle
[in]bLinkSets whether the audio input source link the video input source
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:
Sets whether the audio input source link the video input source automatically.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_b_link;
6 MWSetAVInputSourceLink(t_channel,t_b_link);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoResolutions ( HCHANNEL  hChannel,
MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY paCustomResolutions 
)

Sets the custom resolutions in vga timing of specified channel.

Parameters
[in]hChannelChannel handle
[in]paCustomResolutionsCustom resolution array
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:
Sets the custom resolutions in vga timing of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY t_resolution;
6 t_resolution.byNumCustomResolutions=8;
7 for(int i=0;i<8;i++){
8  t_resolution.aCustomResolutions[i].cx=...;
9  t_resolution.aCustomResolutions[i].cy=...;
10 }
11 MWSetCustomVideoResolutions(t_channel, &t_resolution);
12 ...
13 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoTiming ( HCHANNEL  hChannel,
MWCAP_VIDEO_CUSTOM_TIMING pCustomTiming 
)

Sets the custom vga timing of specified channel.

Parameters
[in]hChannelChannel handle
[in]pCustomTimingCustom timing
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:
Sets the custom vga timing of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_CUSTOM_TIMING t_timing;
6 //set t_timing
7 ...
8 MWSetCustomVideoTiming(t_channel, &t_timing);
9 ...
10 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetCustomVideoTimings ( HCHANNEL  hChannel,
MWCAP_VIDEO_CUSTOM_TIMING_ARRAY paCustomTimings 
)

Sets the custom vga timing array of specified channel.

Parameters
[in]hChannelChannel handle
[out]paCustomTimingsCustom timings array
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:
Sets the custom vga timing array of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_CUSTOM_TIMING_ARRAY t_timing;
6 t_timing.byNumCustomTimings=8;
7 for(int i=0;i<8;i++){
8  T_timing.aCustomTimings[i]=...;
9 ...
10 }
11 MWSetCustomVideoTimings(t_channel, &t_timing);
12 ...
13 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetEDID ( HCHANNEL  hChannel,
BYTE *  pbyData,
ULONG  ulSize 
)

Sets EDID of specified channel.

Parameters
[in]hChannelChannel handle
[in]pbyDataNew EDID
[in]ulSizeData length of EDID
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:
EDID is supplied by HDMI capture device. The API is invalid for other capture devices when being called.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 ULONG ulSize = 256;
6 BYTE byData[256];
7 MWGetEDID(t_channel, byData, &ulSize);
8 ...
9 MWSetEDID(t_channel,byData,ulSize);
10 ...
11 MWCloseChannel(t_channel);

Make sure you are familiar with EDID when you use this API. Otherwise we do not recommend you to use it.

MW_RESULT LIBMWCAPTURE_API MWSetInputSourceScan ( HCHANNEL  hChannel,
BOOLEAN  bScan 
)

Sets the scan state of input source.

Parameters
[in]hChannelChannel handle
[in]bScanIndicates the scanned states. 1 indicates true, AutoScan; 0 indicates false, not Autoscans.
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:
Sets whether to automatically scan the input interface captured channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_b_scan;
6 MWSetInputSourceScan(t_channel,t_b_scan);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetLEDMode ( HCHANNEL  hChannel,
DWORD  dwMode 
)

Sets LED mode.

Parameters
[in]hChannelThe opened channel handle
[in]dwModeLED mode. For details, see MWCAP_LED_MODE.
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:
Sets LED flash mode of specified channel.
For detailed information of dwMode value, see MWCAP_LED_MODE.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 DWORD t_dw_mode=MWCAP_LED_DBL_BLINK;
6 MWSetLEDMode(t_channel,t_dw_mode);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetPostReconfig ( HCHANNEL  hChannel,
DWORD  dwDelayMS 
)

Sends instructions for rereading configurations to delay the execution.

Parameters
[in]hChannelOpened channel handle
[in]dwDelayMSDelay time in milliseconds
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:
Rereads configurations
Be cautious when using it.

MW_RESULT LIBMWCAPTURE_API MWSetVideoAutoHAlign ( HCHANNEL  hChannel,
BOOLEAN  bAutoHAlign 
)

Sets whether to adjust horizontal alignment of the vga timing automatically.

Parameters
[in]hChannelChannel handle
[in]bAutoHAlignWhether to adjust horizontal alignment of the vga timing automatically
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:
Sets whether to adjust horizontal alignment of the vga timing automatically.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_auto_h=FALSE;
6 MWSetVideoAutoHAlign(t_channel, t_auto_h);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoCaptureProcessSettings ( HCHANNEL  hChannel,
MWCAP_VIDEO_PROCESS_SETTINGS paProcessSettings 
)

Sets the video process parameters of specified channel.

Parameters
[in]hChannelChannel handle
[in]paProcessSettingsVideo process parameters
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:
Sets the video process parameters of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_PROCESS_SETTINGS t_b_setting;
6 t_b_setting.xx=...;
7 ...
8 ...
9 MWSetVideoCaptureProcessSettings(t_channel, &t_b_setting);
10 ...
11 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputAspectRatio ( HCHANNEL  hChannel,
int  nAspectX,
int  nAspectY 
)

Sets aspect ratio of input video source.

Parameters
[in]hChannelThe opened channel handle
[in]nAspectXwidth
[in]nAspectYHeight
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:
Sets aspect ratio of specified input video source. It works with the other video processing parameters.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 int t_aspect_x = 4;
6 int t_aspect_y = 3;
7 MWSetVideoInputAspectRatio(t_channel, t_aspect_x, t_aspect_y);
8 ...
9 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputColorFormat ( HCHANNEL  hChannel,
MWCAP_VIDEO_COLOR_FORMAT  colorFormat 
)

Sets color format of input video.

Parameters
[in]hChannelThe opened channel handle
[in]colorFormatColor format
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:
Sets color format of specified input channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_COLOR_FORMAT t_colorformat;
6 t_colorformat=MWCAP_VIDEO_COLOR_FORMAT_YUV709;
7 MWSetVideoInputColorFormat (t_channel, t_colorformat);
8 ...
9 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputQuantizationRange ( HCHANNEL  hChannel,
MWCAP_VIDEO_QUANTIZATION_RANGE  quantRange 
)

Sets quantization range of input video.

Parameters
[in]hChannelThe opened channel handle
[in]quantRangeQuantization 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:
Sets quantization range of specified input channel

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_QUANTIZATION_RANGE t_quantrange;
6 t_quantrange=MWCAP_VIDEO_QUANTIZATION_LIMITED
7 MWSetVideoInputQuantizationRange(t_channel,t_quantrange);
8 ...
9 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputSource ( HCHANNEL  hChannel,
DWORD  dwSource 
)

Sets the video input source of the specified channel.

Parameters
[in]hChannelChannel handle
[in]dwSourceSets current video input source
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:
Sets the video input source of the specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 DWORD dwVideoInput = 0;
6 dwVideoInput=INPUT_SOURCE(MWCAP_VIDEO_INPUT_TYPE_HDMI, 0);
7 MWSetVideoInputSource(t_channel, &dwVideoInput);
8 ...
9 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoProcParam ( HANDLE  hVideo,
MWCAP_VIDEO_PROC_PARAM_TYPE  videoProcParamType,
long  lParamValue 
)

Sets the specified video processing parameters.

Parameters
[in]hVideoThe opened video channel handle
[in]videoProcParamTypeVideo processing parameter type, including brightness, contrast, hue, saturation.
[in]lParamValueThe set value, which should be within the range of parameters.
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:

1 static void OnVideoCaptureCallback(BYTE *pbFrame, int cbFrame, UINT64 u64TimeStamp, void* pParam)
2 {
3 ...
4 }
5 ...
6 ...
7 char path[128];
8 MWGetDevicePath(k,path);
9 HCHANNEL t_channel=MWOpenChannelByPath(path);
10 ...
11 HANDEL m_hVideo=NULL;
12 m_hVideo= MWCreateVideoCapture(t_channel,1920, 1080, MWFOURCC_YUY2, 166667, OnVideoCaptureCallback, this);
13 ...
14 long t_l_min=0;
15 long t_l_max=0;
16 long t_l_def=0;
17 MWGetVideoProcParamRange(m_hVideo,MWCAP_VIDEO_PROC_BRIGHTNESS,&t_l_min,&t_l_max,&t_l_def);
18 long t_l_val=0;
19 MWGetVideoProcParam(m_hVideo,MWCAP_VIDEO_PROC_BRIGHTNESS,&t_l_val);
20 long t_l_setval = t_l_max;
21 MWSetVideoProcParam(m_hVideo,MWCAP_VIDEO_PROC_BRIGHTNESS,t_l_setval);
22 ...
23 MWDestoryVideoCapture (m_hVideo);
24 ...
25 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoSamplingPhase ( HCHANNEL  hChannel,
BYTE  puSamplingPhase 
)

Sets the phase of the specified input vga timing.

Parameters
[in]hChannelChannel handle
[in]puSamplingPhasePhase
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:
Sets the phase of the specified input vga timing.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BYTE t_phase=0;
6 MWSetVideoSamplingPhase(t_channel, t_phase);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoSamplingPhaseAutoAdjust ( HCHANNEL  hChannel,
BOOLEAN  bAutoSamplingPhase 
)

Sets whether to automatically adjust the phase of vga timing sampling.

Parameters
[in]hChannelChannel handle
[in]bAutoSamplingPhaseWhether to adjust the phase of the specified vga timing automatically
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:
Sets whether to automatically adjust the phase of vga timing sampling.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 BOOLEAN t_auto=FALSE;
6 MWSetVideoSamplingPhaseAutoAdjust(t_channel,t_auto);
7 ...
8 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoTiming ( HCHANNEL  hChannel,
MWCAP_VIDEO_TIMING pTiming 
)

Sets the vga timing of specified channel.

Parameters
[in]hChannelChannel handle
[in]pTimingTiming
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:
Sets the vga timing of specified channel.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_VIDEO_TIMING_ARRAY t_array;
6 MWGetPreferredVideoTimings(t_channel, &t_array);
7 MWSetVideoTiming(t_channel,t_array.aTimings[0]);
8 ...
9 MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWWriteFirmwareData ( HCHANNEL  hChannel,
DWORD  cbOffset,
BYTE *  pbyData,
DWORD  cbData 
)

Writes firmware data to specified channel.

Parameters
[in]hChannelThe opened channel handle
[in]cbOffsetThe starting position of the data to write
[in]pbyDataThe data to write
[in]cbDataThe data length to write
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:
Writes firmware data to specified channel(device). We do not recommend you to call this API.

1 char path[128];
2 MWGetDevicePath(k,path);
3 HCHANNEL t_channel=MWOpenChannelByPath(path);
4 ...
5 MWCAP_FIRMWARE_STORAGE t_storage_info;
6 MWGetFirmwareStorageInfo(t_channel,& t_storage_info);
7 ...
8 MWWriteFirmwareData(t_channel, info.cbHeaderOffset, (BYTE*)firmware.GetHead(), firmware.GetHeadLen())
9 ...
10 MWCloseChannel(t_channel);