diff --git a/src/org/jitsi/impl/neomedia/device/Devices.java b/src/org/jitsi/impl/neomedia/device/Devices.java index 3e6794f2a3bbf6b844871eb302fdde19b7e270ec..d94354b818615caea222126a6189c7c5d6edadd2 100644 --- a/src/org/jitsi/impl/neomedia/device/Devices.java +++ b/src/org/jitsi/impl/neomedia/device/Devices.java @@ -20,6 +20,14 @@ */ public abstract class Devices { + /** + * The name of the <tt>ConfigurationService</tt> <tt>boolean</tt> property + * which indicates whether the automatic selection of USB devices must be + * disabled. The default value is <tt>false</tt>. + */ + private static final String PROP_DISABLE_USB_DEVICE_AUTO_SELECTION + = "org.jitsi.impl.neomadia.device.disableUsbDeviceAutoSelection"; + /** * The audio system managing this device list. */ @@ -75,6 +83,21 @@ public ExtendedCaptureDeviceInfo getDevice( if(!devicePreferences.contains( activeDevice.getModelIdentifier())) { + // By default, select automatically the USB devices. + boolean isSelected + = activeDevice.isSameTransportType("USB"); + ConfigurationService cfg + = LibJitsi.getConfigurationService(); + // Desactivate the USB device automatic selection if the + // property is set to true. + if(cfg != null + && cfg.getBoolean( + PROP_DISABLE_USB_DEVICE_AUTO_SELECTION, + false)) + { + isSelected = false; + } + // Adds the device in the preference list (to the end of the // list, but the save device will push it to the top of // active devices). @@ -83,7 +106,7 @@ public ExtendedCaptureDeviceInfo getDevice( property, activeDevice, activeDevices, - activeDevice.isSameTransportType("USB")); + isSelected); } }