Opencv device enum rule

The port will be connected at the time of opening, and I would like to know the device enumeration rule in the directshow.