Package limn.video

Enum Class VideoFrame.Kind

java.lang.Object
java.lang.Enum<VideoFrame.Kind>
limn.video.VideoFrame.Kind
All Implemented Interfaces:
Serializable, Comparable<VideoFrame.Kind>, Constable
Enclosing class:
VideoFrame

public static enum VideoFrame.Kind extends Enum<VideoFrame.Kind>
Which of the two shapes a picture has: samples in memory, or a handle to a device allocation.

The constants beyond PLANAR name a family of handle and not a type. The toolkit depends on nothing and cannot see a CVPixelBufferRef, an ID3D11Texture2D* or a dma-buf descriptor; what it carries is a long whose meaning is this enum, so that a backend can bind the ones it knows how to bind and refuse the rest by name rather than binding a handle it has misread.

  • Enum Constant Details

    • PLANAR

      public static final VideoFrame.Kind PLANAR
      Samples a consumer can read. VideoFrame.plane(int) answers and VideoFrame.handle() throws.
    • IO_SURFACE

      public static final VideoFrame.Kind IO_SURFACE
      A macOS IOSurfaceRef, which is what a VideoToolbox decode produces. Its planes live in memory the decoder's pool owns, in a layout the CPU may address only under a lock; the reason to carry it is that a GL context can bind it as a texture without a copy, and the reason it is not planar is that everything above cannot.

      The handle is valid exactly while the frame is held, and no longer: VideoFrame.release() hands that buffer back to the decoder's pool, which will refill it.

  • Method Details

    • values

      public static VideoFrame.Kind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static VideoFrame.Kind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null