Methods Summary |
---|
private static native boolean | cacheFieldIDs()
|
public boolean | connect(int devnum)
return connect(devnum, 1);
|
public boolean | connect(int devnum, int port)
if (available)
synchronized (OPILock) {
return opiConnect(devnum, port);
}
else
return false;
|
public boolean | disconnect()
if (available)
synchronized (OPILock) {
return opiDisconnect();
}
else
return false;
|
public void | finalize()
if (available)
synchronized (OPILock) {
opiDisconnect();
}
|
public int | getHeight()
if (available)
synchronized (OPILock) {
return opiGetHeight();
}
else
return 0;
|
public int | getLineStride()
if (available)
synchronized (OPILock) {
return opiGetLineStride();
}
else
return 0;
|
public int | getWidth()
if (available)
synchronized (OPILock) {
return opiGetWidth();
}
else
return 0;
|
public static boolean | isAvailable()
try {
com.sun.media.JMFSecurityManager.loadLibrary("jmutil");
com.sun.media.JMFSecurityManager.loadLibrary("jmopi");
if (opiInitialize() && cacheFieldIDs())
available = true;
else
System.err.println("OPICapture initialize failed");
} catch (Exception e) {
System.err.println("OPICapture initialize failed: " + e);
} catch (UnsatisfiedLinkError ule) {
System.err.println("OPICapture initialize failed: " + ule);
}
return available;
|
private native boolean | opiConnect(int devnum, int port)
|
private native boolean | opiDisconnect()
|
private native int | opiGetHeight()
|
private native int | opiGetLineStride()
|
private native int | opiGetWidth()
|
private static native boolean | opiInitialize()
|
private native boolean | opiLittleEndian()
|
private native int | opiRead(byte[] buf, int len)
|
private native boolean | opiSetBitRate(int bitrate)
|
private native boolean | opiSetCompress(java.lang.String compress)
|
private native boolean | opiSetFrameRate(int fps)
|
private native boolean | opiSetPort(int port)
|
private native boolean | opiSetQuality(int quality)
|
private native boolean | opiSetScale(int scale)
|
private native boolean | opiSetSignal(java.lang.String signal)
|
private native boolean | opiStart()
|
private native boolean | opiStop()
|
public int | read(byte[] buf, int len)
int rlen = 0;
if (available) {
synchronized (OPILock) {
rlen = opiRead(buf, len);
}
if (rlen < 0) {
throw (new IOException("OPICapture read() failed"));
}
} else {
throw (new IOException("OPICapture shared library not available"));
}
return rlen;
|
public boolean | setBitRate(int bitrate)
if (available)
synchronized (OPILock) {
return opiSetBitRate(bitrate);
}
else
return false;
|
public boolean | setCompress(java.lang.String compress)
if (available)
synchronized (OPILock) {
return opiSetCompress(compress);
}
else
return false;
|
public boolean | setFrameRate(int fps)
if (available)
synchronized (OPILock) {
return opiSetFrameRate(fps);
}
else
return false;
|
public boolean | setPort(int port)
if (available)
synchronized (OPILock) {
return opiSetPort(port);
}
else
return false;
|
public boolean | setQuality(int quality)
if (available)
synchronized (OPILock) {
return opiSetQuality(quality);
}
else
return false;
|
public boolean | setScale(int scale)
if (available)
synchronized (OPILock) {
return opiSetScale(scale);
}
else
return false;
|
public boolean | setSignal(java.lang.String signal)
if (available)
synchronized (OPILock) {
return opiSetSignal(signal);
}
else
return false;
|
public boolean | start()
if (available)
synchronized (OPILock) {
return opiStart();
}
else
return false;
|
public boolean | stop()
if (available)
synchronized (OPILock) {
return opiStop();
}
else
return false;
|