-6

It seems the device list will be created only once at startup. Is it possible to update the video source device list during run time. Unfortunately, I can't find a method to do this.

Clemens
  • 123,504
  • 12
  • 155
  • 268
  • 2
    Welcome to Stack Overflow! Please add some code to your question, so we can better understand your question and possibly identify the issue(s). Read [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) before adding your code. – Filnor May 03 '18 at 08:54
  • 1
    Simply call `DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice)` whenever you want updated list of video devices. – Amogh May 03 '18 at 09:46
  • I called `MultimediaUtil.VideoInputNames` from the WPF MediaKit, this calls indirectly `DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice)`. The problem is the class MultimediaUtil. It has a "private cash" for the video input names. Once the input names are initialized the list gets never updated. Now I call `DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice)` directly. Many thanks for your hint! – chfisch May 03 '18 at 11:47

1 Answers1

0

Video capture source list is updated if you do the enumeration from the start (as opposed to reusing enumerator instance you already have).

You can witness this by starting Windows SDK GraphEdit, listing the filters, then connecting a new device and re-checking the list without closing the GraphEdit application.

Roman R.
  • 68,205
  • 6
  • 94
  • 158