edu.wpi.cscore

## Class VideoSink

- java.lang.Object
- - edu.wpi.cscore.VideoSink

- Direct Known Subclasses:
    CvSink, MjpegServer

      public class VideoSink
      extends java.lang.Object

  A source for video that provides 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
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `VideoSink.Kind`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `m_handle`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `VideoSink(int handle)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static VideoSink[]` | `enumerateSinks()` Enumerate all existing sinks.
    `boolean` | `equals(java.lang.Object other)`
    `void` | `free()`
    `java.lang.String` | `getDescription()` Get the sink description.
    `int` | `getHandle()`
    `VideoSink.Kind` | `getKind()` Get the kind of the sink.
    `static VideoSink.Kind` | `getKindFromInt(int kind)`
    `java.lang.String` | `getName()` Get the name of the sink.
    `VideoSource` | `getSource()` Get the connected source.
    `VideoProperty` | `getSourceProperty(java.lang.String name)` Get a property of the associated source.
    `int` | `hashCode()`
    `boolean` | `isValid()`
    `void` | `setSource(VideoSource source)` Configure which source should provide frames to this sink.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### m_handle

          protected int m_handle

  - ### Constructor Detail

    - #### VideoSink

          protected VideoSink(int handle)

  - ### Method Detail

    - #### getKindFromInt

          public static VideoSink.Kind getKindFromInt(int kind)

    - #### free

          public void free()

    - #### isValid

          public boolean isValid()

    - #### getHandle

          public int getHandle()

    - #### equals

          public boolean equals(java.lang.Object other)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### getKind

          public VideoSink.Kind getKind()

      Get the kind of the sink.

    - #### getName

          public java.lang.String getName()

      Get the name of the sink. The name is an arbitrary identifier provided when the sink is created, and should be unique.

    - #### getDescription

          public java.lang.String getDescription()

      Get the sink description. This is sink-kind specific.

    - #### setSource

          public void setSource(VideoSource source)

      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

          public VideoSource getSource()

      Get the connected source.
      Returns:
        Connected source; nullptr if no source connected.

    - #### getSourceProperty

          public VideoProperty getSourceProperty(java.lang.String name)

      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

          public static VideoSink[] enumerateSinks()

      Enumerate all existing sinks.
      Returns:
        Vector of sinks.