Class PushSrc

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
AudioBaseSrc, AudioCdSrc

@Generated("org.javagi.JavaGI") public class PushSrc extends BaseSrc

This class is mostly useful for elements that cannot do random access, or at least very slowly. The source usually prefers to push out a fixed size buffer.

Subclasses usually operate in a format that is different from the default GST_FORMAT_BYTES format of GstBaseSrc.

Classes extending this base class will usually be scheduled in a push based mode. If the peer accepts to operate without offsets and within the limits of the allowed block size, this class can operate in getrange based mode automatically. To make this possible, the subclass should implement and override the SCHEDULING query.

The subclass should extend the methods from the baseclass in addition to the ::create method.

Seeking, flushing, scheduling and sync is all handled by this base class.

  • Constructor Details

    • PushSrc

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

      public PushSrc()
      Create a new PushSrc.
  • Method Details

    • getType

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

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

      protected PushSrc asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class BaseSrc
      Returns:
      the instance as if it were its parent type
    • alloc

      protected FlowReturn alloc(@Nullable Out<Buffer> buf)
      Allocate memory for a buffer.
    • create

      protected FlowReturn create(@Nullable Out<Buffer> buf)
      Ask the subclass to create a buffer, the default implementation will call alloc if no allocated buf is provided and then call fill.
    • fill

      protected FlowReturn fill(Buffer buf)
      Ask the subclass to fill the buffer with data.
    • builder

      public static PushSrc.Builder<? extends PushSrc.Builder> builder()
      A PushSrc.Builder object constructs a PushSrc with the specified properties. Use the various set...() methods to set properties, and finish construction with PushSrc.Builder.build().
      Returns:
      the builder object