MWCapture SDK Linux  3.3.1.LAST_SVN_COMMIT_NUM
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. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBUnRegisterHotPlug ()
 Unregisters hotplug callback function. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSetNotifyEnable (HUSBCHANNEL hChannel, MWCAP_NOTIFY_ENABLE *pNotify)
 Sets notification types for specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetNotifyStatus (HUSBCHANNEL hChannel, uint64_t *pullStatusBit)
 Gets notification status of USB specified channel. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSetFirmwareErase (HUSBCHANNEL hChannel, uint32_t cbOffset, uint32_t cbErase)
 Erases firmware data from USB device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetFirmwareReadAddress (HUSBCHANNEL hChannel, uint32_t *pdwAddress)
 Gets read address of USB device firmware. More...
 
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. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetLoopThroughValid (HUSBCHANNEL hChannel, bool_t *pbValid)
 Gets whether the loopthrough interface in the USB device is valid. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetAudioVolume (HUSBCHANNEL hChannel, MWCAP_USB_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
 Gets the volume of USB audio device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSetAudioVolume (HUSBCHANNEL hChannel, MWCAP_USB_AUDIO_NODE audioNode, MWCAP_AUDIO_VOLUME *pVolume)
 Sets the volume of USB audio device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFOURCC (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FOURCC *pOutputFourCC)
 Gets capture formats supported by the USB device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFOURCC (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FOURCC *pOutputFourCC)
 Sets capture formats supported by the USB device, 3 at most. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFrameSize (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_SIZE *pFrameSize)
 Gets resolutions of captured images supported by the USB device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFrameSize (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_SIZE *pFrameSize)
 Sets resolutions supported by the USB device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFrameInterval (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL *pFrameInterval)
 Gets capture intervals supported by USB device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFrameInterval (HUSBCHANNEL hChannel, MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL *pFrameInterval)
 Sets capture intervals supported by USB device. More...
 
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. More...
 
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. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetDeviceNameMode (HUSBCHANNEL hChannel, MWCAP_DEVICE_NAME_MODE *pNameMode)
 Gets device name pattern of USB device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSetDeviceNameMode (HUSBCHANNEL hChannel, MWCAP_DEVICE_NAME_MODE *pNameMode)
 Sets device name pattern of USB device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSaveOptions (HUSBCHANNEL hChannel)
 Saves configurations. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBLoadOptions (HUSBCHANNEL hChannel)
 Loads the saved configurations. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBResetOptions (HUSBCHANNEL hChannel)
 Restores to the default settings. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetExtensionSupported (HUSBCHANNEL hChannel, uint32_t *pdwFlag)
 Gets extended Hid interfaces supported by USB device. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetEDIDMode (HUSBCHANNEL hChannel, MWCAP_EDID_MODE *pMode)
 Gets current edid mode. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBSetEDIDMode (HUSBCHANNEL hChannel, MWCAP_EDID_MODE mode)
 Sets the edid mode. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoCaptureSupportFrameRate (HCHANNEL hChannel, MWCAP_VIDEO_FRAMERATE *pFramerate, int *nCount)
 Gets frame rates supported by USB device based on v4l. More...
 
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoCaptureSupportFrameRateEx (HCHANNEL hChannel, MWCAP_VIDEO_FRAMERATE_EX *pFramerate, int *nCount)
 Gets frame rates supported by USB device based on v4l. More...
 

Detailed Description

Function Documentation

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]hChannelChannel handle of USB device
[in]audioNodeAudio device
[out]pVolumeVolume 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.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_AUDIO_VOLUME t_vol;
7 MWUSBGetAudioVolume(hChannel, MWCAP_USB_AUDIO_EMBEDDED_CAPTURE, &t_vol);
8 ...
9 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetDeviceNameMode ( HUSBCHANNEL  hChannel,
MWCAP_DEVICE_NAME_MODE *  pNameMode 
)

Gets device name pattern of USB device.

Parameters
[in]hChannelChannel handle of USB device
[out]pNameModeDevice 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_DEVICE_NAME_MODE t_mode;
7 MWUSBGetDeviceNameMode(hChannel, &t_mode);
8 ...
9 MWCloseChannel(hChannel);
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]hChannelChannel handle of USB device
[out]pbyEDIDEDID
[in,out]pcbEDIDAs an input parameter, it indicates the size of the area which is pointed by the pbyEDID. As an output parameter, it indicates 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.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 uint32_t t_cd_edid=256;
7 unsigned char t_hc_edid[256];
8 MWUSBGetEDIDloopthrough(hChannel, t_hc_edid, &t_cd_edid);
9 ...
10 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetEDIDMode ( HUSBCHANNEL  hChannel,
MWCAP_EDID_MODE *  pMode 
)

Gets current edid mode.

Parameters
[in]hChannelChannel handle of USB device
[out]pModeThe edid mode of device
Returns
Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or NW_INVALID_PARAMS
MW_RESULT LIBMWCAPTURE_API MWUSBGetExtensionSupported ( HUSBCHANNEL  hChannel,
uint32_t *  pdwFlag 
)

Gets extended Hid interfaces supported by USB device.

Parameters
[in]hChannelChannel handle of USB device
[out]pdwFlagFlag of the extended supported Hid interfaces
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 meaning of the pdwFlag refers to MWCAP_HID_EXTENSION_XX.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 uint32_t t_flag=0;
7 MWUSBGetExtensionSupported(hChannel, &t_flag);
8 ...
9 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetFirmwareReadAddress ( HUSBCHANNEL  hChannel,
uint32_t *  pdwAddress 
)

Gets read address of USB device firmware.

Parameters
[in]hChannelChannel handle of USB device
[out]pdwAddressRead address of firmware
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 pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 uint32_t t_address;
7 MWUSBGetFirmwareReadAddress(hChannel, &t_address);
8 ...
9 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetLoopThroughValid ( HUSBCHANNEL  hChannel,
bool_t *  pbValid 
)

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

Parameters
[in]hChannelChannel handle of USB device
[out]pbValidWhether there is a valid 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 bool_t t_valid=false;
7 MWUSBGetloopthroughValid(hChannel, &t_valid);
8 ...
9 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetNotifyStatus ( HUSBCHANNEL  hChannel,
uint64_t *  pullStatusBit 
)

Gets notification status of USB specified channel.

Parameters
[in]hChannelChannel handle of USB device
[out]pullStatusBitNotification 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.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_NOTIFY_ENABLE t_notify;
7 t_notify.bInterrupt=false;
8 t_notify.ullEnableBits=MWCAP_NOTIFY_xxx|MWCAP_NOTIFY_xxx|...;
9 ...
10 MWUSBSetNotifyEnable(hChannel, &t_notify);
11 ...
12 uint64_t t_status=0;
13 MWUSBGetNotifyStatus(hChannel, &t_status);
14 if(t_status & MWCAP_NOTIFY_xxx){
15  ...
16 }
17 ...
18 MWCloseChannel(hChannel);
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]hChannelChannel handle of USB device
[out]pImageModeThe 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.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_STATUS_IMAGE_MODE t_mode;
7 MWUSBGetStatusImageMode(hChannel, &t_mode);
8 ...
9 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoCaptureSupportFrameRate ( HCHANNEL  hChannel,
MWCAP_VIDEO_FRAMERATE pFramerate,
int *  nCount 
)

Gets frame rates supported by USB device based on v4l.

Parameters
[in]hChannelChannel handle of USB device
[out]pFramerateFrame rates supported by USB device. When it is set to NULL, only the number of supported frame rates is returned.
[in,out]nCountAs an input parameter, it indicates the pointer points to the size of pFramerate array. As an output parameter, it indicates the number of capture frame rates 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 int t_n_count = 0;
7 MWUSBGetVideoCaptureSupportFrameRate(hChannel, NULL, &t_n_count);
8 if(t_n_count > 0){
9  MWCAP_VIDEO_FRAMERATE* t_p_rate=new MWCAP_VIDEO_FRAMERATE[t_n_count];
10  MWUSBGetVideoCaptureSupportFrameRate(hChannel,t_p_rate,&t_n_count);
11 }
12 ...
13 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoCaptureSupportFrameRateEx ( HCHANNEL  hChannel,
MWCAP_VIDEO_FRAMERATE_EX pFramerate,
int *  nCount 
)

Gets frame rates supported by USB device based on v4l.

Parameters
[in]hChannelChannel handle of USB device
[out]pFramerateCapture frame rates supported by USB device
[in,out]nCountAs an input parameter, it indicates the pointer points to the size of pFramerate array. As an output parameter, it indicates the number of capture frame rates 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 int t_n_count = 0;
7 MWUSBGetVideoCaptureSupportFrameRateEx(hChannel, NULL, &t_n_count);
8 if(t_n_count > 0){
9  MWCAP_VIDEO_FRAMERATE_EX* t_p_rate=new MWCAP_VIDEO_FRAMERATE_EX[t_n_count];
10  MWUSBGetVideoCaptureSupportFrameRateEx(hChannel, t_p_rate, &t_n_count);
11 }
12 ...
13 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFOURCC ( HUSBCHANNEL  hChannel,
MWCAP_VIDEO_OUTPUT_FOURCC pOutputFourCC 
)

Gets capture formats supported by the USB device.

Parameters
[in]hChannelChannel handle of USB device
[out]pOutputFourCCSupported 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_VIDEO_OUTPUT_FOURCC t_fmt;
7 MWUSBGetVideoOutputFOURCC(hChannel, &t_fmt);
8 ...
9 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBGetVideoOutputFrameInterval ( HUSBCHANNEL  hChannel,
MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL pFrameInterval 
)

Gets capture intervals supported by USB device.

Parameters
[in]hChannelChannel handle of USB device
[out]pFrameIntervalCapture 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL t_internal;
7 MWUSBGetVideoOutputFrameInterval(hChannel, &t_internal);
8 ...
9 MWCloseChannel(hChannel);
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]hChannelChannel handle of USB device
[out]pFrameSizeResolutions 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_VIDEO_OUTPUT_FRAME_SIZE t_fsize;
7 MWUSBGetVideoOutputFrameSize(hChannel ,& t_fsize);
8 ...
9 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBLoadOptions ( HUSBCHANNEL  hChannel)

Loads the saved configurations.

Parameters
[in]hChannelChannel 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWUSBLoadOptions(hChannel);
7 ...
8 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBRegisterHotPlug ( LPFN_HOT_PLUG_CALLBACK  lpfnCallback,
void *  pParam 
)

Registers hotplug callback function of USB capture device.

Parameters
[in]lpfnCallbackCallback function
[in]pParamCallback parameter
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.

1 static void HotplugCheckCallback(MWUSBHOT_PLUG_EVETN event, const char *pszDevicePath, void* pParam)
2 {
3  ...
4 }
5 ...
6 MWCaptureInitInstance();
7 ...
8 mr = MWUSBRegisterHotPlug(HotplugCheckCallback, NULL);
9 ...
10 mr = MWUSBUnRegisterHotPlug();
11 ...
12 MWCaptureExitInstance();
MW_RESULT LIBMWCAPTURE_API MWUSBResetOptions ( HUSBCHANNEL  hChannel)

Restores to the default settings.

Parameters
[in]hChannelChannel 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWUSBResetOptions(hChannel);
7 ...
8 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBSaveOptions ( HUSBCHANNEL  hChannel)

Saves configurations.

Parameters
[in]hChannelChannel 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

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWUSBSaveOptions(hChannel);
7 ...
8 MWCloseChannel(hChannel);
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]hChannelChannel handle of USB device
[in]audioNodeAudio device
[in]pVolumeAudio 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.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_AUDIO_VOLUME t_vol;
7 MWUSBGetAudioVolume(hChannel, MWCAP_USB_AUDIO_EMBEDDED_CAPTURE, &t_vol);
8 t_vol.xx=...;
9 MWUSBSetAudioVolume(hChannel, MWCAP_USB_AUDIO_EMBEDDED_CAPTURE, &t_vol);
10 ...
11 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBSetDeviceNameMode ( HUSBCHANNEL  hChannel,
MWCAP_DEVICE_NAME_MODE *  pNameMode 
)

Sets device name pattern of USB device.

Parameters
[in]hChannelChannel handle of USB device
[in]pNameModeDevice 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_DEVICE_NAME_MODE t_mode=MWCAP_DEVICE_NAME_SERIAL_NUMBER;
7 MWUSBSetDeviceNameMode(hChannel, &t_mode);
8 ...
9 MWUSBSaveOptions(hChannel);
10 ...
11 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBSetEDIDMode ( HUSBCHANNEL  hChannel,
MWCAP_EDID_MODE  mode 
)

Sets the edid mode.

Parameters
[in]hChannelChannel handle of USB device
[out]modeThe edid mode set to device
Returns
Returns MW_SUCCEED if succeeded, otherwise returns MW_FAILED or NW_INVALID_PARAMS
MW_RESULT LIBMWCAPTURE_API MWUSBSetFirmwareErase ( HUSBCHANNEL  hChannel,
uint32_t  cbOffset,
uint32_t  cbErase 
)

Erases firmware data from USB device.

Parameters
[in]hChannelChannel handle of USB device
[in]cbOffsetAddress offset
[in]cbEraseErased size
Returns
Function return values are as follows
MW_SUCCEEDED Function call succeeded.
MW_FAILED Function call failed.
MW_INVALID_PARAMS Input invalid value(s).
MW_RESULT LIBMWCAPTURE_API MWUSBSetNotifyEnable ( HUSBCHANNEL  hChannel,
MWCAP_NOTIFY_ENABLE pNotify 
)

Sets notification types for specified channel.

Parameters
[in]hChannelChannel handle of the USB device
[in]pNotifyNotification
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.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_NOTIFY_ENABLE t_notify;
7 t_notify.bInterrupt=false;
8 t_notify.ullEnableBits=MWCAP_NOTIFY_xxx|MWCAP_NOTIFY_xxx|...;
9 ...
10 MWUSBSetNotifyEnable(hChannel, &t_notify);
11 ...
12 MWCloseChannel(hChannel);
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]hChannelChannel handle of USB device
[in]pImageModeThe 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.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_STATUS_IMAGE_MODE t_mode=MWCAP_STATUS_IMAGE_BLUE;
7 MWUSBSetStatusImageMode(hChannel, &t_mode);
8 ...
9 MWUSBSaveOptions(hChannel);
10 ...
11 MWCloseChannel(hChannel);
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]hChannelChannel handle of USB device
[in]pOutputFourCCSupported 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.

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_VIDEO_OUTPUT_FOURCC t_fmt;
7 MWUSBGetVideoOutputFOURCC(hChannel ,&t_fmt);
8 t_fmt.xx=...;
9 MWUSBSetVideoOutputFOURCC(hChannel ,&t_fmt);
10 ...
11 MWUSBSaveOptions(hChannel);
12 ...
13 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFrameInterval ( HUSBCHANNEL  hChannel,
MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL pFrameInterval 
)

Sets capture intervals supported by USB device.

Parameters
[in]hChannelChannel handle of USB device
[in]pFrameIntervalCapture 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_VIDEO_OUTPUT_FRAME_INTERVAL t_internal;
7 MWUSBGetVideoOutputFrameInterval(hChannel, &t_internal);
8 ...
9 t_internal.xx=...;
10 ...
11 MWUSBSetVideoOutputFrameInterval(hChannel, &t_internal);
12 ...
13 MWUSBSaveOptions(hChannel);
14 ...
15 MWCloseChannel(hChannel);
MW_RESULT LIBMWCAPTURE_API MWUSBSetVideoOutputFrameSize ( HUSBCHANNEL  hChannel,
MWCAP_VIDEO_OUTPUT_FRAME_SIZE pFrameSize 
)

Sets resolutions supported by the USB device.

Parameters
[in]hChannelChannel handle of USB device
[in]pFrameSizeResolutions 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:

1 char pDevicePath[128] = {0};
2 mr = MWGetDevicePath(i, pDevicePath);
3 ...
4 HCHANNEL hChannel = MWOpenChannelByPath(pDevicePath);
5 ...
6 MWCAP_VIDEO_OUTPUT_FRAME_SIZE t_fsize;
7 MWUSBGetVideoOutputFrameSize(hChannel, &t_fsize);
8 ...
9 t_fsize.xx=...;
10 ...
11 MWUSBSetVideoOutputFrameSize(hChannel, &t_fsize);
12 ...
13 MWUSBSaveOptions(hChannel);
14 ...
15 MWCloseChannel(hChannel);
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:
Unregisters hotplug callback function of USB capture device.
Refers to MWUSBRegisterHotPlug