Add support for enumerating and changing USB camera video mode.

This commit is contained in:
Peter Johnson
2016-09-29 00:04:16 -07:00
parent a5fe605aae
commit 70616c48e3
16 changed files with 813 additions and 20 deletions

View File

@@ -11,8 +11,19 @@ package edu.wpi.cameraserver;
public class CvSource extends VideoSource {
/// Create an OpenCV source.
/// @param name Source name (arbitrary unique identifier)
public CvSource(String name) {
super(CameraServerJNI.createCvSource(name));
/// @param mode Video mode being generated
public CvSource(String name, VideoMode mode) {
super(CameraServerJNI.createCvSource(name, mode.pixelFormat.getValue(), mode.width, mode.height, mode.fps));
}
/// Create an OpenCV source.
/// @param name Source name (arbitrary unique identifier)
/// @param pixelFormat Pixel format
/// @param width width
/// @param height height
/// @param fps fps
public CvSource(String name, VideoMode.PixelFormat pixelFormat, int width, int height, int fps) {
super(CameraServerJNI.createCvSource(name, pixelFormat.getValue(), width, height, fps));
}
/// Put an OpenCV image and notify sinks.