Package edu.wpi.cscore
Class CameraServerJNI
- java.lang.Object
-
- edu.wpi.cscore.CameraServerJNI
-
public class CameraServerJNI extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCameraServerJNI.Helperstatic interfaceCameraServerJNI.LoggerFunctionstatic classCameraServerJNI.TelemetryKind
-
Constructor Summary
Constructors Constructor Description CameraServerJNI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intaddListener(Consumer<VideoEvent> listener, int eventMask, boolean immediateNotify)static longallocateRawFrame()static intcopySink(int sink)static intcopySource(int source)static intcreateHttpCamera(String name, String url, int kind)static intcreateHttpCameraMulti(String name, String[] urls, int kind)static intcreateMjpegServer(String name, String listenAddress, int port)static intcreateRawSink(String name)static intcreateRawSource(String name, int pixelFormat, int width, int height, int fps)static intcreateSourceProperty(int source, String name, int kind, int minimum, int maximum, int step, int defaultValue, int value)static intcreateUsbCameraDev(String name, int dev)static intcreateUsbCameraPath(String name, String path)static int[]enumerateSinkProperties(int sink)static int[]enumerateSinks()static int[]enumerateSourceProperties(int source)static int[]enumerateSources()static int[]enumerateSourceSinks(int source)static VideoMode[]enumerateSourceVideoModes(int source)static UsbCameraInfo[]enumerateUsbCameras()static voidforceLoad()Force load the library.static voidfreeRawFrame(long frame)static intgetCameraBrightness(int source)static String[]getEnumPropertyChoices(int property)static StringgetHostname()static intgetHttpCameraKind(int source)static String[]getHttpCameraUrls(int source)static StringgetMjpegServerListenAddress(int sink)static intgetMjpegServerPort(int sink)static String[]getNetworkInterfaces()static intgetProperty(int property)static intgetPropertyDefault(int property)static intgetPropertyKind(int property)static intgetPropertyMax(int property)static intgetPropertyMin(int property)static StringgetPropertyName(int property)static intgetPropertyStep(int property)static StringgetSinkConfigJson(int sink)static StringgetSinkDescription(int sink)static StringgetSinkError(int sink)static intgetSinkKind(int sink)static StringgetSinkName(int sink)static intgetSinkProperty(int sink, String name)static intgetSinkSource(int sink)static intgetSinkSourceProperty(int sink, String name)static StringgetSourceConfigJson(int source)static StringgetSourceDescription(int source)static intgetSourceKind(int source)static longgetSourceLastFrameTime(int source)static StringgetSourceName(int source)static intgetSourceProperty(int source, String name)static VideoModegetSourceVideoMode(int source)static StringgetStringProperty(int property)static doublegetTelemetryAverageValue(int handle, int kind)static doublegetTelemetryAverageValue(int handle, CameraServerJNI.TelemetryKind kind)static doublegetTelemetryElapsedTime()static longgetTelemetryValue(int handle, int kind)static longgetTelemetryValue(int handle, CameraServerJNI.TelemetryKind kind)static UsbCameraInfogetUsbCameraInfo(int source)static StringgetUsbCameraPath(int source)static longgrabSinkFrame(int sink, RawFrame rawFrame)static longgrabSinkFrameTimeout(int sink, RawFrame rawFrame, double timeout)static booleanisSourceConnected(int source)static booleanisSourceEnabled(int source)static voidnotifySourceError(int source, String msg)static voidputRawSourceFrame(int source, long data, int width, int height, int pixelFormat, int totalData)static voidputRawSourceFrame(int source, RawFrame raw)static voidputRawSourceFrameBB(int source, ByteBuffer data, int width, int height, int pixelFormat, int totalData)static voidreleaseSink(int sink)static voidreleaseSource(int source)static voidremoveListener(int handle)static voidsetCameraBrightness(int source, int brightness)static voidsetCameraExposureAuto(int source)static voidsetCameraExposureHoldCurrent(int source)static voidsetCameraExposureManual(int source, int value)static voidsetCameraWhiteBalanceAuto(int source)static voidsetCameraWhiteBalanceHoldCurrent(int source)static voidsetCameraWhiteBalanceManual(int source, int value)static voidsetHttpCameraUrls(int source, String[] urls)static voidsetLogger(CameraServerJNI.LoggerFunction func, int minLevel)static voidsetProperty(int property, int value)static booleansetSinkConfigJson(int sink, String config)static voidsetSinkDescription(int sink, String description)static voidsetSinkEnabled(int sink, boolean enabled)static voidsetSinkSource(int sink, int source)static booleansetSourceConfigJson(int source, String config)static voidsetSourceConnected(int source, boolean connected)static voidsetSourceConnectionStrategy(int source, int strategy)static voidsetSourceDescription(int source, String description)static voidsetSourceEnumPropertyChoices(int source, int property, String[] choices)static booleansetSourceFPS(int source, int fps)static booleansetSourcePixelFormat(int source, int pixelFormat)static booleansetSourceResolution(int source, int width, int height)static booleansetSourceVideoMode(int source, int pixelFormat, int width, int height, int fps)static voidsetStringProperty(int property, String value)static voidsetTelemetryPeriod(double seconds)
-
-
-
Method Detail
-
forceLoad
public static void forceLoad() throws IOExceptionForce load the library.- Throws:
IOException
-
getPropertyKind
public static int getPropertyKind(int property)
-
getPropertyName
public static String getPropertyName(int property)
-
getProperty
public static int getProperty(int property)
-
setProperty
public static void setProperty(int property, int value)
-
getPropertyMin
public static int getPropertyMin(int property)
-
getPropertyMax
public static int getPropertyMax(int property)
-
getPropertyStep
public static int getPropertyStep(int property)
-
getPropertyDefault
public static int getPropertyDefault(int property)
-
getStringProperty
public static String getStringProperty(int property)
-
setStringProperty
public static void setStringProperty(int property, String value)
-
getEnumPropertyChoices
public static String[] getEnumPropertyChoices(int property)
-
createUsbCameraDev
public static int createUsbCameraDev(String name, int dev)
-
createHttpCameraMulti
public static int createHttpCameraMulti(String name, String[] urls, int kind)
-
createRawSource
public static int createRawSource(String name, int pixelFormat, int width, int height, int fps)
-
getSourceKind
public static int getSourceKind(int source)
-
getSourceName
public static String getSourceName(int source)
-
getSourceDescription
public static String getSourceDescription(int source)
-
getSourceLastFrameTime
public static long getSourceLastFrameTime(int source)
-
setSourceConnectionStrategy
public static void setSourceConnectionStrategy(int source, int strategy)
-
isSourceConnected
public static boolean isSourceConnected(int source)
-
isSourceEnabled
public static boolean isSourceEnabled(int source)
-
getSourceProperty
public static int getSourceProperty(int source, String name)
-
enumerateSourceProperties
public static int[] enumerateSourceProperties(int source)
-
getSourceVideoMode
public static VideoMode getSourceVideoMode(int source)
-
setSourceVideoMode
public static boolean setSourceVideoMode(int source, int pixelFormat, int width, int height, int fps)
-
setSourcePixelFormat
public static boolean setSourcePixelFormat(int source, int pixelFormat)
-
setSourceResolution
public static boolean setSourceResolution(int source, int width, int height)
-
setSourceFPS
public static boolean setSourceFPS(int source, int fps)
-
setSourceConfigJson
public static boolean setSourceConfigJson(int source, String config)
-
getSourceConfigJson
public static String getSourceConfigJson(int source)
-
enumerateSourceVideoModes
public static VideoMode[] enumerateSourceVideoModes(int source)
-
enumerateSourceSinks
public static int[] enumerateSourceSinks(int source)
-
copySource
public static int copySource(int source)
-
releaseSource
public static void releaseSource(int source)
-
setCameraBrightness
public static void setCameraBrightness(int source, int brightness)
-
getCameraBrightness
public static int getCameraBrightness(int source)
-
setCameraWhiteBalanceAuto
public static void setCameraWhiteBalanceAuto(int source)
-
setCameraWhiteBalanceHoldCurrent
public static void setCameraWhiteBalanceHoldCurrent(int source)
-
setCameraWhiteBalanceManual
public static void setCameraWhiteBalanceManual(int source, int value)
-
setCameraExposureAuto
public static void setCameraExposureAuto(int source)
-
setCameraExposureHoldCurrent
public static void setCameraExposureHoldCurrent(int source)
-
setCameraExposureManual
public static void setCameraExposureManual(int source, int value)
-
getUsbCameraPath
public static String getUsbCameraPath(int source)
-
getUsbCameraInfo
public static UsbCameraInfo getUsbCameraInfo(int source)
-
getHttpCameraKind
public static int getHttpCameraKind(int source)
-
setHttpCameraUrls
public static void setHttpCameraUrls(int source, String[] urls)
-
getHttpCameraUrls
public static String[] getHttpCameraUrls(int source)
-
putRawSourceFrameBB
public static void putRawSourceFrameBB(int source, ByteBuffer data, int width, int height, int pixelFormat, int totalData)
-
putRawSourceFrame
public static void putRawSourceFrame(int source, long data, int width, int height, int pixelFormat, int totalData)
-
putRawSourceFrame
public static void putRawSourceFrame(int source, RawFrame raw)
-
notifySourceError
public static void notifySourceError(int source, String msg)
-
setSourceConnected
public static void setSourceConnected(int source, boolean connected)
-
setSourceDescription
public static void setSourceDescription(int source, String description)
-
createSourceProperty
public static int createSourceProperty(int source, String name, int kind, int minimum, int maximum, int step, int defaultValue, int value)
-
setSourceEnumPropertyChoices
public static void setSourceEnumPropertyChoices(int source, int property, String[] choices)
-
createRawSink
public static int createRawSink(String name)
-
getSinkKind
public static int getSinkKind(int sink)
-
getSinkName
public static String getSinkName(int sink)
-
getSinkDescription
public static String getSinkDescription(int sink)
-
getSinkProperty
public static int getSinkProperty(int sink, String name)
-
enumerateSinkProperties
public static int[] enumerateSinkProperties(int sink)
-
setSinkConfigJson
public static boolean setSinkConfigJson(int sink, String config)
-
getSinkConfigJson
public static String getSinkConfigJson(int sink)
-
setSinkSource
public static void setSinkSource(int sink, int source)
-
getSinkSourceProperty
public static int getSinkSourceProperty(int sink, String name)
-
getSinkSource
public static int getSinkSource(int sink)
-
copySink
public static int copySink(int sink)
-
releaseSink
public static void releaseSink(int sink)
-
getMjpegServerListenAddress
public static String getMjpegServerListenAddress(int sink)
-
getMjpegServerPort
public static int getMjpegServerPort(int sink)
-
setSinkDescription
public static void setSinkDescription(int sink, String description)
-
grabSinkFrame
public static long grabSinkFrame(int sink, RawFrame rawFrame)
-
grabSinkFrameTimeout
public static long grabSinkFrameTimeout(int sink, RawFrame rawFrame, double timeout)
-
getSinkError
public static String getSinkError(int sink)
-
setSinkEnabled
public static void setSinkEnabled(int sink, boolean enabled)
-
addListener
public static int addListener(Consumer<VideoEvent> listener, int eventMask, boolean immediateNotify)
-
removeListener
public static void removeListener(int handle)
-
setTelemetryPeriod
public static void setTelemetryPeriod(double seconds)
-
getTelemetryElapsedTime
public static double getTelemetryElapsedTime()
-
getTelemetryValue
public static long getTelemetryValue(int handle, int kind)
-
getTelemetryValue
public static long getTelemetryValue(int handle, CameraServerJNI.TelemetryKind kind)
-
getTelemetryAverageValue
public static double getTelemetryAverageValue(int handle, int kind)
-
getTelemetryAverageValue
public static double getTelemetryAverageValue(int handle, CameraServerJNI.TelemetryKind kind)
-
setLogger
public static void setLogger(CameraServerJNI.LoggerFunction func, int minLevel)
-
enumerateUsbCameras
public static UsbCameraInfo[] enumerateUsbCameras()
-
enumerateSources
public static int[] enumerateSources()
-
enumerateSinks
public static int[] enumerateSinks()
-
getHostname
public static String getHostname()
-
getNetworkInterfaces
public static String[] getNetworkInterfaces()
-
allocateRawFrame
public static long allocateRawFrame()
-
freeRawFrame
public static void freeRawFrame(long frame)
-
-