Angad
Angad

Reputation: 92

How to get multiple cams connected

I am trying to connect multiple webcams at the same time but it produces the Video source dialog to select the webcam. IS there any way to bypass it? Can I pass the webcamm info explicitly?

Here is the code that is producing the problem

Dim infoReturn As VariantType
infoReturn = SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, iDevice, 0)
If SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, iDevice, 0) Then
  'Set the preview scale
  Call SendMessage(hHwnd, WM_CAP_SET_SCALE, True, 0)

WM_CAP_DRIVER_CONNECT is the message that shows the dialog.

any help will be appreciated.

Thanks

Upvotes: 0

Views: 631

Answers (1)

Roman Ryltsov
Roman Ryltsov

Reputation: 69687

You send WM_CAP_DRIVER_CONNECT twice, you don't need to. This is ancient Video for Windows API and you don't have flexibility to override default behavior, nor you have support for full range of video capture sources with it.

Perhaps you should rather look into switching to newer APIs (DriectShow/Media Foundation).

Upvotes: 0

Related Questions