I am using multi input camera(bt878 chip) and have connected two cameras to chip. When I try to get the driver description I am getting only one driver.When I send the command to preview the video I can see the first camera.If I change the frame rate I can see the second camera also.But I am not knowing how to access both the cameras at the same time.(If I try to connect the same driver with the different frame rate its accessing the first camera but not the second camera )
Here is the sample code
Sub LoadDeviceList()
Dim strName As String = Space(100)
Dim strVer As String = Space(100)
Dim bReturn As Boolean
Dim x As Integer = 0
Do
bReturn = capGetDriverDescriptionA(x, strName, 100, strVer, 100)
If bReturn Then lstDevices.Items.Add(strName.Trim)
x += 1
Loop Until bReturn = False
End Sub
Private Sub OpenPreviewWindow()
Dim iHeight As Integer = picCapture.Height
Dim iWidth As Integer = picCapture.Width
hHwnd = capCreateCaptureWindowA("camera1", WS_VISIBLE Or WS_CHILD, 0, 0, 640, 480, picCapture.Handle.ToInt32, 0)
hHwnd1 = capCreateCaptureWindowA("camera2", WS_VISIBLE Or WS_CHILD, 0, 0, 640, 480, picCapture1.Handle.ToInt32, 0)
If SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, iDevice, 0) Then
SendMessage(hHwnd, WM_CAP_SET_SCALE, True, 0)
SendMessage(hHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0)
SendMessage(hHwnd, WM_CAP_SET_PREVIEW, True, 0)
SetWindowPos(hHwnd, HWND_BOTTOM, 0, 0, picCapture.Width, picCapture.Height, SWP_NOMOVE Or SWP_NOZORDER)
btnSave.Enabled = True
btnStop.Enabled = True
btnStart.Enabled = False
Else
DestroyWindow(hHwnd)
btnSave.Enabled = False
End If
If SendMessage(hHwnd1, WM_CAP_DRIVER_CONNECT, iDevice, 0) Then
SendMessage(hHwnd1, WM_CAP_SET_SCALE, True, 0)
SendMessage(hHwnd1, WM_CAP_SET_PREVIEWRATE, 66, 0)
SendMessage(hHwnd1, WM_CAP_SET_PREVIEW, True, 0)
SetWindowPos(hHwnd1, HWND_BOTTOM, 0, 0, picCapture1.Width, picCapture1.Height, SWP_NOMOVE Or SWP_NOZORDER)
btnSave.Enabled = True
btnStop.Enabled = True
btnStart.Enabled = False
Else
DestroyWindow(hHwnd)
btnSave.Enabled = False
End If
End Sub