Merge pull request #21 from akexorcist/feature/device-scanning-supports

feat: add webcam discovery supports
This commit is contained in:
Eduardo Ramos 2024-04-09 09:27:29 +02:00 committed by GitHub
commit 5885050069
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package com.github.eduramiba.webcamcapture.drivers;
import com.github.eduramiba.webcamcapture.drivers.avfoundation.driver.AVFDriver;
import com.github.eduramiba.webcamcapture.drivers.capturemanager.CaptureManagerDriver;
import com.github.sarxos.webcam.WebcamDevice;
import com.github.sarxos.webcam.WebcamDiscoverySupport;
import com.github.sarxos.webcam.WebcamDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -11,7 +12,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Locale;
public class NativeDriver implements WebcamDriver {
public class NativeDriver implements WebcamDriver, WebcamDiscoverySupport {
private static final Logger LOG = LoggerFactory.getLogger(NativeDriver.class);
private final WebcamDriver driver;
@ -49,4 +50,14 @@ public class NativeDriver implements WebcamDriver {
public boolean isThreadSafe() {
return driver.isThreadSafe();
}
@Override
public long getScanInterval() {
return DEFAULT_SCAN_INTERVAL;
}
@Override
public boolean isScanPossible() {
return true;
}
}