Class Sample

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.gst.Sample
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class Sample extends ProxyInstance
A GstSample is a small object containing data, a type, timing and extra arbitrary information.
  • Constructor Details

    • Sample

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

      public Sample(@Nullable Buffer buffer, @Nullable Caps caps, @Nullable Segment segment, @Nullable Structure info)

      Create a new GstSample with the provided details.

      Free-function: gst_sample_unref

      Parameters:
      buffer - a GstBuffer, or null
      caps - a GstCaps, or null
      segment - a GstSegment, or null
      info - a GstStructure, or null
  • Method Details

    • getType

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

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

      public Sample copy()
      Create a copy of the given sample. This will also make a newly allocated copy of the data the source sample contains.
      Returns:
      a new copy of sample.
      Since:
      1.2
    • getBuffer

      public @Nullable Buffer getBuffer()
      Get the buffer associated with this Sample
      Returns:
      the buffer of this Sample or null when there is no buffer. The buffer remains valid as long as this Sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer with gst_buffer_ref().
    • getBufferList

      public @Nullable BufferList getBufferList()
      Get the buffer list associated with this Sample
      Returns:
      the buffer list of this Sample or null when there is no buffer list. The buffer list remains valid as long as this Sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer list with gst_mini_object_ref ().
      Since:
      1.6
    • getCaps

      public @Nullable Caps getCaps()
      Get the caps associated with this Sample
      Returns:
      the caps of this Sample or null when there is no caps. The caps remain valid as long as this Sample is valid. If you need to hold on to the caps for longer than that, take a ref to the caps with gst_caps_ref().
    • getInfo

      public @Nullable Structure getInfo()
      Get extra information associated with sample.
      Returns:
      the extra info of sample. The info remains valid as long as this Sample is valid.
    • getSegment

      public Segment getSegment()
      Get the segment associated with this Sample
      Returns:
      the segment of sample. The segment remains valid as long as this Sample is valid.
    • ref

      public Sample ref()
      Increases the refcount of the given sample by one.
      Returns:
      this Sample
    • setBuffer

      public void setBuffer(Buffer buffer)
      Set the buffer associated with sample. this Sample must be writable.
      Parameters:
      buffer - A GstBuffer
      Since:
      1.16
    • setBufferList

      public void setBufferList(BufferList bufferList)
      Set the buffer list associated with sample. this Sample must be writable.
      Parameters:
      bufferList - a GstBufferList
      Since:
      1.6
    • setCaps

      public void setCaps(Caps caps)
      Set the caps associated with sample. this Sample must be writable.
      Parameters:
      caps - A GstCaps
      Since:
      1.16
    • setInfo

      public boolean setInfo(Structure info)
      Set the info structure associated with sample. this Sample must be writable, and info must not have a parent set already.
      Parameters:
      info - A GstStructure
      Since:
      1.16
    • setSegment

      public void setSegment(Segment segment)
      Set the segment associated with sample. this Sample must be writable.
      Parameters:
      segment - A GstSegment
      Since:
      1.16
    • unref

      public void unref()
      Decreases the refcount of the sample. If the refcount reaches 0, the sample will be freed.