|
Bartosz Firyn (SarXos) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.sarxos.webcam.WebcamLock
public class WebcamLock
This class is used as a global (system) lock preventing other processes from using the same camera while it's open. Whenever webcam is open there is a thread running in background which updates the lock once per 2 seconds. Lock is being released whenever webcam is either closed or completely disposed. Lock will remain for at least 2 seconds in case when JVM has not been gracefully terminated (due to SIGSEGV, SIGTERM, etc).
Field Summary | |
---|---|
static long |
INTERVAL
Update interval (ms). |
Method Summary | |
---|---|
void |
disable()
Completely disable locking mechanism. |
boolean |
isLocked()
Check if webcam is locked. |
void |
lock()
Lock webcam. |
void |
unlock()
Unlock webcam. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long INTERVAL
Method Detail |
---|
public void lock()
public void disable()
public void unlock()
public boolean isLocked()
|
Bartosz Firyn (SarXos) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |