groupgets / purethermal1-uvc-capture

USB Video Class capture examples for PureThermal 1 / PureThermal 2 FLIR Lepton Dev Kit
125 stars 81 forks source link

Select device based on serialNr with Media Foundation under Windows #57

Open sayezz opened 2 years ago

sayezz commented 2 years ago

Hi, can somebody explain/show me how to select the camera based on the serial number (lets assume I have two Lepton cams connected to the computer) with Windows Media Foundation?

In the current implementation first the device gets selected based on the device path (which is partly identical for all Lepton cams). Retrieving the device information (like serial number) happens only later.

    if (!SelectDevice()) // here the camera gets selected
    {
        return;
    }
    if (!InitializeDevice())
    {
        return;
    }
    if (!InitializeXuGuidToNodeMap()) // here I can retrieve the serial number
    {
        return;
    }

Do I need first to open all cameras, comparing the serial number to the one I want to use and then close all the other cameras again?