Remove support for multiple channels.

This commit is contained in:
Peter Johnson
2016-09-18 14:14:35 -07:00
parent b78592d622
commit 9bb37d5df0
18 changed files with 36 additions and 321 deletions

View File

@@ -95,7 +95,7 @@ public class CameraServerJNI {
public static native int createUSBSourceDev(String name, int dev);
public static native int createUSBSourcePath(String name, String path);
public static native int createHTTPSource(String name, String url);
public static native int createCvSource(String name, int numChannels);
public static native int createCvSource(String name);
//
// Source Functions
@@ -103,7 +103,6 @@ public class CameraServerJNI {
public static native String getSourceName(int source);
public static native String getSourceDescription(int source);
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 getSourceProperty(int source, String name);
public static native int[] enumerateSourceProperties(int source);
@@ -113,8 +112,6 @@ public class CameraServerJNI {
//
// OpenCV Source Functions
//
//public static native void putSourceImage(int source, int channel, CvMat image);
public static native void notifySourceFrame(int source);
//public static native void putSourceFrame(int source, CvMat image);
public static native void notifySourceError(int source, String msg);
public static native void setSourceConnected(int source, boolean connected);
@@ -145,16 +142,9 @@ public class CameraServerJNI {
public static native int copySink(int sink);
public static native void releaseSink(int sink);
//
// Server Sink (e.g. HTTP) Functions
//
public static native void setSinkSourceChannel(int sink, int channel);
//
// OpenCV Sink Functions
//
public static native long sinkWaitForFrame(int sink);
//public static native int getSinkImage(int sink, CvMat image);
//public static native int grabSinkFrame(int sink, CvMat image);
public static native String getSinkError(int sink);
public static native void setSinkEnabled(int sink, boolean enabled);

View File

@@ -30,22 +30,7 @@ public class CvSink extends VideoSink {
// super(CameraServerJNI.createCvSinkCallback(name, processFrame));
//}
/// Wait for the next frame. This is a blocking call.
/// @return Frame time, or 0 on error (call GetError() to obtain the error
/// message).
public long waitForFrame() {
return CameraServerJNI.sinkWaitForFrame(m_handle);
}
/// Get an OpenCV image from the specified channel.
/// @return False if image could not be obtained for some reason (e.g.
/// channel out of range)
//public boolean getImage(int channel, CvMat image) {
// return CameraServerJNI.getSinkImage(m_handle, channel, image);
//}
/// Wait for the next frame and get the image from channel 0. Equivalent
/// to calling WaitForFrame() followed by GetImage(0, image).
/// Wait for the next frame and get the image.
/// @return Frame time, or 0 on error (call GetError() to obtain the error
/// message);
//public long grabFrame(CvMat image) {

View File

@@ -9,33 +9,13 @@ package edu.wpi.cameraserver;
/// A source that represents a video camera.
public class CvSource extends VideoSource {
/// Create an OpenCV source with a single channel.
/// @param name Source name (arbitrary unique identifier)
public CvSource(String name) {
super(CameraServerJNI.createCvSource(name, 1));
}
/// Create an OpenCV source.
/// @param name Source name (arbitrary unique identifier)
/// @param numChannels Number of channels
public CvSource(String name, int numChannels) {
super(CameraServerJNI.createCvSource(name, numChannels));
public CvSource(String name) {
super(CameraServerJNI.createCvSource(name));
}
/// Put an OpenCV image onto the specified channel.
/// @param channel Channel number (range 0 to nChannels-1)
/// @param image OpenCV image
//public void putImage(int channel, Mat image);
/// Signal sinks connected to this source that all new channel images have
/// been put to the stream and are ready to be read.
public void notifyFrame() {
CameraServerJNI.notifySourceFrame(m_handle);
}
/// Put an OpenCV image onto channel 0 and notify sinks.
/// This is identical in behavior to calling PutImage(0, image) followed by
/// NotifyFrame().
/// Put an OpenCV image and notify sinks.
/// @param image OpenCV image
//public void putFrame(Mat image);

View File

@@ -23,12 +23,4 @@ public class HTTPSink extends VideoSink {
public HTTPSink(String name, int port) {
this(name, "", port);
}
/// Set what video channel should be served.
/// MJPEG-HTTP can only serve a single channel of video.
/// By default, channel 0 is served.
/// @param channel video channel to serve to clients
public void setSourceChannel(int channel) {
CameraServerJNI.setSinkSourceChannel(m_handle, channel);
}
}

View File

@@ -9,11 +9,10 @@ package edu.wpi.cameraserver;
/// USB camera information
public class USBCameraInfo {
public USBCameraInfo(int dev, String path, String name, int channels) {
public USBCameraInfo(int dev, String path, String name) {
this.dev = dev;
this.path = path;
this.name = name;
this.channels = channels;
}
/// Device number (e.g. N in '/dev/videoN' on Linux)
@@ -22,7 +21,4 @@ public class USBCameraInfo {
public String path;
/// Vendor/model name of the camera as provided by the USB driver
public String name;
/// Number of channels the camera provides (usually 1, but some cameras such
/// as stereo or depth cameras may provide multiple channels).
public int channels;
}

View File

@@ -42,11 +42,6 @@ public class VideoSource {
return CameraServerJNI.getSourceLastFrameTime(m_handle);
}
/// Get the number of channels this source provides.
public int getNumChannels() {
return CameraServerJNI.getSourceNumChannels(m_handle);
}
/// Is the source currently connected to whatever is providing the images?
public boolean isConnected() {
return CameraServerJNI.isSourceConnected(m_handle);