MWCapture SDK Mac 3.4.62314

- Home
- Development Library
- Release Notes

Functions
USB Capture Family Functions

## Functions
MW_RESULT LIBMWCAPTURE_API | MWUSBRegisterHotPlug (LPFN_HOT_PLUG_CALLBACK lpfnCallback, void *pParam)
| Registers hotplug callback function of USB capture device.
MW_RESULT LIBMWCAPTURE_API | MWUSBUnRegisterHotPlug ()
| Unregisters hotplug callback function.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetNotifyEnable (HUSBCHANNEL hChannel, MWCAP_NOTIFY_ENABLE *pNotify)
| Sets notification types for specified channel.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetNotifyStatus (HUSBCHANNEL hChannel, uint64_t *pullStatusBit)
| Gets notification status of USB specified channel.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetEDIDLoopThrough (HUSBCHANNEL hChannel, char *pbyEDID, uint32_t *pcbEDID)
| ‍**
MW_RESULT LIBMWCAPTURE_API | MWUSBGetLoopThroughValid (HUSBCHANNEL hChannel, bool_t *pbValid)
| Gets whether the loopthrough interface in the USB device is valid.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetAudioVolume (HUSBCHANNEL hChannel, MWCAP_USB_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
| Gets the volume of USB audio device.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetAudioVolume (HUSBCHANNEL hChannel, MWCAP_USB_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
| Sets the volume of USB audio device.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetVideoCaptureConnectionFormat (HUSBCHANNEL hChannel, MWCAP_VIDEO_CONNECTION_FORMAT *pConnFormat)
| Get the capture format related parameters of the video capture device.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetVideoCaptureProcessSettings (HUSBCHANNEL hChannel, MWCAP_VIDEO_PROCESS_SETTINGS *pProcSettings)
| Get the video process settings of the video capture device.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetVideoCaptureProcessSettings (HUSBCHANNEL hChannel, MWCAP_VIDEO_PROCESS_SETTINGS *pProcSettings)
| Sets the video process settings of the video capture device.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetVideoOutputFOURCC (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FOURCC *pOutputFourCC)
| Gets capture formats supported by the USB device.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetVideoOutputFOURCC (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FOURCC *pOutputFourCC)
| Sets capture formats supported by the USB device, 3 at most.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetVideoOutputFrameSize (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_SIZE *pFrameSize)
| Gets resolutions of captured images supported by the USB device.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetVideoOutputFrameSize (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_SIZE *pFrameSize)
| Sets resolutions supported by the USB device.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetVideoOutputFrameInterval (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL *pFrameInterval)
| Gets capture intervals supported by USB device.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetVideoOutputFrameInterval (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL *pFrameInterval)
| Sets capture intervals supported by USB device.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetStatusImageMode (HUSBCHANNEL hChannel, MWCAP_STATUS_IMAGE_MODE *pImageMode)
| Gets the image pattern showed when there is not a valid input signal.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetStatusImageMode (HUSBCHANNEL hChannel, MWCAP_STATUS_IMAGE_MODE *pImageMode)
| Sets the image pattern showed when there is not a valid input signal.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetDeviceNameMode (HUSBCHANNEL hChannel, MWCAP_DEVICE_NAME_MODE *pNameMode)
| Gets device name pattern of USB device.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetDeviceNameMode (HUSBCHANNEL hChannel, MWCAP_DEVICE_NAME_MODE *pNameMode)
| Sets device name pattern of USB device.
MW_RESULT LIBMWCAPTURE_API | MWUSBSaveOptions (HUSBCHANNEL hChannel)
| Saves configurations.
MW_RESULT LIBMWCAPTURE_API | MWUSBLoadOptions (HUSBCHANNEL hChannel)
| Load the settings to the capture device.
MW_RESULT LIBMWCAPTURE_API | MWUSBResetOptions (HUSBCHANNEL hChannel)
| Reset the settings to the capture device.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetVideoAutoHAlign (HUSBCHANNEL hChannel, bool_t *pbAutoHAlign)
| Gets whether video is horizontally aligned.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetVideoAutoHAlign (HUSBCHANNEL hChannel, bool_t pbAutoHAlign)
| Sets video horizontal alignment.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetVideoSamplingPhase (HUSBCHANNEL hChannel, uint8_t *puSamplingPhase)
| Gets video sampling phase.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetVideoSamplingPhase (HUSBCHANNEL hChannel, uint8_t *puSamplingPhase)
| Sets video sampling phase.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetVideoSamplingPhaseAutoAdjust (HUSBCHANNEL hChannel, bool_t *pbAutoSamplingPhase)
| Gets whether video sampling phase is auto adjusted.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetVideoSamplingPhaseAutoAdjust (HUSBCHANNEL hChannel, bool_t *pbAutoSamplingPhase)
| Sets video sampling phase auto adjust.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetVideoTiming (HUSBCHANNEL hChannel, MWCAP_VIDEO_TIMING *pTiming)
| Sets default video timing.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetPreferredVideoTimings (HUSBCHANNEL hChannel, MWCAP_VIDEO_TIMING_ARRAY *paTimings)
| Gets video preferred timings.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetCustomVideoTimings (HUSBCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING_ARRAY *paCustomTimings)
| Gets customize video timing array.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetCustomVideoTimings (HUSBCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING_ARRAY *paCustomTimings)
| Sets customize video timing array.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetCustomVideoTiming (HUSBCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_TIMING *pCustomTiming)
| Sets customize video timing.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetCustomVideoResolutions (HUSBCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY *paCustomResolutions)
| Gets customize video resolutions.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetCustomVideoResolutions (HUSBCHANNEL hChannel, MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY *paCustomResolutions)
| Sets customize video resolutions.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetExtensionSupported (HUSBCHANNEL hChannel, uint32_t *pdwFlag)
| Gets extended support.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetInputSourceScanState (HUSBCHANNEL hChannel, bool_t *pbScanning)
| Obtains the scan state of input source.
MW_RESULT LIBMWCAPTURE_API | MWUSBGetEDIDMode (HUSBCHANNEL hChannel, MWCAP_EDID_MODE *pMode)
| Gets current edid mode.
MW_RESULT LIBMWCAPTURE_API | MWUSBSetEDIDMode (HUSBCHANNEL hChannel, MWCAP_EDID_MODE mode)
| Sets the edid mode.

## Detailed Description

## Function Documentation

## ◆ MWUSBGetAudioVolume()

MW_RESULT LIBMWCAPTURE_API MWUSBGetAudioVolume | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_USB_AUDIO_NODE | audioNode,
|  | MWCAP_AUDIO_VOLUME * | pVolume
| ) |  |

Gets the volume of USB audio device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | audioNode | Audio device
  [out] | pVolume | Volume of USB audio 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 volume of USB audio device.

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_AUDIO_VOLUME t_vol;
MWUSBGetAudioVolume(hChannel, MWCAP_USB_AUDIO_EMBEDDED_CAPTURE, &t_vol);
...
MWCloseChannel(hChannel);
MWOpenChannelByPath
HCHANNEL LIBMWCAPTURE_API MWOpenChannelByPath(const char *pszDevicePath)
Opens capture channel by device instance path.
MWGetDevicePath
MW_RESULT LIBMWCAPTURE_API MWGetDevicePath(int nIndex, char *pDevicePath)
Gets the instance path of capture device based on the index.
MWUSBGetAudioVolume
MW_RESULT LIBMWCAPTURE_API MWUSBGetAudioVolume(HUSBCHANNEL hChannel, MWCAP_USB_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
Gets the volume of USB audio device.

## ◆ MWUSBGetCustomVideoResolutions()

MW_RESULT LIBMWCAPTURE_API MWUSBGetCustomVideoResolutions | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY * | paCustomResolutions
| ) |  |

Gets customize video resolutions.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | paCustomResolutions | The customize resolutions of the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBGetCustomVideoTimings()

MW_RESULT LIBMWCAPTURE_API MWUSBGetCustomVideoTimings | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_CUSTOM_TIMING_ARRAY * | paCustomTimings
| ) |  |

Gets customize video timing array.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | paCustomTimings | The customize video timing of the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBGetDeviceNameMode()

MW_RESULT LIBMWCAPTURE_API MWUSBGetDeviceNameMode | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_DEVICE_NAME_MODE * | pNameMode
| ) |  |

Gets device name pattern of USB device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pNameMode | Device name pattern

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 pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_DEVICE_NAME_MODE t_mode;
MWUSBGetDeviceNameMode(hChannel, &t_mode);
...
MWCloseChannel(hChannel);
MWUSBGetDeviceNameMode
MW_RESULT LIBMWCAPTURE_API MWUSBGetDeviceNameMode(HUSBCHANNEL hChannel, MWCAP_DEVICE_NAME_MODE *pNameMode)
Gets device name pattern of USB device.

## ◆ MWUSBGetEDIDLoopThrough()

MW_RESULT LIBMWCAPTURE_API MWUSBGetEDIDLoopThrough | ( | HUSBCHANNEL | hChannel,
|  | char * | pbyEDID,
|  | uint32_t * | pcbEDID
| ) |  |

‍**

‍**

Gets EDID of the loopthrough interface in the USB device, only supported by devices with loopthrough interface

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pbyEDID | EDID
  [in,out] | pcbEDID | As an input parameter, it indicates the size of the area which is pointed by the pbyEDID. As an output parameter, it indicates the the size of the returned 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 EDID of the loopthrough interface in the USB device, which is only supported by devices with loopthrough interface.

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
uint32_t t_cd_edid=256;
unsigned char t_hc_edid[256];
MWUSBGetEDIDloopthrough(hChannel, t_hc_edid, &t_cd_edid);
...
MWCloseChannel(hChannel);

## ◆ MWUSBGetEDIDMode()

MW_RESULT LIBMWCAPTURE_API MWUSBGetEDIDMode | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_EDID_MODE * | pMode
| ) |  |

Gets current edid mode.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pMode | The edid mode of device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or NW_INVALID_PARAMS

## ◆ MWUSBGetExtensionSupported()

MW_RESULT LIBMWCAPTURE_API MWUSBGetExtensionSupported | ( | HUSBCHANNEL | hChannel,
|  | uint32_t * | pdwFlag
| ) |  |

Gets extended support.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pdwFlag | The extended supported flag of the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBGetInputSourceScanState()

MW_RESULT LIBMWCAPTURE_API MWUSBGetInputSourceScanState | ( | HUSBCHANNEL | hChannel,
|  | bool_t * | pbScanning
| ) |  |

Obtains the scan state of input source.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pbScanning | Scan state of input source

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or NW_INVALID_PARAMS

## ◆ MWUSBGetLoopThroughValid()

MW_RESULT LIBMWCAPTURE_API MWUSBGetLoopThroughValid | ( | HUSBCHANNEL | hChannel,
|  | bool_t * | pbValid
| ) |  |

Gets whether the loopthrough interface in the USB device is valid.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pbValid | Whether there is a loopthrough interface

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 pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
bool_t t_valid=false;
MWUSBGetloopthroughValid(hChannel, &t_valid);
...
MWCloseChannel(hChannel);

## ◆ MWUSBGetNotifyStatus()

MW_RESULT LIBMWCAPTURE_API MWUSBGetNotifyStatus | ( | HUSBCHANNEL | hChannel,
|  | uint64_t * | pullStatusBit
| ) |  |

Gets notification status of USB specified channel.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pullStatusBit | Notification mask

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 notification status of USB specified channel.

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_NOTIFY_ENABLE t_notify;
t_notify.bInterrupt=false;
t_notify.ullEnableBits=MWCAP_NOTIFY_xxx|MWCAP_NOTIFY_xxx|...;
...
MWUSBSetNotifyEnable(hChannel, &t_notify);
...
uint64_t t_status=0;
MWUSBGetNotifyStatus(hChannel, &t_status);
if(t_status & MWCAP_NOTIFY_xxx){
...
}
...
MWCloseChannel(hChannel);
MWUSBGetNotifyStatus
MW_RESULT LIBMWCAPTURE_API MWUSBGetNotifyStatus(HUSBCHANNEL hChannel, uint64_t *pullStatusBit)
Gets notification status of USB specified channel.

## ◆ MWUSBGetPreferredVideoTimings()

MW_RESULT LIBMWCAPTURE_API MWUSBGetPreferredVideoTimings | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_TIMING_ARRAY * | paTimings
| ) |  |

Gets video preferred timings.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | paTimings | The preferred video timing of the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBGetStatusImageMode()

MW_RESULT LIBMWCAPTURE_API MWUSBGetStatusImageMode | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_STATUS_IMAGE_MODE * | pImageMode
| ) |  |

Gets the image pattern showed when there is not a valid input signal.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pImageMode | The image pattern showed when there is not a valid input signal

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 image pattern showed when there is not a valid input signal.

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_STATUS_IMAGE_MODE t_mode;
MWUSBGetStatusImageMode(hChannel, &t_mode);
...
MWCloseChannel(hChannel);
MWUSBGetStatusImageMode
MW_RESULT LIBMWCAPTURE_API MWUSBGetStatusImageMode(HUSBCHANNEL hChannel, MWCAP_STATUS_IMAGE_MODE *pImageMode)
Gets the image pattern showed when there is not a valid input signal.

## ◆ MWUSBGetVideoAutoHAlign()

MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoAutoHAlign | ( | HUSBCHANNEL | hChannel,
|  | bool_t * | pbAutoHAlign
| ) |  |

Gets whether video is horizontally aligned.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pbAutoHAlign | The flag auto align horizontally

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBGetVideoCaptureConnectionFormat()

MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoCaptureConnectionFormat | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_CONNECTION_FORMAT * | pConnFormat
| ) |  |

Get the capture format related parameters of the video capture device.

Parameters

  [in] | hChannel | Input the opened channel handle
  [out] | pConnFormat | The video connection format information

Returns
  Returns MW_SUCCEED if succeeded, otherwise return MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBGetVideoCaptureProcessSettings()

MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoCaptureProcessSettings | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_PROCESS_SETTINGS * | pProcSettings
| ) |  |

Get the video process settings of the video capture device.

Parameters

  [in] | hChannel | Input the opened channel handle
  [out] | pProcSettings | Output the video process settings

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBGetVideoOutputFOURCC()

MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFOURCC | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_OUTPUT_FOURCC * | pOutputFourCC
| ) |  |

Gets capture formats supported by the USB device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pOutputFourCC | Supported capture 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:

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_VIDEO_OUTPUT_FOURCC t_fmt;
MWUSBGetVideoOutputFOURCC(hChannel, &t_fmt);
...
MWCloseChannel(hChannel);
MWUSBGetVideoOutputFOURCC
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFOURCC(HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FOURCC *pOutputFourCC)
Gets capture formats supported by the USB device.

## ◆ MWUSBGetVideoOutputFrameInterval()

MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFrameInterval | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL * | pFrameInterval
| ) |  |

Gets capture intervals supported by USB device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pFrameInterval | Capture intervals supported by USB 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:

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL t_internal;
MWUSBGetVideoOutputFrameInterval(hChannel, &t_internal);
...
MWCloseChannel(hChannel);
MWUSBGetVideoOutputFrameInterval
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFrameInterval(HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL *pFrameInterval)
Gets capture intervals supported by USB device.

## ◆ MWUSBGetVideoOutputFrameSize()

MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFrameSize | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_OUTPUT_FRAME_SIZE * | pFrameSize
| ) |  |

Gets resolutions of captured images supported by the USB device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pFrameSize | Resolutions of captured images supported by the USB 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:

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_VIDEO_OUTPUT_FRAME_SIZE t_fsize;
MWUSBGetVideoOutputFrameSize(hChannel ,& t_fsize);
...
MWCloseChannel(hChannel);
MWUSBGetVideoOutputFrameSize
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFrameSize(HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_SIZE *pFrameSize)
Gets resolutions of captured images supported by the USB device.

## ◆ MWUSBGetVideoSamplingPhase()

MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoSamplingPhase | ( | HUSBCHANNEL | hChannel,
|  | uint8_t * | puSamplingPhase
| ) |  |

Gets video sampling phase.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | puSamplingPhase | The value of the sampling phase of the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBGetVideoSamplingPhaseAutoAdjust()

MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoSamplingPhaseAutoAdjust | ( | HUSBCHANNEL | hChannel,
|  | bool_t * | pbAutoSamplingPhase
| ) |  |

Gets whether video sampling phase is auto adjusted.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pbAutoSamplingPhase | The automatic adjustment flag of the sample phase

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBLoadOptions()

MW_RESULT LIBMWCAPTURE_API MWUSBLoadOptions | ( | HUSBCHANNEL | hChannel | ) |

Load the settings to the capture device.

Parameters

  [in] | hChannel | Channel handle of USB 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:

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWUSBLoadOptions(hChannel);
...
MWCloseChannel(hChannel);

## ◆ MWUSBRegisterHotPlug()

MW_RESULT LIBMWCAPTURE_API MWUSBRegisterHotPlug | ( | LPFN_HOT_PLUG_CALLBACK | lpfnCallback,
|  | void * | pParam
| ) |  |

Registers hotplug callback function of USB capture device.

Parameters

  [in] | lpfnCallback | Callback function
  [in] | pParam | Callback object

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:
Registers hotplug callback function of USB capture device to notify the plug states of USB capture devices.

static void HotplugCheckCallback(MWUSBHOT_PLUG_EVETN event, const char *pszDevicePath, void* pParam)
{
...
}
...
MWCaptureInitInstance();
...
mr = MWUSBRegisterHotPlug(HotplugCheckCallback, NULL);
...
mr = MWUSBUnRegisterHotPlug();
...
MWCaptureExitInstance();
MWUSBUnRegisterHotPlug
MW_RESULT LIBMWCAPTURE_API MWUSBUnRegisterHotPlug()
Unregisters hotplug callback function.
MWUSBRegisterHotPlug
MW_RESULT LIBMWCAPTURE_API MWUSBRegisterHotPlug(LPFN_HOT_PLUG_CALLBACK lpfnCallback, void *pParam)
Registers hotplug callback function of USB capture device.

## ◆ MWUSBResetOptions()

MW_RESULT LIBMWCAPTURE_API MWUSBResetOptions | ( | HUSBCHANNEL | hChannel | ) |

Reset the settings to the capture device.

Parameters

  [in] | hChannel | Channel handle of USB 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:

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWUSBResetOptions(hChannel);
...
MWCloseChannel(hChannel);

## ◆ MWUSBSaveOptions()

MW_RESULT LIBMWCAPTURE_API MWUSBSaveOptions | ( | HUSBCHANNEL | hChannel | ) |

Saves configurations.

Parameters

  [in] | hChannel | Channel handle of USB 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:
The detailed usage refers to the following functions:
MWUSBSetVideoOutputFOURCC
MWUSBSetVideoOutputFrameSize
MWUSBSetVideoOutputFrameInterval
MWUSBSetStatusImageMode
MWUSBSetDeviceNameMode

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWUSBSaveOptions(hChannel);
...
MWCloseChannel(hChannel);

## ◆ MWUSBSetAudioVolume()

MW_RESULT LIBMWCAPTURE_API MWUSBSetAudioVolume | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_USB_AUDIO_NODE | audioNode,
|  | MWCAP_AUDIO_VOLUME * | pVolume
| ) |  |

Sets the volume of USB audio device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | audioNode | Audio device
  [in] | pVolume | Audio device volume

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 USB audio device.

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_AUDIO_VOLUME t_vol;
MWUSBGetAudioVolume(hChannel, MWCAP_USB_AUDIO_EMBEDDED_CAPTURE, &t_vol);
t_vol.xx=...;
MWUSBSetAudioVolume(hChannel, MWCAP_USB_AUDIO_EMBEDDED_CAPTURE, &t_vol);
...
MWCloseChannel(hChannel);
MWUSBSetAudioVolume
MW_RESULT LIBMWCAPTURE_API MWUSBSetAudioVolume(HUSBCHANNEL hChannel, MWCAP_USB_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
Sets the volume of USB audio device.

## ◆ MWUSBSetCustomVideoResolutions()

MW_RESULT LIBMWCAPTURE_API MWUSBSetCustomVideoResolutions | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_CUSTOM_RESOLUTION_ARRAY * | paCustomResolutions
| ) |  |

Sets customize video resolutions.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | paCustomResolutions | The customize resolutions set to the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBSetCustomVideoTiming()

MW_RESULT LIBMWCAPTURE_API MWUSBSetCustomVideoTiming | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_CUSTOM_TIMING * | pCustomTiming
| ) |  |

Sets customize video timing.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | pCustomTiming | The customize video timing set to the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBSetCustomVideoTimings()

MW_RESULT LIBMWCAPTURE_API MWUSBSetCustomVideoTimings | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_CUSTOM_TIMING_ARRAY * | paCustomTimings
| ) |  |

Sets customize video timing array.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | paCustomTimings | The customize video timing set to the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBSetDeviceNameMode()

MW_RESULT LIBMWCAPTURE_API MWUSBSetDeviceNameMode | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_DEVICE_NAME_MODE * | pNameMode
| ) |  |

Sets device name pattern of USB device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | pNameMode | Device name pattern

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 pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_DEVICE_NAME_MODE t_mode=MWCAP_DEVICE_NAME_SERIAL_NUMBER;
MWUSBSetDeviceNameMode(hChannel, &t_mode);
...
MWUSBSaveOptions(hChannel);
...
MWCloseChannel(hChannel);
MWUSBSetDeviceNameMode
MW_RESULT LIBMWCAPTURE_API MWUSBSetDeviceNameMode(HUSBCHANNEL hChannel, MWCAP_DEVICE_NAME_MODE *pNameMode)
Sets device name pattern of USB device.

## ◆ MWUSBSetEDIDMode()

MW_RESULT LIBMWCAPTURE_API MWUSBSetEDIDMode | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_EDID_MODE | mode
| ) |  |

Sets the edid mode.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | mode | The edid mode set to device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or NW_INVALID_PARAMS

## ◆ MWUSBSetNotifyEnable()

MW_RESULT LIBMWCAPTURE_API MWUSBSetNotifyEnable | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_NOTIFY_ENABLE * | pNotify
| ) |  |

Sets notification types for specified channel.

Parameters

  [in] | hChannel | Channel handle of the USB device
  [in] | pNotify | Notification

Returns
  Function return values are as follows

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

Usage:
Sets notification types for the specified channel.

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_NOTIFY_ENABLE t_notify;
t_notify.bInterrupt=false;
t_notify.ullEnableBits=MWCAP_NOTIFY_xxx|MWCAP_NOTIFY_xxx|...;
...
MWUSBSetNotifyEnable(hChannel, &t_notify);
...
MWCloseChannel(hChannel);

## ◆ MWUSBSetStatusImageMode()

MW_RESULT LIBMWCAPTURE_API MWUSBSetStatusImageMode | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_STATUS_IMAGE_MODE * | pImageMode
| ) |  |

Sets the image pattern showed when there is not a valid input signal.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | pImageMode | The image pattern showed when there is not a valid input signal

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 image pattern showed when there is not a valid input signal.

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_STATUS_IMAGE_MODE t_mode=MWCAP_STATUS_IMAGE_BLUE;
MWUSBSetStatusImageMode(hChannel, &t_mode);
...
MWUSBSaveOptions(hChannel);
...
MWCloseChannel(hChannel);
MWUSBSetStatusImageMode
MW_RESULT LIBMWCAPTURE_API MWUSBSetStatusImageMode(HUSBCHANNEL hChannel, MWCAP_STATUS_IMAGE_MODE *pImageMode)
Sets the image pattern showed when there is not a valid input signal.

## ◆ MWUSBSetVideoAutoHAlign()

MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoAutoHAlign | ( | HUSBCHANNEL | hChannel,
|  | bool_t | pbAutoHAlign
| ) |  |

Sets video horizontal alignment.

Parameters

  [in] | hChannel | Channel handle of USB device
  [out] | pbAutoHAlign | The flag of the auto horizontal aligned set to the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBSetVideoCaptureProcessSettings()

MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoCaptureProcessSettings | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_PROCESS_SETTINGS * | pProcSettings
| ) |  |

Sets the video process settings of the video capture device.

Parameters

  [in] | hChannel | Input the opened channel handle
  [in] | pProcSettings | The video process settings information

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBSetVideoOutputFOURCC()

MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFOURCC | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_OUTPUT_FOURCC * | pOutputFourCC
| ) |  |

Sets capture formats supported by the USB device, 3 at most.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | pOutputFourCC | Supported capture 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:
Sets capture formats supported by the USB device, which is 3 at most. The function must work with MWUSBSaveOptions, and plugs and reconnects the USB device after setting, then the function will work.

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_VIDEO_OUTPUT_FOURCC t_fmt;
MWUSBGetVideoOutputFOURCC(hChannel ,&t_fmt);
t_fmt.xx=...;
MWUSBSetVideoOutputFOURCC(hChannel ,&t_fmt);
...
MWUSBSaveOptions(hChannel);
...
MWCloseChannel(hChannel);
MWUSBSetVideoOutputFOURCC
MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFOURCC(HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FOURCC *pOutputFourCC)
Sets capture formats supported by the USB device, 3 at most.

## ◆ MWUSBSetVideoOutputFrameInterval()

MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFrameInterval | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL * | pFrameInterval
| ) |  |

Sets capture intervals supported by USB device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | pFrameInterval | Capture intervals

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 pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL t_internal;
MWUSBGetVideoOutputFrameInterval(hChannel, &t_internal);
...
t_internal.xx=...;
...
MWUSBSetVideoOutputFrameInterval(hChannel, &t_internal);
...
MWUSBSaveOptions(hChannel);
...
MWCloseChannel(hChannel);

## ◆ MWUSBSetVideoOutputFrameSize()

MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFrameSize | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_OUTPUT_FRAME_SIZE * | pFrameSize
| ) |  |

Sets resolutions supported by the USB device.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | pFrameSize | Resolutions supported by the USB 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:

WCHAR pDevicePath[128] = {0};
mr = MWGetDevicePath(i, pDevicePath);
...
HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
...
MWCAP_VIDEO_OUTPUT_FRAME_SIZE t_fsize;
MWUSBGetVideoOutputFrameSize(hChannel, &t_fsize);
...
t_fsize.xx=...;
...
MWUSBSetVideoOutputFrameSize(hChannel, &t_fsize);
...
MWUSBSaveOptions(hChannel);
...
MWCloseChannel(hChannel);

## ◆ MWUSBSetVideoSamplingPhase()

MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoSamplingPhase | ( | HUSBCHANNEL | hChannel,
|  | uint8_t * | puSamplingPhase
| ) |  |

Sets video sampling phase.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | puSamplingPhase | The value of the sampling phase set to the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBSetVideoSamplingPhaseAutoAdjust()

MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoSamplingPhaseAutoAdjust | ( | HUSBCHANNEL | hChannel,
|  | bool_t * | pbAutoSamplingPhase
| ) |  |

Sets video sampling phase auto adjust.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | pbAutoSamplingPhase | The automatic adjustment flag of the sample phase set to the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBSetVideoTiming()

MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoTiming | ( | HUSBCHANNEL | hChannel,
|  | MWCAP_VIDEO_TIMING * | pTiming
| ) |  |

Sets default video timing.

Parameters

  [in] | hChannel | Channel handle of USB device
  [in] | pTiming | The video timing set to the capture device

Returns
  Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or MW_INVALID_PARAMS

## ◆ MWUSBUnRegisterHotPlug()

MW_RESULT LIBMWCAPTURE_API MWUSBUnRegisterHotPlug | ( |  | ) |

Unregisters hotplug callback function.

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:
hotplug callback function of USB capture device.
Refers to MWUSBRegisterHotPlug