Class StreamCollection

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class StreamCollection extends GstObject

A collection of GstStream that are available.

A GstStreamCollection will be provided by elements that can make those streams available. Applications can use the collection to show the user what streams are available by using org.freedesktop.gstreamer.gst.StreamCollectiongetStream

Once posted, a GstStreamCollection is immutable. Updates are made by sending a new GstStreamCollection message, which may or may not share some of the GstStream objects from the collection it replaces. The receiver can check the sender of a stream collection message to know which collection is obsoleted.

Several elements in a pipeline can provide GstStreamCollection.

Applications can activate streams from a collection by using the GST_EVENT_SELECT_STREAMS event on a pipeline, bin or element.

Since:
1.10
  • Constructor Details

    • StreamCollection

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

      public StreamCollection(@Nullable String upstreamId)
      Create a new GstStreamCollection.
      Parameters:
      upstreamId - The stream id of the parent stream
      Since:
      1.10
    • StreamCollection

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

    • getType

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

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

      protected StreamCollection 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 GstObject
      Returns:
      the instance as if it were its parent type
    • addStream

      public boolean addStream(Stream stream)
      Add the given stream to the collection.
      Parameters:
      stream - the GstStream to add
      Returns:
      true if the stream was properly added, else false
      Since:
      1.10
    • getSize

      public int getSize()
      Get the number of streams this collection contains
      Returns:
      The number of streams that this StreamCollection contains
      Since:
      1.10
    • getStream

      public @Nullable Stream getStream(int index)

      Retrieve the GstStream with index index from the collection.

      The caller should not modify the returned GstStream

      Parameters:
      index - Index of the stream to retrieve
      Returns:
      A GstStream
      Since:
      1.10
    • getUpstreamId

      public @Nullable String getUpstreamId()
      Returns the upstream id of the collection.
      Returns:
      The upstream id
      Since:
      1.10
    • streamNotify

      protected void streamNotify(Stream stream, ParamSpec pspec)
      default signal handler for the stream-notify signal
    • onStreamNotify

      The stream notify signal is used to be notified of property changes to streams within the collection.
      Parameters:
      detail - the signal detail
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitStreamNotify

      public void emitStreamNotify(@Nullable String detail, @Nullable Stream propStream, @Nullable ParamSpec prop)
    • builder

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