mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Improve listener interface.
Now a structure is passed back, enabling combining the existing source and sink listeners and adding property listeners as well.
This commit is contained in:
@@ -800,27 +800,14 @@ JNIEXPORT void JNICALL Java_edu_wpi_cameraserver_CameraServerJNI_setSinkEnabled
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_cameraserver_CameraServerJNI
|
||||
* Method: removeSourceListener
|
||||
* Method: removeListener
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cameraserver_CameraServerJNI_removeSourceListener
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cameraserver_CameraServerJNI_removeListener
|
||||
(JNIEnv *env, jclass, jint handle)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
cs::RemoveSourceListener(handle, &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_cameraserver_CameraServerJNI
|
||||
* Method: removeSinkListener
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_edu_wpi_cameraserver_CameraServerJNI_removeSinkListener
|
||||
(JNIEnv *env, jclass, jint handle)
|
||||
{
|
||||
CS_Status status = 0;
|
||||
cs::RemoveSinkListener(handle, &status);
|
||||
cs::RemoveListener(handle, &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
|
||||
@@ -156,16 +156,10 @@ public class CameraServerJNI {
|
||||
//
|
||||
// Listener Functions
|
||||
//
|
||||
//public static native int addSourceListener(void (*callback)(String name, int source,
|
||||
// int event),
|
||||
//public static native int addListener(void (*callback)(VideoEvent event),
|
||||
// int eventMask);
|
||||
|
||||
public static native void removeSourceListener(int handle);
|
||||
|
||||
//public static native int addSinkListener(void (*callback)(String name, int sink, int event),
|
||||
// int eventMask);
|
||||
|
||||
public static native void removeSinkListener(int handle);
|
||||
public static native void removeListener(int handle);
|
||||
|
||||
//
|
||||
// Utility Functions
|
||||
|
||||
Reference in New Issue
Block a user