From 7ca6c5ef342b45026e3e15d7be80e9f7a09a5d71 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 24 Oct 2016 22:29:58 -0700 Subject: [PATCH] Remove RemoveSourceProperty. --- include/cameraserver_c.h | 4 -- include/cameraserver_cpp.h | 4 -- include/cameraserver_oo.h | 8 ---- include/cameraserver_oo.inl | 10 ----- java/lib/CameraServerJNI.cpp | 26 ------------- .../edu/wpi/cameraserver/CameraServerJNI.java | 2 - java/src/edu/wpi/cameraserver/CvSource.java | 12 ------ src/CvSourceImpl.cpp | 38 ------------------- 8 files changed, 104 deletions(-) diff --git a/include/cameraserver_c.h b/include/cameraserver_c.h index 4148d99140..64fbb8dda3 100644 --- a/include/cameraserver_c.h +++ b/include/cameraserver_c.h @@ -163,10 +163,6 @@ CS_Property CS_CreateSourcePropertyCallback( void CS_SetSourceEnumPropertyChoices(CS_Source source, CS_Property property, const char** choices, int count, CS_Status* status); -void CS_RemoveSourceProperty(CS_Source source, CS_Property property, - CS_Status* status); -void CS_RemoveSourcePropertyByName(CS_Source source, const char* name, - CS_Status* status); // // Sink Creation Functions diff --git a/include/cameraserver_cpp.h b/include/cameraserver_cpp.h index 41f5229762..e7d4ce04bd 100644 --- a/include/cameraserver_cpp.h +++ b/include/cameraserver_cpp.h @@ -151,10 +151,6 @@ CS_Property CreateSourcePropertyCallback( void SetSourceEnumPropertyChoices(CS_Source source, CS_Property property, llvm::ArrayRef choices, CS_Status* status); -void RemoveSourceProperty(CS_Source source, CS_Property property, - CS_Status* status); -void RemoveSourceProperty(CS_Source source, llvm::StringRef name, - CS_Status* status); // // Sink Creation Functions diff --git a/include/cameraserver_oo.h b/include/cameraserver_oo.h index e11d8fca57..294163f8fb 100644 --- a/include/cameraserver_oo.h +++ b/include/cameraserver_oo.h @@ -261,14 +261,6 @@ class CvSource : public VideoSource { /// @param choices Choices void SetEnumPropertyChoices(const VideoProperty& property, llvm::ArrayRef choices); - - /// Remove a property. - /// @param property Property - void RemoveProperty(const VideoProperty& property); - - /// Remove a property. - /// @param name Property name - void RemoveProperty(llvm::StringRef name); }; /// A sink for video that accepts a sequence of frames. diff --git a/include/cameraserver_oo.inl b/include/cameraserver_oo.inl index 2e48cb84c4..ced151783c 100644 --- a/include/cameraserver_oo.inl +++ b/include/cameraserver_oo.inl @@ -231,16 +231,6 @@ inline void CvSource::SetEnumPropertyChoices( SetSourceEnumPropertyChoices(m_handle, property.m_handle, choices, &m_status); } -inline void CvSource::RemoveProperty(const VideoProperty& property) { - m_status = 0; - RemoveSourceProperty(m_handle, property.m_handle, &m_status); -} - -inline void CvSource::RemoveProperty(llvm::StringRef name) { - m_status = 0; - RemoveSourceProperty(m_handle, name, &m_status); -} - inline VideoSink::VideoSink(const VideoSink& sink) : m_handle(sink.m_handle == 0 ? 0 : CopySink(sink.m_handle, &m_status)) {} diff --git a/java/lib/CameraServerJNI.cpp b/java/lib/CameraServerJNI.cpp index 962c0a1c0a..7deffbffbd 100644 --- a/java/lib/CameraServerJNI.cpp +++ b/java/lib/CameraServerJNI.cpp @@ -615,32 +615,6 @@ JNIEXPORT void JNICALL Java_edu_wpi_cameraserver_CameraServerJNI_setSourceEnumPr CheckStatus(env, status); } -/* - * Class: edu_wpi_cameraserver_CameraServerJNI - * Method: removeSourceProperty - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_edu_wpi_cameraserver_CameraServerJNI_removeSourceProperty - (JNIEnv *env, jclass, jint source, jint property) -{ - CS_Status status = 0; - cs::RemoveSourceProperty(source, property, &status); - CheckStatus(env, status); -} - -/* - * Class: edu_wpi_cameraserver_CameraServerJNI - * Method: removeSourcePropertyByName - * Signature: (ILjava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_edu_wpi_cameraserver_CameraServerJNI_removeSourcePropertyByName - (JNIEnv *env, jclass, jint source, jstring name) -{ - CS_Status status = 0; - cs::RemoveSourceProperty(source, JStringRef{env, name}, &status); - CheckStatus(env, status); -} - /* * Class: edu_wpi_cameraserver_CameraServerJNI * Method: createMJPEGServer diff --git a/java/src/edu/wpi/cameraserver/CameraServerJNI.java b/java/src/edu/wpi/cameraserver/CameraServerJNI.java index a77b833e28..64a44e5c0d 100644 --- a/java/src/edu/wpi/cameraserver/CameraServerJNI.java +++ b/java/src/edu/wpi/cameraserver/CameraServerJNI.java @@ -125,8 +125,6 @@ public class CameraServerJNI { // int type, int minimum, int maximum, int step, int defaultValue, int value, // void (*onChange)(int property)); public static native void setSourceEnumPropertyChoices(int source, int property, String[] choices); - public static native void removeSourceProperty(int source, int property); - public static native void removeSourcePropertyByName(int source, String name); // // Sink Creation Functions diff --git a/java/src/edu/wpi/cameraserver/CvSource.java b/java/src/edu/wpi/cameraserver/CvSource.java index 7514c2c159..1762865d5b 100644 --- a/java/src/edu/wpi/cameraserver/CvSource.java +++ b/java/src/edu/wpi/cameraserver/CvSource.java @@ -87,16 +87,4 @@ public class CvSource extends VideoSource { public void SetEnumPropertyChoices(VideoProperty property, String[] choices) { CameraServerJNI.setSourceEnumPropertyChoices(m_handle, property.m_handle, choices); } - - /// Remove a property. - /// @param name Property name - public void removeProperty(VideoProperty property) { - CameraServerJNI.removeSourceProperty(m_handle, property.m_handle); - } - - /// Remove a property. - /// @param name Property name - public void removeProperty(String name) { - CameraServerJNI.removeSourcePropertyByName(m_handle, name); - } } diff --git a/src/CvSourceImpl.cpp b/src/CvSourceImpl.cpp index be55530efc..816b9bb788 100644 --- a/src/CvSourceImpl.cpp +++ b/src/CvSourceImpl.cpp @@ -144,14 +144,6 @@ void CvSourceImpl::SetEnumPropertyChoices(CS_Property property, prop->enumChoices = choices; } -void CvSourceImpl::RemoveProperty(CS_Property property) { - // TODO -} - -void CvSourceImpl::RemoveProperty(llvm::StringRef name) { - // TODO -} - namespace cs { CS_Source CreateCvSource(llvm::StringRef name, const VideoMode& mode, @@ -237,26 +229,6 @@ void SetSourceEnumPropertyChoices(CS_Source source, CS_Property property, .SetEnumPropertyChoices(property, choices, status); } -void RemoveSourceProperty(CS_Source source, CS_Property property, - CS_Status* status) { - auto data = Sources::GetInstance().Get(source); - if (!data || data->type != SourceData::kCv) { - *status = CS_INVALID_HANDLE; - return; - } - static_cast(*data->source).RemoveProperty(property); -} - -void RemoveSourceProperty(CS_Source source, llvm::StringRef name, - CS_Status* status) { - auto data = Sources::GetInstance().Get(source); - if (!data || data->type != SourceData::kCv) { - *status = CS_INVALID_HANDLE; - return; - } - static_cast(*data->source).RemoveProperty(name); -} - } // namespace cs extern "C" { @@ -314,14 +286,4 @@ void CS_SetSourceEnumPropertyChoices(CS_Source source, CS_Property property, return cs::SetSourceEnumPropertyChoices(source, property, vec, status); } -void CS_RemoveSourceProperty(CS_Source source, CS_Property property, - CS_Status* status) { - return cs::RemoveSourceProperty(source, property, status); -} - -void CS_RemoveSourcePropertyByName(CS_Source source, const char* name, - CS_Status* status) { - return cs::RemoveSourceProperty(source, name, status); -} - } // extern "C"