Class VideoInfo

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.video.VideoInfo
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class VideoInfo extends ProxyInstance

Information describing image properties. This information can be filled in from GstCaps with gst_video_info_from_caps(). The information is also used to store the specific video info when mapping a video frame with gst_video_frame_map().

Use the provided macros to access the info in this structure.

  • Constructor Details

    • VideoInfo

      public VideoInfo(MemorySegment address)
      Create a VideoInfo proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • VideoInfo

      public VideoInfo()
      Allocate a new GstVideoInfo that is also initialized with gst_video_info_init().
      Since:
      1.6
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the VideoInfo class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readFinfo

      public VideoFormatInfo readFinfo()
      Read the value of the field finfo.
      Returns:
      The value of the field finfo
    • writeFinfo

      public void writeFinfo(VideoFormatInfo finfo)
      Write a value in the field finfo.
      Parameters:
      finfo - The new value for the field finfo
    • readInterlaceMode

      public VideoInterlaceMode readInterlaceMode()
      Read the value of the field interlace_mode.
      Returns:
      The value of the field interlace_mode
    • writeInterlaceMode

      public void writeInterlaceMode(VideoInterlaceMode interlaceMode)
      Write a value in the field interlace_mode.
      Parameters:
      interlaceMode - The new value for the field interlace_mode
    • readFlags

      public Set<VideoFlags> readFlags()
      Read the value of the field flags.
      Returns:
      The value of the field flags
    • writeFlags

      public void writeFlags(Set<VideoFlags> flags)
      Write a value in the field flags.
      Parameters:
      flags - The new value for the field flags
    • readWidth

      public int readWidth()
      Read the value of the field width.
      Returns:
      The value of the field width
    • writeWidth

      public void writeWidth(int width)
      Write a value in the field width.
      Parameters:
      width - The new value for the field width
    • readHeight

      public int readHeight()
      Read the value of the field height.
      Returns:
      The value of the field height
    • writeHeight

      public void writeHeight(int height)
      Write a value in the field height.
      Parameters:
      height - The new value for the field height
    • readSize

      public long readSize()
      Read the value of the field size.
      Returns:
      The value of the field size
    • writeSize

      public void writeSize(long size)
      Write a value in the field size.
      Parameters:
      size - The new value for the field size
    • readViews

      public int readViews()
      Read the value of the field views.
      Returns:
      The value of the field views
    • writeViews

      public void writeViews(int views)
      Write a value in the field views.
      Parameters:
      views - The new value for the field views
    • readChromaSite

      public Set<VideoChromaSite> readChromaSite()
      Read the value of the field chroma_site.
      Returns:
      The value of the field chroma_site
    • writeChromaSite

      public void writeChromaSite(Set<VideoChromaSite> chromaSite)
      Write a value in the field chroma_site.
      Parameters:
      chromaSite - The new value for the field chroma_site
    • readColorimetry

      public @Nullable VideoColorimetry readColorimetry()
      Read the value of the field colorimetry.
      Returns:
      The value of the field colorimetry
    • writeColorimetry

      public void writeColorimetry(@Nullable VideoColorimetry colorimetry)
      Write a value in the field colorimetry.
      Parameters:
      colorimetry - The new value for the field colorimetry
    • readParN

      public int readParN()
      Read the value of the field par_n.
      Returns:
      The value of the field par_n
    • writeParN

      public void writeParN(int parN)
      Write a value in the field par_n.
      Parameters:
      parN - The new value for the field par_n
    • readParD

      public int readParD()
      Read the value of the field par_d.
      Returns:
      The value of the field par_d
    • writeParD

      public void writeParD(int parD)
      Write a value in the field par_d.
      Parameters:
      parD - The new value for the field par_d
    • readFpsN

      public int readFpsN()
      Read the value of the field fps_n.
      Returns:
      The value of the field fps_n
    • writeFpsN

      public void writeFpsN(int fpsN)
      Write a value in the field fps_n.
      Parameters:
      fpsN - The new value for the field fps_n
    • readFpsD

      public int readFpsD()
      Read the value of the field fps_d.
      Returns:
      The value of the field fps_d
    • writeFpsD

      public void writeFpsD(int fpsD)
      Write a value in the field fps_d.
      Parameters:
      fpsD - The new value for the field fps_d
    • readOffset

      public @Nullable long @Nullable [] readOffset()
      Read the value of the field offset.
      Returns:
      The value of the field offset
    • writeOffset

      public void writeOffset(@Nullable long @Nullable [] offset, Arena _arena)
      Write a value in the field offset.
      Parameters:
      offset - The new value for the field offset
    • readStride

      public @Nullable int @Nullable [] readStride()
      Read the value of the field stride.
      Returns:
      The value of the field stride
    • writeStride

      public void writeStride(@Nullable int @Nullable [] stride, Arena _arena)
      Write a value in the field stride.
      Parameters:
      stride - The new value for the field stride
    • fromCaps

      public static @Nullable VideoInfo fromCaps(Caps caps)
      Parse caps to generate a GstVideoInfo.
      Parameters:
      caps - a GstCaps
      Returns:
      A GstVideoInfo, or null if caps couldn't be parsed
      Since:
      1.20
    • withCaps

      public static boolean withCaps(VideoInfo info, Caps caps)
      Parse caps and update info.
      Parameters:
      info - GstVideoInfo
      caps - a GstCaps
      Returns:
      TRUE if caps could be parsed
    • init

      public static void init(VideoInfo info)
      Initialize info with default values.
      Parameters:
      info - a GstVideoInfo
    • align

      public boolean align(VideoAlignment align)

      Adjust the offset and stride fields in this VideoInfo so that the padding and stride alignment in align is respected.

      Extra padding will be added to the right side when stride alignment padding is required and align will be updated with the new padding values.

      Parameters:
      align - alignment parameters
      Returns:
      false if alignment could not be applied, e.g. because the size of a frame can't be represented as a 32 bit integer (Since: 1.12)
    • alignFull

      public boolean alignFull(VideoAlignment align, @Nullable Out<Long> planeSize)

      Extra padding will be added to the right side when stride alignment padding is required and align will be updated with the new padding values.

      This variant of gst_video_info_align() provides the updated size, in bytes, of each video plane after the alignment, including all horizontal and vertical paddings.

      In case of GST_VIDEO_INTERLACE_MODE_ALTERNATE info, the returned sizes are the ones used to hold a single field, not the full frame.

      Parameters:
      align - alignment parameters
      planeSize - array used to store the plane sizes
      Returns:
      false if alignment could not be applied, e.g. because the size of a frame can't be represented as a 32 bit integer
      Since:
      1.18
    • convert

      public boolean convert(Format srcFormat, long srcValue, Format destFormat, Out<Long> destValue)
      Converts among various GstFormat types. This function handles GST_FORMAT_BYTES, GST_FORMAT_TIME, and GST_FORMAT_DEFAULT. For raw video, GST_FORMAT_DEFAULT corresponds to video frames. This function can be used to handle pad queries of the type GST_QUERY_CONVERT.
      Parameters:
      srcFormat - GstFormat of the srcValue
      srcValue - value to convert
      destFormat - GstFormat of the destValue
      destValue - pointer to destination value
      Returns:
      TRUE if the conversion was successful.
    • copy

      public VideoInfo copy()
      Copy a GstVideoInfo structure.
      Returns:
      a new GstVideoInfo. free with gst_video_info_free.
      Since:
      1.6
    • free

      public void free()
      Free a GstVideoInfo structure previously allocated with gst_video_info_new() or gst_video_info_copy().
      Since:
      1.6
    • isEqual

      public boolean isEqual(VideoInfo other)
      Compares two GstVideoInfo and returns whether they are equal or not
      Parameters:
      other - a GstVideoInfo
      Returns:
      true if this VideoInfo and other are equal, else false.
    • setFormat

      public boolean setFormat(VideoFormat format, int width, int height)

      Set the default info for a video frame of format and width and height.

      Note: This initializes this VideoInfo first, no values are preserved. This function does not set the offsets correctly for interlaced vertically subsampled formats.

      Parameters:
      format - the format
      width - a width
      height - a height
      Returns:
      false if the returned video info is invalid, e.g. because the size of a frame can't be represented as a 32 bit integer (Since: 1.12)
    • setInterlacedFormat

      public boolean setInterlacedFormat(VideoFormat format, VideoInterlaceMode mode, int width, int height)
      Same as gst_video_info_set_format but also allowing to set the interlaced mode.
      Parameters:
      format - the format
      mode - a GstVideoInterlaceMode
      width - a width
      height - a height
      Returns:
      false if the returned video info is invalid, e.g. because the size of a frame can't be represented as a 32 bit integer.
      Since:
      1.16
    • toCaps

      public Caps toCaps()
      Convert the values of this VideoInfo into a GstCaps.
      Returns:
      a new GstCaps containing the info of info.