Class VideoSink
java.lang.Object
org.wpilib.vision.camera.VideoSink
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ImageSink, MjpegServer
A sink for video that accepts a sequence of frames. Each frame may consist of multiple images
(e.g. from a stereo or depth camera); these are called channels.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Enumerate all properties of this sink.static VideoSink[]Enumerate all existing sinks.booleanGet a JSON configuration string.Get the sink description.intReturns the video sink handle.getKind()Get the kind of the sink.static VideoSink.KindgetKindFromInt(int kind) Convert from the numerical representation of kind to an enum type.getName()Get the name of the sink.getProperty(String name) Get a property of the sink.Get the connected source.getSourceProperty(String name) Get a property of the associated source.inthashCode()booleanisValid()Returns true if the VideoSink is valid.booleansetConfigJson(String config) Set properties from a JSON configuration string.voidsetSource(VideoSource source) Configure which source should provide frames to this sink.
-
Field Details
-
m_handle
The VideoSink handle.
-
-
Constructor Details
-
VideoSink
-
-
Method Details
-
getKindFromInt
Convert from the numerical representation of kind to an enum type.- Parameters:
kind- The numerical representation of kind- Returns:
- The kind
-
close
- Specified by:
closein interfaceAutoCloseable
-
isValid
Returns true if the VideoSink is valid.- Returns:
- True if the VideoSink is valid.
-
getHandle
-
equals
-
hashCode
-
getKind
-
getName
-
getDescription
Get the sink description. This is sink-kind specific.- Returns:
- The sink description.
-
getProperty
Get a property of the sink.- Parameters:
name- Property name- Returns:
- Property (kind Property::kNone if no property with the given name exists)
-
enumerateProperties
Enumerate all properties of this sink.- Returns:
- List of properties.
-
setConfigJson
Set properties from a JSON configuration string.The format of the JSON input is:
{ "properties": [ { "name": property name "value": property value } ] }- Parameters:
config- configuration- Returns:
- True if set successfully
-
getConfigJson
-
setSource
Configure which source should provide frames to this sink. Each sink can accept frames from only a single source, but a single source can provide frames to multiple clients.- Parameters:
source- Source
-
getSource
Get the connected source.- Returns:
- Connected source; nullptr if no source connected.
-
getSourceProperty
Get a property of the associated source.- Parameters:
name- Property name- Returns:
- Property (kind Property::kNone if no property with the given name exists or no source connected)
-
enumerateSinks
-