mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add methods to get property name and enumerate properties.
Also add method to remove property by handle.
This commit is contained in:
@@ -69,6 +69,7 @@ public class CameraServerJNI {
|
||||
// Property Functions
|
||||
//
|
||||
public static native int getPropertyType(int property);
|
||||
public static native String getPropertyName(int property);
|
||||
public static native boolean getBooleanProperty(int property);
|
||||
public static native void setBooleanProperty(int property, boolean value);
|
||||
public static native double getDoubleProperty(int property);
|
||||
@@ -102,6 +103,7 @@ public class CameraServerJNI {
|
||||
public static native long getSourceLastFrameTime(int source);
|
||||
public static native int getSourceNumChannels(int source);
|
||||
public static native boolean isSourceConnected(int source);
|
||||
public static native int[] enumerateSourceProperties(int source);
|
||||
public static native int copySource(int source);
|
||||
public static native void releaseSource(int source);
|
||||
|
||||
@@ -118,7 +120,8 @@ public class CameraServerJNI {
|
||||
// int type,
|
||||
// void (*onChange)(String name,
|
||||
// int property));
|
||||
public static native void removeSourceProperty(int source, String name);
|
||||
public static native void removeSourceProperty(int source, int property);
|
||||
public static native void removeSourcePropertyByName(int source, String name);
|
||||
|
||||
//
|
||||
// Sink Creation Functions
|
||||
|
||||
@@ -60,9 +60,15 @@ public class CvSource extends VideoSource {
|
||||
// std::function<void(String name, VideoProperty property)>
|
||||
// onChange);
|
||||
|
||||
/// Remove a property.
|
||||
/// @param name Property name
|
||||
//public void removeProperty(VdeoProperty property) {
|
||||
// CameraServerJNI.removeSourceProperty(m_handle, property.m_handle);
|
||||
//}
|
||||
|
||||
/// Remove a property.
|
||||
/// @param name Property name
|
||||
public void removeProperty(String name) {
|
||||
CameraServerJNI.removeSourceProperty(m_handle, name);
|
||||
CameraServerJNI.removeSourcePropertyByName(m_handle, name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,9 @@ public class VideoSource {
|
||||
/// the given name exists)
|
||||
//public VideoProperty getProperty(String name);
|
||||
|
||||
/// Enumerate all properties of this source.
|
||||
//public VideoProperty[] enumerateProperties();
|
||||
|
||||
/// Enumerate all existing sources.
|
||||
/// @return Vector of sources.
|
||||
public static VideoSource[] enumerateSources() {
|
||||
|
||||
Reference in New Issue
Block a user