Add methods to get property name and enumerate properties.

Also add method to remove property by handle.
This commit is contained in:
Peter Johnson
2016-08-26 08:19:28 -07:00
parent 0158fd35f0
commit 0fbb2e8a14
10 changed files with 118 additions and 30 deletions

View File

@@ -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

View File

@@ -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);
}
}

View File

@@ -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() {