java.lang.Object
uk.co.caprica.vlcj.player.embedded.videosurface.callback.BufferFormat
Direct Known Subclasses:
RV32BufferFormat

public class BufferFormat extends Object
Specifies the formats used by the CallbackVideoSurface.

The buffer will contain data of the given width and height in the format specified by the chroma parameter. A buffer can consist of multiple planes depending on the format of the data. For each plane the pitch and height in lines must be supplied.

For example, RV32 format has only one plane. Its pitch is width * 4, and its number of lines is the same as the height.

  • Constructor Details

    • BufferFormat

      public BufferFormat(String chroma, int width, int height, int[] pitches, int[] lines)
      Constructs a new BufferFormat instance with the given parameters.
      Parameters:
      chroma - a VLC buffer type, must be exactly 4 characters and cannot contain non-ASCII characters
      width - the width, must be > 0
      height - the height, must be > 0
      pitches - the pitch of each plane that this buffer consists of (usually a multiple of width)
      lines - the number of lines of each plane that this buffer consists of (usually same as height)
      Throws:
      IllegalArgumentException - if any parameter is invalid
  • Method Details

    • getChroma

      public final String getChroma()
      Get the pixel format.
      Returns:
      pixel format
    • getWidth

      public final int getWidth()
      Get the width.
      Returns:
      width
    • getHeight

      public final int getHeight()
      Get the height.
      Returns:
      height
    • getPitches

      public final int[] getPitches()
      Get the pitches for each plane.
      Returns:
      pitches
    • getLines

      public final int[] getLines()
      Get the number of lines for each plane.
      Returns:
      lines
    • getPlaneCount

      public final int getPlaneCount()
      Get the number of planes in the buffer.
      Returns:
      number of planes
    • toString

      public final String toString()
      Overrides:
      toString in class Object