mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Revamp API again and start implementing C and Java wrapper shells.
This commit is contained in:
24
java/src/edu/wpi/cameraserver/USBCamera.java
Normal file
24
java/src/edu/wpi/cameraserver/USBCamera.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package edu.wpi.cameraserver;
|
||||
|
||||
/// A source that represents a USB camera.
|
||||
public class USBCamera extends VideoSource {
|
||||
/// Create a source for a USB camera based on device number.
|
||||
/// @param name Source name (arbitrary unique identifier)
|
||||
/// @param dev Device number (e.g. 0 for /dev/video0)
|
||||
public USBCamera(String name, int dev) {
|
||||
super(CameraServerJNI.createUSBSourceDev(name, dev));
|
||||
}
|
||||
|
||||
/// Create a source for a USB camera based on device path.
|
||||
/// @param name Source name (arbitrary unique identifier)
|
||||
/// @param path Path to device (e.g. "/dev/video0" on Linux)
|
||||
public USBCamera(String name, String path) {
|
||||
super(CameraServerJNI.createUSBSourcePath(name, path));
|
||||
}
|
||||
|
||||
/// Enumerate USB cameras on the local system.
|
||||
/// @return Vector of USB camera information (one for each camera)
|
||||
public static USBCameraInfo[] enumerateUSBCameras() {
|
||||
return CameraServerJNI.enumerateUSBCameras();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user