mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Add data accessors for USBCamera and MJPEGServer.
USBCamera: getPath() MJPEGServer: getListenAddress() and getPort()
This commit is contained in:
@@ -127,6 +127,11 @@ public class CameraServerJNI {
|
||||
public static native int copySource(int source);
|
||||
public static native void releaseSource(int source);
|
||||
|
||||
//
|
||||
// USBCamera Source Functions
|
||||
//
|
||||
public static native String getUSBCameraPath(int source);
|
||||
|
||||
//
|
||||
// OpenCV Source Functions
|
||||
//
|
||||
@@ -157,6 +162,12 @@ public class CameraServerJNI {
|
||||
public static native int copySink(int sink);
|
||||
public static native void releaseSink(int sink);
|
||||
|
||||
//
|
||||
// MJPEGServer Sink Functions
|
||||
//
|
||||
public static native String getMJPEGServerListenAddress(int sink);
|
||||
public static native int getMJPEGServerPort(int sink);
|
||||
|
||||
//
|
||||
// OpenCV Sink Functions
|
||||
//
|
||||
|
||||
@@ -23,4 +23,14 @@ public class MJPEGServer extends VideoSink {
|
||||
public MJPEGServer(String name, int port) {
|
||||
this(name, "", port);
|
||||
}
|
||||
|
||||
/// Get the listen address of the server.
|
||||
public String getListenAddress() {
|
||||
return CameraServerJNI.getMJPEGServerListenAddress(m_handle);
|
||||
}
|
||||
|
||||
/// Get the port number of the server.
|
||||
public int getPort() {
|
||||
return CameraServerJNI.getMJPEGServerPort(m_handle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,11 @@ public class USBCamera extends VideoSource {
|
||||
return CameraServerJNI.enumerateUSBCameras();
|
||||
}
|
||||
|
||||
/// Get the path to the device.
|
||||
public String getPath() {
|
||||
return CameraServerJNI.getUSBCameraPath(m_handle);
|
||||
}
|
||||
|
||||
/// Set the brightness, as a percentage (0-100).
|
||||
public synchronized void setBrightness(int brightness) {
|
||||
if (brightness > 100) {
|
||||
|
||||
Reference in New Issue
Block a user