Miscellaneous device control (GPIO, VPD, etc...)
It is possible to control vendor-specific features of some video capture devices, like the GPIO, VPD, etc...
- the current state or data can be retrieved by invoking GetMiscDeviceControl
- the new state or data can be put or set invoking PutMiscDeviceControl
GPIO to set the GPIO output state: Invoke PutMiscDeviceControl (mdc_GPIO, ...)
- set the Index parameter specifies the output number (in the 0..3 range).
- set the Value parameter with 1 to activate the output, or 0 to deactivate it.
E.g.: PutMiscDeviceControl (mdc_GPIO, 2, 0) deactivates the output 2 PutMiscDeviceControl (mdc_GPIO, 3, 1) activates the output 3 This function returns true upon success (the preview or recording must be running).
to get the current GPIO output state: Invoke GetMiscDeviceControl (mdc_GPIO, ...)
The Index parameter specifies the output number (in the 0..3 range). This function returns: . 1 if the output is active . 0 is the output is inactive . -1 if the device does not support this feature or the preview or recording is not running.
E.g.:
if GetMiscDeviceControl (mdc_GPIO, 1) = 1 then * output is currently enabled else * output is currently disabled
VPD The VPD (Vital Private Data) is made of an array of 8 bytes and can be set individually for each output.
TO WRITE THE VPD: - initialize each byte of the array individually by invoking 8 times PutMiscDeviceControl (mdc_VPD_Data, index in the array, value) with the index in the [0..7] range, and the value in the [0..255] range (byte). - invoke PutMiscDeviceControl (mdc_VPD, 0, 0)
E.g. to initilialize the VPD with 12, 240, 25, 54, 11, 66, 120, 211, invoke:
PutMiscDeviceControl (mdc_VPD_Data, 0, 12) PutMiscDeviceControl (mdc_VPD_Data, 1, 240) PutMiscDeviceControl (mdc_VPD_Data, 2, 25) PutMiscDeviceControl (mdc_VPD_Data, 3, 54) PutMiscDeviceControl (mdc_VPD_Data, 4, 11) PutMiscDeviceControl (mdc_VPD_Data, 5, 66) PutMiscDeviceControl (mdc_VPD_Data, 6, 120) PutMiscDeviceControl (mdc_VPD_Data, 7, 211) if PutMiscDeviceControl (mdc_VPD, 0, 0) then MsgBox "success" else MsgBox "not supported" end if TO VERIFY THE VPD: - initialize the VPD data array by invoking PutMiscDeviceControl (mdc_VPD_Data, ...) as above - invoke GetMiscDeviceControl (mdc_VPD, 0)
E.g.:
PutMiscDeviceControl (mdc_VPD_Data, 0, 12) PutMiscDeviceControl (mdc_VPD_Data, 1, 240) PutMiscDeviceControl (mdc_VPD_Data, 2, 25) PutMiscDeviceControl (mdc_VPD_Data, 3, 54) PutMiscDeviceControl (mdc_VPD_Data, 4, 11) PutMiscDeviceControl (mdc_VPD_Data, 5, 66) PutMiscDeviceControl (mdc_VPD_Data, 6, 120) PutMiscDeviceControl (mdc_VPD_Data, 7, 211) if GetMiscDeviceControl (mdc_VPD, 0) then MsgBox "VPD correct" else MsgBox "wrong VPD or feature not supported" end if