code: public static synchronized List<Webcam> getWebcams(long timeout, TimeUnit tunit) throws TimeoutException, WebcamException {
  
  		if (timeout < 0) {
  			throw new IllegalArgumentException(String.format("Timeout cannot be negative (%d)", timeout));
  		}
  		if (tunit == null) {
  			throw new IllegalArgumentException("Time unit cannot be null!");
  		}
  
  		WebcamDiscoveryService discovery = getDiscoveryService();
  
  		assert discovery != null;
  
  		List<Webcam> webcams = discovery.getWebcams(timeout, tunit);
  		if (!discovery.isRunning()) {
  			discovery.start();
  		}
  
  		return webcams;
  	}
docs: Get list of webcams to use. This method will wait given time interval for webcam devices to
  be discovered.
  
  @param timeout the devices discovery timeout
  @param tunit the time unit
  @return List of webcams
  @throws TimeoutException when timeout has been exceeded
  @throws WebcamException when something is wrong
  @throws IllegalArgumentException when timeout is negative or tunit null