Skip to content

Commit

Permalink
Add discovery support in composite driver, refs #332
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Nov 3, 2017
1 parent d2d9a40 commit facdf3b
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import java.util.List;


public class WebcamCompositeDriver implements WebcamDriver {
public class WebcamCompositeDriver implements WebcamDriver, WebcamDiscoverySupport {

private List<WebcamDriver> drivers = new ArrayList<WebcamDriver>();

private int scanInterval = -1;

public WebcamCompositeDriver(WebcamDriver... drivers) {
for (WebcamDriver driver : drivers) {
this.drivers.add(driver);
Expand Down Expand Up @@ -42,4 +44,21 @@ public boolean isThreadSafe() {
}
return safe;
}

public void setScanInterval(int scanInterval) {
this.scanInterval = scanInterval;
}

@Override
public long getScanInterval() {
if (scanInterval <= 0) {
return DEFAULT_SCAN_INTERVAL;
}
return scanInterval;
}

@Override
public boolean isScanPossible() {
return true;
}
}

0 comments on commit facdf3b

Please sign in to comment.