MWCapture SDK Mac  3.4.62314
Functions
Universal Functions

Functions

MW_RESULT LIBMWCAPTURE_API MWGetVersion (BYTE *pbyMaj, BYTE *pbyMin, WORD *pwBuild)
 Gets the version number of SDK.
 
BOOL LIBMWCAPTURE_API MWCaptureInitInstance ()
 Initializes the MWCapture interfaces.
 
void LIBMWCAPTURE_API MWCaptureExitInstance ()
 Quits instance.
 
MW_RESULT LIBMWCAPTURE_API MWRefreshDevice ()
 Refreshes device list.
 
int LIBMWCAPTURE_API MWGetChannelCount ()
 Gets the total number of channels.
 
MW_RESULT LIBMWCAPTURE_API MWGetChannelInfoByIndex (int nIndex, MWCAP_CHANNEL_INFO *pChannelInfo)
 Gets the channel info by its index.
 
MW_RESULT LIBMWCAPTURE_API MWGetFamilyInfoByIndex (int nIndex, LPVOID pFamilyInfo, DWORD dwSize)
 Gets the product family based on the index.
 
MW_RESULT LIBMWCAPTURE_API MWGetDevicePath (int nIndex, char *pDevicePath)
 Gets the instance path of capture device based on the index.
 
HCHANNEL LIBMWCAPTURE_API MWOpenChannelByPath (const char *pszDevicePath)
 Opens capture channel by device instance path.
 
void LIBMWCAPTURE_API MWCloseChannel (HCHANNEL hChannel)
 Closes capture channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetChannelInfo (HCHANNEL hChannel, MWCAP_CHANNEL_INFO *pChannelInfo)
 Gets channel information.
 
MW_RESULT LIBMWCAPTURE_API MWGetFamilyInfo (HCHANNEL hChannel, LPVOID pFamilyInfo, DWORD dwSize)
 Gets attributions of product family which the capture device belongs to.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaps (HCHANNEL hChannel, MWCAP_VIDEO_CAPS *pVideoCaps)
 Gets video capture capability of the specified channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioCaps (HCHANNEL hChannel, MWCAP_AUDIO_CAPS *pAudioCaps)
 Gets audio capture capability of the channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputSourceArray (HCHANNEL hChannel, DWORD *pdwInputSource, DWORD *pdwInputCount)
 Gets the input video signal types supported by the channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSourceArray (HCHANNEL hChannel, DWORD *pdwInputSource, DWORD *pdwInputCount)
 Gets the input audio signal types supported by the channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetInputSourceScan (HCHANNEL hChannel, BOOLEAN *pbScan)
 Gets the scan state of input source.
 
MW_RESULT LIBMWCAPTURE_API MWSetInputSourceScan (HCHANNEL hChannel, BOOLEAN bScan)
 Sets the states of scanned input video source.
 
MW_RESULT LIBMWCAPTURE_API MWGetAVInputSourceLink (HCHANNEL hChannel, BOOLEAN *pbLink)
 Gets the states of input audio/video sources.
 
MW_RESULT LIBMWCAPTURE_API MWSetAVInputSourceLink (HCHANNEL hChannel, BOOLEAN bLink)
 Sets whether the input video source is linked to its audio automatically.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputSource (HCHANNEL hChannel, DWORD *pdwSource)
 Gets current video input source of the channel.
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputSource (HCHANNEL hChannel, DWORD dwSource)
 Sets the video input source of the specified channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSource (HCHANNEL hChannel, DWORD *pdwSource)
 Gets current input audio of the specified channel.
 
MW_RESULT LIBMWCAPTURE_API MWSetAudioInputSource (HCHANNEL hChannel, DWORD dwSource)
 Sets current audio input source of specified channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetEDID (HCHANNEL hChannel, BYTE *pbyData, ULONG *pulSize)
 Gets the EDID of specified channel.
 
MW_RESULT LIBMWCAPTURE_API MWSetEDID (HCHANNEL hChannel, BYTE *pbyData, ULONG ulSize)
 Sets EDID of specified channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetInputSpecificStatus (HCHANNEL hChannel, MWCAP_INPUT_SPECIFIC_STATUS *pInputStatus)
 Gets the specific status of input signal.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoSignalStatus (HCHANNEL hChannel, MWCAP_VIDEO_SIGNAL_STATUS *pSignalStatus)
 Gets video signal status of specified channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioSignalStatus (HCHANNEL hChannel, MWCAP_AUDIO_SIGNAL_STATUS *pSignalStatus)
 Gets the audio signal status of specified channel.
 
MW_RESULT LIBMWCAPTURE_API MWGetHDMIInfoFrameValidFlag (HCHANNEL hChannel, DWORD *pdwValidFlag)
 Gets valid flag of HDMI InfoFrame.
 
MW_RESULT LIBMWCAPTURE_API MWGetHDMIInfoFramePacket (HCHANNEL hChannel, MWCAP_HDMI_INFOFRAME_ID id, HDMI_INFOFRAME_PACKET *pPacket)
 Gets HDMI InfoFrame data.
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputAspectRatio (HCHANNEL hChannel, int nAspectX, int nAspectY)
 Sets aspect ratio of input video.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputAspectRatio (HCHANNEL hChannel, int *pnAspectX, int *pnAspectY)
 Gets aspect ratio of input video.
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputColorFormat (HCHANNEL hChannel, MWCAP_VIDEO_COLOR_FORMAT colorFormat)
 Sets color format of input video.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputColorFormat (HCHANNEL hChannel, MWCAP_VIDEO_COLOR_FORMAT *pColorFormat)
 Gets color format of input video.
 
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputQuantizationRange (HCHANNEL hChannel, MWCAP_VIDEO_QUANTIZATION_RANGE quantRange)
 Sets quantization range of input video.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputQuantizationRange (HCHANNEL hChannel, MWCAP_VIDEO_QUANTIZATION_RANGE *pQuantRange)
 Gets quantization range of input video.
 
MW_RESULT LIBMWCAPTURE_API MWSetLEDMode (HCHANNEL hChannel, DWORD dwMode)
 Sets LED mode.
 
MW_RESULT MWGetVideoDevicePathByChannel (HCHANNEL hChannel, char *pszVideoDevicePath)
 ‍**
 
HANDLE LIBMWCAPTURE_API MWCreateVideoCapture (char *pszVideoDevicePath, int nWidth, int nHeight, int nFourcc, int nFrameDuration, VIDEO_CAPTURE_CALLBACK callback, void *pParam)
 Captures videos using dshow. Supports all capture devices.
 
MW_RESULT LIBMWCAPTURE_API MWDestoryVideoCapture (HANDLE hVideo)
 Stops to capture video.
 
HANDLE LIBMWCAPTURE_API MWCreateAudioCapture (HCHANNEL hChannel, MWCAP_AUDIO_CAPTURE_NODE captureNode, DWORD dwSamplesPerSec, WORD wBitsPerSample, WORD wChannels, AUDIO_CAPTURE_CALLBACK callback, void *pParam)
 Captures audio data for all capture devices.
 
MW_RESULT LIBMWCAPTURE_API MWDestoryAudioCapture (HANDLE hAudio)
 Stops to capture audio.
 
MW_RESULT LIBMWCAPTURE_API MWGetAudioVolume (HCHANNEL hChannel, MWCAP_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
 Gets the volume value of audio capture device.
 
MW_RESULT LIBMWCAPTURE_API MWSetAudioVolume (HCHANNEL hChannel, MWCAP_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
 Sets the volume of audio capture device.
 
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.
 
MW_RESULT LIBMWCAPTURE_API MWCaptureGetSDIANCPacket (HCHANNEL hChannel, MWCAP_SDI_ANC_PACKET *pPacket)
 Captures specified SDI ANC types.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportResolutionMode (HCHANNEL hChannel, MWCAP_VIDEO_RESOLUTION_MODE *pMode, int *pCount)
 Gets resolution modes 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.
 
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.
 
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.
 
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportColorFormat (HCHANNEL hChannel, DWORD *pColorFourcc, int *nCount)
 Uses DShow to get the device supported color spaces.
 

Detailed Description

Function Documentation

◆ MWCaptureExitInstance()

void LIBMWCAPTURE_API MWCaptureExitInstance ( )

Quits instance.

The API is used to quit the current instance. It always used with MWCaptureInitInstance.
Calls the API at the end of your instance. You can find it in all of the provided examples.

◆ MWCaptureGetSDIANCPacket()

MW_RESULT LIBMWCAPTURE_API MWCaptureGetSDIANCPacket ( HCHANNEL  hChannel,
MWCAP_SDI_ANC_PACKET pPacket 
)

Captures specified SDI ANC types.

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 the capture ANC data types of SDI signal, 4 types at most.
The detailed usage refers to example GetANCPacket.

WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCaptureSetSDIANCType(t_channel, 0, FALSE, TRUE, 0x61, 0x01);
...
MWCAP_SDI_ANC_PACKET t_packet;
MWCaptureGetSDIANCPacket(t_channel,&t_packet);
...
MWCloseChannel(t_channel);
HCHANNEL LIBMWCAPTURE_API MWOpenChannelByPath(const char *pszDevicePath)
Opens capture channel by device instance path.
MW_RESULT LIBMWCAPTURE_API MWGetDevicePath(int nIndex, char *pDevicePath)
Gets the instance path of capture device based on the index.
MW_RESULT LIBMWCAPTURE_API MWCaptureGetSDIANCPacket(HCHANNEL hChannel, MWCAP_SDI_ANC_PACKET *pPacket)
Captures specified SDI ANC types.

◆ MWCaptureInitInstance()

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. You can find it in all of the provided examples.

◆ MWCaptureSetSDIANCType()

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 ID
[in]bySDIDSMPTE ANC ID
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.
The usage refers to example GetANCPacket.

WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
//DID=0x61 and SDID=0x01 indicate to capture CC data.
MWCaptureSetSDIANCType(t_channel, 0, FALSE, TRUE, 0x61, 0x01);
...
MWCloseChannel(t_channel);

◆ MWCloseChannel()

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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCloseChannel(t_channel);

You can find the API in every examples.

◆ MWCreateAudioCapture()

HANDLE LIBMWCAPTURE_API MWCreateAudioCapture ( HCHANNEL  hChannel,
MWCAP_AUDIO_CAPTURE_NODE  captureNode,
DWORD  dwSamplesPerSec,
WORD  wBitsPerSample,
WORD  wChannels,
AUDIO_CAPTURE_CALLBACK  callback,
void *  pParam 
)

Captures audio data for all capture devices.

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

Usage:
Captures audio data using Core Audio for 2 channels at most. It is supported by all capture devices.
The usage refers to example AVCapture2.

static void OnAudioCaptureCallback(const BYTE * pbFrame, int cbFrame, uint64_t u64TimeStamp, void* pParam)
{
...
}
...
...
WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
HANDLE m_hAudio=NULL;
m_hAudio=MWCreateAudioCapture(t_channel, MWCAP_AUDIO_CAPTURE_NODE_DEFAULT, 48000, 16, 2, OnAudioCaptureCallback, this);
...
MWDestoryAudioCapture(m_hAudio);
...
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)
Captures audio data for all capture devices.
@ MWCAP_AUDIO_CAPTURE_NODE_DEFAULT
Default audio capture device.
Definition: MWCaptureExtension.h:1572

◆ MWCreateVideoCapture()

HANDLE LIBMWCAPTURE_API MWCreateVideoCapture ( char *  pszVideoDevicePath,
int  nWidth,
int  nHeight,
int  nFourcc,
int  nFrameDuration,
VIDEO_CAPTURE_CALLBACK  callback,
void *  pParam 
)

Captures videos using dshow. Supports all capture devices.

Parameters
[in]hChannelThe opened channel handle
[in]nWidthThe width of captured image
[in]nHeightThe height of captured image
[in]nFourccCapture format
[in]nFrameDurationThe capture interval between two frames
[in]callbackThe callback function
[in]pParamCallback objects
Returns
Returns HANDLE values. The possible returned values are as follows.
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.

static void OnVideoCaptureCallback(BYTE *pbFrame, long cbFrame, long stride, void* pParam)
{
...
}
...
...
char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
HANDLE m_hVideo=NULL;
m_hVideo= MWCreateVideoCapture(t_channel,1920, 1080, MWFOURCC_YUY2, 166667, OnVideoCaptureCallback, this);
...
MWCloseChannel(t_channel);
#define MWFOURCC_YUY2
YUY2.
Definition: MWFOURCC.h:290
HANDLE LIBMWCAPTURE_API MWCreateVideoCapture(char *pszVideoDevicePath, int nWidth, int nHeight, int nFourcc, int nFrameDuration, VIDEO_CAPTURE_CALLBACK callback, void *pParam)
Captures videos using dshow. Supports all capture devices.

◆ MWDestoryAudioCapture()

MW_RESULT LIBMWCAPTURE_API MWDestoryAudioCapture ( HANDLE  hAudio)

Stops to capture audio.

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.

static void OnAudioCaptureCallback(const BYTE * pbFrame, int cbFrame, uint64_t u64TimeStamp, void* pParam)
{
...
}
...
...
WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
HANDLE m_hAudio=NULL;
m_hAudio=MWCreateAudioCapture(t_channel, MWCAP_AUDIO_CAPTURE_NODE_DEFAULT, 48000, 16, 2, OnAudioCaptureCallback, this);
...
MWDestoryAudioCapture(m_hAudio);
...
MWCloseChannel(t_channel);

◆ MWDestoryVideoCapture()

MW_RESULT LIBMWCAPTURE_API MWDestoryVideoCapture ( HANDLE  hVideo)

Stops to capture video.

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

static void OnVideoCaptureCallback(BYTE *pbFrame, long cbFrame, long u64TimeStamp, void* pParam)
{
...
}
...
...
WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
HANDLE m_hVideo=NULL;
m_hVideo= MWCreateVideoCapture(t_channel,1920, 1080, MWFOURCC_YUY2, 166667, OnVideoCaptureCallback, this);
...
MWDestoryVideoCapture (m_hVideo);
...
MWCloseChannel(t_channel);

◆ MWGetAudioCaps()

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:

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_AUDIO_CAPS t_caps;
MWGetAudioCaps(t_channel,&t_caps);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioCaps(HCHANNEL hChannel, MWCAP_AUDIO_CAPS *pAudioCaps)
Gets audio capture capability of the channel.

◆ MWGetAudioInputSource()

MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSource ( HCHANNEL  hChannel,
DWORD *  pdwSource 
)

Gets current input audio 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. For details, see example InputSource.
The definition of pdwSource refers to INPUT_TYPE.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD dwAudioInput = 0;
MWGetAudioInputSource(t_channel, &dwAudioInput);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSource(HCHANNEL hChannel, DWORD *pdwSource)
Gets current input audio of the specified channel.

◆ MWGetAudioInputSourceArray()

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 type supported by the channel. When being set to NULL, the API returns the number of video signal types supported by the channel.
[in,out]pdwInputCountAs an input parameter, it indicates the size of area 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:
The detailed usage refers to example InputSource.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD dwAudioInputCount = 0;
xr = MWGetAudioInputSourceArray(hChannel, NULL, &dwAudioInputCount);
if (xr == MW_SUCCEEDED && dwAudioInputCount > 0) {
DWORD* pAudioInput = new DWORD[dwAudioInputCount];
xr=MWGetAudioInputSourceArray(hChannel,pAudioInput,&dwAudioInputCount);
if (xr == MW_SUCCEEDED) {
char szInputName[16] = { 0 };
for (DWORD i = 0; i < dwAudioInputCount; i++) {
GetAudioInputName(pAudioInput[i], szInputName, 16);
...
}
}
delete[] pAudioInput;
}
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioInputSourceArray(HCHANNEL hChannel, DWORD *pdwInputSource, DWORD *pdwInputCount)
Gets the input audio signal types supported by the channel.

◆ MWGetAudioSignalStatus()

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 struc 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.
For details, see example AudioCapture and InputSignal.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_AUDIO_SIGNAL_STATUS t_audio_status;
MWGetAudioSignalStatus(t_channel, &t_audio_status);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAudioSignalStatus(HCHANNEL hChannel, MWCAP_AUDIO_SIGNAL_STATUS *pSignalStatus)
Gets the audio signal status of specified channel.

◆ MWGetAudioVolume()

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.

WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_AUDIO_VOLUME t_volume;
...
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.

◆ MWGetAVInputSourceLink()

MW_RESULT LIBMWCAPTURE_API MWGetAVInputSourceLink ( HCHANNEL  hChannel,
BOOLEAN *  pbLink 
)

Gets the states of input audio/video sources.

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 with 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 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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
BOOLEAN t_b_link;
MWGetAVInputSourceLink(t_channel,&t_b_link);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetAVInputSourceLink(HCHANNEL hChannel, BOOLEAN *pbLink)
Gets the states of input audio/video sources.

◆ MWGetChannelCount()

int LIBMWCAPTURE_API MWGetChannelCount ( )

Gets the total number of channels.

Returns
The total number of channels

Usage:

int t_n_channel_count=MWGetChannelCount();
int LIBMWCAPTURE_API MWGetChannelCount()
Gets the total number of channels.
MW_RESULT LIBMWCAPTURE_API MWRefreshDevice()
Refreshes device list.

You can find the API in every examples.

◆ MWGetChannelInfo()

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:

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_CHANNEL_INFO t_info;
MWGetChannelInfo(t_channel,&t_info);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetChannelInfo(HCHANNEL hChannel, MWCAP_CHANNEL_INFO *pChannelInfo)
Gets channel information.

You can find the API in every examples.

◆ MWGetChannelInfoByIndex()

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:

MW_RESULT LIBMWCAPTURE_API MWGetChannelInfoByIndex(int nIndex, MWCAP_CHANNEL_INFO *pChannelInfo)
Gets the channel info by its index.
MWCAP_CHANNEL_INFO.
Definition: MWCaptureExtension.h:410

You can find the API in every examples.

◆ MWGetDevicePath()

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

char path[128];

You can find the API in every examples.

◆ MWGetEDID()

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.
For details, refers to example ReadWriteEDID.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
ULONG ulSize = 256;
BYTE byData[256];
MWGetEDID(t_channel, byData, &ulSize);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetEDID(HCHANNEL hChannel, BYTE *pbyData, ULONG *pulSize)
Gets the EDID of specified channel.

◆ MWGetFamilyInfo()

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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
//Pro:
MWCAP_PRO_CAPTURE_INFO t_pro_info;
MWGetFamilyInfo(t_channel,&t_pro_info,sizeof(MWCAP_PRO_CAPTURE_INFO));
//Eco:
MWCAP_ECO_CAPTURE_INFO t_eco_info;
MWGetFamilyInfo(t_channel,&t_t_eco_info,sizeof(MWCAP_ECO_CAPTURE_INFO));
//USB:
MWGetFamilyInfo(t_channel,&t_usb_info,sizeof(MWUSBCAP_CAPTURE_INFO));
...
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.
MWCAP_PCIE_CAPTURE_INFO.
Definition: MWCaptureExtension.h:432
MWUSBCAP_CAPTURE_INFO.
Definition: MWUSBCaptureExtension.h:145

◆ MWGetFamilyInfoByIndex()

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 retures 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:

MW_RESULT LIBMWCAPTURE_API MWGetFamilyInfoByIndex(int nIndex, LPVOID pFamilyInfo, DWORD dwSize)
Gets the product family based on the index.

Code for Eco capture family:

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

Code for USB capture family:

◆ MWGetHDMIInfoFramePacket()

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 struc 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.
For details, see example HDMIInfoFrame.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD dwValidFlag = 0;
MWGetHDMIInfoFrameValidFlag(t_channel, &dwValidFlag);
if (dwValidFlag & MWCAP_HDMI_INFOFRAME_MASK_AVI) {
}
else if(dwValidFlag & MWCAP_HDMI_INFOFRAME_MASK_AUDIO){
...
}
...
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetHDMIInfoFramePacket(HCHANNEL hChannel, MWCAP_HDMI_INFOFRAME_ID id, HDMI_INFOFRAME_PACKET *pPacket)
Gets HDMI InfoFrame data.
void LIBMWCAPTURE_API MWCloseChannel(HCHANNEL hChannel)
Closes capture channel.
MW_RESULT LIBMWCAPTURE_API MWGetHDMIInfoFrameValidFlag(HCHANNEL hChannel, DWORD *pdwValidFlag)
Gets valid flag of HDMI InfoFrame.
@ MWCAP_HDMI_INFOFRAME_ID_AVI
AVI infoframe.
Definition: MWCaptureExtension.h:1362
@ MWCAP_HDMI_INFOFRAME_MASK_AVI
AVI infoframe.
Definition: MWCaptureExtension.h:1383
@ MWCAP_HDMI_INFOFRAME_MASK_AUDIO
Audio infoframe.
Definition: MWCaptureExtension.h:1384
HDMI_INFOFRAME_PACKET.
Definition: MWHDMIPackets.h:361

◆ MWGetHDMIInfoFrameValidFlag()

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.
For details, see example HDMIInfoFrame.
The value of pdwValidFlag refers to MWCAP_HDMI_INFOFRAME_MASK.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD dwValidFlag = 0;
MWGetHDMIInfoFrameValidFlag(t_channel, &dwValidFlag);
...
MWCloseChannel(t_channel);

◆ MWGetInputSourceScan()

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 under scanning. 1 indicates true, AutoScan; 0 indicates false, not to 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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
BOOLEAN t_b_scan;
MWGetInputSourceScan(t_channel,&t_b_scan);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetInputSourceScan(HCHANNEL hChannel, BOOLEAN *pbScan)
Gets the scan state of input source.

◆ MWGetInputSpecificStatus()

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.
For details, refer to example HDMIInfoFrame.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_INPUT_SPECIFIC_STATUS t_status;
MWGetInputSpecificStatus(t_channel, &t_status);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetInputSpecificStatus(HCHANNEL hChannel, MWCAP_INPUT_SPECIFIC_STATUS *pInputStatus)
Gets the specific status of input signal.

◆ MWGetVersion()

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().
Usually, it is used by examples such as CaptureByInput and CaptureByTimer, etc.

◆ MWGetVideoCaps()

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:

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_VIDEO_CAPS t_caps;
MWGetVideoCaps(t_channel,&t_caps);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaps(HCHANNEL hChannel, MWCAP_VIDEO_CAPS *pVideoCaps)
Gets video capture capability of the specified channel.

◆ MWGetVideoCaptureSupportColorFormat()

MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportColorFormat ( HCHANNEL  hChannel,
DWORD *  pColorFourcc,
int *  nCount 
)

Uses DShow to get the device supported color spaces.

Parameters
[in]hChannelThe opened channel handle
[out]pColorFmtReturns 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 format 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.

WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
int t_n_count=0;
MWGetVideoCaptureSupportFormat(t_channel,NULL,&t_n_count);
if(t_n_count>0){
DWORD* t_p_format=new DWORD[t_n_count];
MWGetVideoCaptureSupportColorFormat(t_channel,t_p_format,&t_n_count);
}
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportColorFormat(HCHANNEL hChannel, DWORD *pColorFourcc, int *nCount)
Uses DShow to get the device supported color spaces.

◆ MWGetVideoCaptureSupportListResolution()

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:

WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
int t_n_count=0;
MWCAP_VIDEO_RESOLUTION_MODE t_mode;
MWGetVideoCaptureSupportResolutionMode(t_channel,&t_mode,&t_n_count);
if(t_mode == MWCAP_VIDEO_RESOLUTION_MODE_LIST){
...
}
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportResolutionMode(HCHANNEL hChannel, MWCAP_VIDEO_RESOLUTION_MODE *pMode, int *pCount)
Gets resolution modes supported by devices, including MWCAP_VIDEO_RESOLUTION_MODE_LIST when the resol...
MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportListResolution(HCHANNEL hChannel, MWCAP_VIDEO_RESOLUTION_LIST *pList)
Gets resolutions supported by devices when the return mode of MWGetVideoCaptureSupportResolutionMode ...
Definition: MWCaptureExtension.h:1476

◆ MWGetVideoCaptureSupportRangeResolution()

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:

WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
int t_n_count=0;
MWCAP_VIDEO_RESOLUTION_MODE t_mode;
MWGetVideoCaptureSupportResolutionMode(t_channel,&t_mode,&t_n_count);
if(t_mode == MWCAP_VIDEO_RESOLUTION_MODE_RANGE){
...
}
...
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 MWGetVideoCaptureSupportResolu...
Definition: MWCaptureExtension.h:1469

◆ MWGetVideoCaptureSupportResolutionMode()

MW_RESULT LIBMWCAPTURE_API MWGetVideoCaptureSupportResolutionMode ( HCHANNEL  hChannel,
MWCAP_VIDEO_RESOLUTION_MODE *  pMode,
int *  pCount 
)

Gets resolution modes 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 modes: MWCAP_VIDEO_RESOLUTION_MODE_LIST, MWCAP_VIDEO_RESOLUTION_MODE_RANGE.
[out]pCountOnly available when the format is MWCAP_VIDEO_RESOLUTION_MODE_LIST, indicats the device supported number of resolution formats.
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:

WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
int t_n_count=0;
MWCAP_VIDEO_RESOLUTION_MODE t_mode;
MWGetVideoCaptureSupportResolutionMode(t_channel,&t_mode,&t_n_count);
...
MWCloseChannel(t_channel);

◆ MWGetVideoDevicePathByChannel()

MW_RESULT MWGetVideoDevicePathByChannel ( HCHANNEL  hChannel,
char *  pszVideoDevicePath 
)

‍**

‍** ‍** ‍**

Gets the path of the channel

Parameters
[in]hChannelThe opened channel handle.
[out]pszVideoDevicePathPath 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 path of the specified channel.

HCHANNEL t_channel=MWOpenChannel(0,0);
...
char path[128];
...
MWCloseChannel(t_channel);
MW_RESULT MWGetVideoDevicePathByChannel(HCHANNEL hChannel, char *pszVideoDevicePath)
‍**
HCHANNEL LIBMWCAPTURE_API MWOpenChannel(int nBoardValue, int nChannelIndex)
Opens capture channel by the rotary number and channel number.

◆ MWGetVideoInputAspectRatio()

MW_RESULT LIBMWCAPTURE_API MWGetVideoInputAspectRatio ( HCHANNEL  hChannel,
int *  pnAspectX,
int *  pnAspectY 
)

Gets aspect ratio of input video.

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 source.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
int t_aspect_x = 0;
int t_aspect_y = 0;
MWGetVideoInputAspectRatio(t_channel, &t_aspect_x, &t_aspect_y);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputAspectRatio(HCHANNEL hChannel, int *pnAspectX, int *pnAspectY)
Gets aspect ratio of input video.

◆ MWGetVideoInputColorFormat()

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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_VIDEO_COLOR_FORMAT t_colorformat;
MWGetVideoInputColorFormat (t_channel,&t_colorformat);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputColorFormat(HCHANNEL hChannel, MWCAP_VIDEO_COLOR_FORMAT *pColorFormat)
Gets color format of input video.

◆ MWGetVideoInputQuantizationRange()

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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_VIDEO_QUANTIZATION_RANGE t_quantrange;
MWGetVideoInputQuantizationRange(t_channel,&t_quantrange);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputQuantizationRange(HCHANNEL hChannel, MWCAP_VIDEO_QUANTIZATION_RANGE *pQuantRange)
Gets quantization range of input video.

◆ MWGetVideoInputSource()

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.
For detailed information, refer to example InputSource The definition of pdwSource refers to MWCAP_VIDEO_INPUT_TYPE.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD dwVideoInput = 0;
MWGetVideoInputSource(t_channel, &dwVideoInput);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputSource(HCHANNEL hChannel, DWORD *pdwSource)
Gets current video input source of the channel.

◆ MWGetVideoInputSourceArray()

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, the API returns the number of video signal types supported by the channel.
[in,out]pdwInputCountAs an input parameter, it indicates the size of area 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:
For details, refer to the sample InputSource.

.
char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD dwVideoInputCount = 0;
MW_RESULT xr = MWGetVideoInputSourceArray(hChannel, NULL, &dwVideoInputCount);
if (xr == MW_SUCCEEDED && dwVideoInputCount > 0) {
DWORD* pVideoInput = new DWORD[dwVideoInputCount];
xr=MWGetVideoInputSourceArray(hChannel,pVideoInput, &dwVideoInputCount);
if (xr == MW_SUCCEEDED) {
char szInputName[16] = { 0 };
for (DWORD i = 0; i < dwVideoInputCount; i++) {
GetVideoInputName(pVideoInput[i], szInputName, 16);
printf("[%d] %s\n", i, szInputName);
}
}
delete[] pVideoInput;
}
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoInputSourceArray(HCHANNEL hChannel, DWORD *pdwInputSource, DWORD *pdwInputCount)
Gets the input video signal types supported by the channel.

◆ MWGetVideoSignalStatus()

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 struc 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. For details, see example CaptureByInput, CaptureByTimer.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_VIDEO_SIGNAL_STATUS t_video_status;
MWGetVideoSignalStatus(t_channel, &t_video_status);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWGetVideoSignalStatus(HCHANNEL hChannel, MWCAP_VIDEO_SIGNAL_STATUS *pSignalStatus)
Gets video signal status of specified channel.

◆ MWOpenChannelByPath()

HCHANNEL LIBMWCAPTURE_API MWOpenChannelByPath ( const char *  pszDevicePath)

Opens capture channel by device instance path.

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

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

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);

You can find the API in every examples.

◆ MWRefreshDevice()

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.
You can find the API in all of the provided examples.

◆ MWSetAudioInputSource()

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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD dwAudioInput =INPUT_TYPE(MWCAP_AUDIO_INPUT_TYPE_HDMI, 0);
MWSetAudioInputSource(hChannel, dwAudioInput);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetAudioInputSource(HCHANNEL hChannel, DWORD dwSource)
Sets current audio input source of specified channel.
@ MWCAP_AUDIO_INPUT_TYPE_HDMI
HDMI input signal.
Definition: MWCaptureExtension.h:190
#define INPUT_TYPE(source)
Gets type variables from input source.
Definition: MWCaptureExtension.h:116

◆ MWSetAudioVolume()

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.

WCHAR path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_AUDIO_VOLUME t_volume;
...
for(int i=0;i<MWCAP_MAX_NUM_AUDIO_CHANNEL;i++){
t_volume.asVolume[i]=t_volume.sVolumeMax;
}
...
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.

◆ MWSetAVInputSourceLink()

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 follows 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 follows the video input source automatically.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
BOOLEAN t_b_link;
MWSetAVInputSourceLink(t_channel,t_b_link);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetAVInputSourceLink(HCHANNEL hChannel, BOOLEAN bLink)
Sets whether the input video source is linked to its audio automatically.

◆ MWSetEDID()

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.
For details, see example ReadWriteEDID.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
ULONG ulSize = 256;
BYTE byData[256];
MWGetEDID(t_channel, byData, &ulSize);
...
MWSetEDID(t_channel,byData,ulSize);
...
MWCloseChannel(t_channel);

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

◆ MWSetInputSourceScan()

MW_RESULT LIBMWCAPTURE_API MWSetInputSourceScan ( HCHANNEL  hChannel,
BOOLEAN  bScan 
)

Sets the states of scanned input video source.

Parameters
[in]hChannelChannel handle
[in]bScanIndicates the scanned states. 1 indicates true, AutoScan; 0 indicates false, not to 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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
BOOLEAN t_b_scan;
MWSetInputSourceScan(t_channel,t_b_scan);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetInputSourceScan(HCHANNEL hChannel, BOOLEAN bScan)
Sets the states of scanned input video source.

◆ MWSetLEDMode()

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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD t_dw_mode=MWCAP_LED_DBL_BLINK;
MWSetLEDMode(t_channel,t_dw_mode);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetLEDMode(HCHANNEL hChannel, DWORD dwMode)
Sets LED mode.
@ MWCAP_LED_DBL_BLINK
LED flashes two times, pauses, then blinks again.
Definition: MWCaptureExtension.h:559

◆ MWSetVideoInputAspectRatio()

MW_RESULT LIBMWCAPTURE_API MWSetVideoInputAspectRatio ( HCHANNEL  hChannel,
int  nAspectX,
int  nAspectY 
)

Sets aspect ratio of input video.

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 signal. It works with the other video processing parameters.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
int t_aspect_x = 4;
int t_aspect_y = 3;
MWSetVideoInputAspectRatio(t_channel, t_aspect_x, t_aspect_y);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputAspectRatio(HCHANNEL hChannel, int nAspectX, int nAspectY)
Sets aspect ratio of input video.

◆ MWSetVideoInputColorFormat()

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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_VIDEO_COLOR_FORMAT t_colorformat;
MWSetVideoInputColorFormat (t_channel, t_colorformat);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputColorFormat(HCHANNEL hChannel, MWCAP_VIDEO_COLOR_FORMAT colorFormat)
Sets color format of input video.
@ MWCAP_VIDEO_COLOR_FORMAT_YUV709
YUV709.
Definition: MWCaptureExtension.h:233

◆ MWSetVideoInputQuantizationRange()

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

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
MWCAP_VIDEO_QUANTIZATION_RANGE t_quantrange;
MWSetVideoInputQuantizationRange(t_channel,t_quantrange);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputQuantizationRange(HCHANNEL hChannel, MWCAP_VIDEO_QUANTIZATION_RANGE quantRange)
Sets quantization range of input video.
@ MWCAP_VIDEO_QUANTIZATION_LIMITED
Limited range, which has 8-bit data. The black-white color range is 16/64/256/4096-235(240)/940(960)/...
Definition: MWCaptureExtension.h:246

◆ MWSetVideoInputSource()

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.

char path[128];
HCHANNEL t_channel=MWOpenChannelByPath(path);
...
DWORD dwVideoInput = 0;
MWSetVideoInputSource(t_channel, &dwVideoInput);
...
MWCloseChannel(t_channel);
MW_RESULT LIBMWCAPTURE_API MWSetVideoInputSource(HCHANNEL hChannel, DWORD dwSource)
Sets the video input source of the specified channel.
@ MWCAP_VIDEO_INPUT_TYPE_HDMI
HDMI input signal.
Definition: MWCaptureExtension.h:175
#define INPUT_SOURCE(type, index)
Defines audio or video input source.
Definition: MWCaptureExtension.h:109