Class FlowCombiner

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

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

Utility struct to help handling GstFlowReturn combination. Useful for GstElements that have multiple source pads and need to combine the different GstFlowReturn for those pads.

GstFlowCombiner works by using the last GstFlowReturn for all GstPad it has in its list and computes the combined return value and provides it to the caller.

To add a new pad to the GstFlowCombiner use gst_flow_combiner_add_pad(). The new GstPad is stored with a default value of org.freedesktop.gstreamer.gst.FlowReturn#OK.

In case you want a GstPad to be removed, use gst_flow_combiner_remove_pad().

Please be aware that this struct isn't thread safe as its designed to be used by demuxers, those usually will have a single thread operating it.

These functions will take refs on the passed GstPads.

Aside from reducing the user's code size, the main advantage of using this helper struct is to follow the standard rules for GstFlowReturn combination. These rules are:

FlowReturn.ERROR or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are returned immediately from the gst_flow_combiner_update_flow() function.

Since:
1.4
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new GstFlowCombiner, use gst_flow_combiner_free() to free it.
    Create a FlowCombiner proxy instance for the provided memory address.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addPad(Pad pad)
    Adds a new GstPad to the GstFlowCombiner.
    void
    Removes all pads from a GstFlowCombiner and resets it to its initial state.
    void
    Frees a GstFlowCombiner struct and all its internal data.
    The memory layout of the native struct.
    static @Nullable Type
    Get the GType of the FlowCombiner class.
    ref()
    Increments the reference count on the GstFlowCombiner.
    void
    Removes a GstPad from the GstFlowCombiner.
    void
    Reset flow combiner and all pads to their initial state without removing pads.
    void
    Decrements the reference count on the GstFlowCombiner.
    Computes the combined flow return for the pads in it.
    Sets the provided pad's last flow return to provided value and computes the combined flow return for the pads in it.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FlowCombiner

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

      public FlowCombiner()
      Creates a new GstFlowCombiner, use gst_flow_combiner_free() to free it.
      Since:
      1.4
  • Method Details

    • getType

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

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

      public void addPad(Pad pad)
      Adds a new GstPad to the GstFlowCombiner.
      Parameters:
      pad - the GstPad that is being added
      Since:
      1.4
    • clear

      public void clear()
      Removes all pads from a GstFlowCombiner and resets it to its initial state.
      Since:
      1.6
    • free

      public void free()
      Frees a GstFlowCombiner struct and all its internal data.
      Since:
      1.4
    • ref

      public FlowCombiner ref()
      Increments the reference count on the GstFlowCombiner.
      Returns:
      the GstFlowCombiner.
      Since:
      1.12.1
    • removePad

      public void removePad(Pad pad)
      Removes a GstPad from the GstFlowCombiner.
      Parameters:
      pad - the GstPad to remove
      Since:
      1.4
    • reset

      public void reset()
      Reset flow combiner and all pads to their initial state without removing pads.
      Since:
      1.6
    • unref

      public void unref()
      Decrements the reference count on the GstFlowCombiner.
      Since:
      1.12.1
    • updateFlow

      public FlowReturn updateFlow(FlowReturn fret)

      Computes the combined flow return for the pads in it.

      The GstFlowReturn parameter should be the last flow return update for a pad in this GstFlowCombiner. It will use this value to be able to shortcut some combinations and avoid looking over all pads again. e.g. The last combined return is the same as the latest obtained GstFlowReturn.

      Parameters:
      fret - the latest GstFlowReturn received for a pad in this GstFlowCombiner
      Returns:
      The combined GstFlowReturn
      Since:
      1.4
    • updatePadFlow

      public FlowReturn updatePadFlow(Pad pad, FlowReturn fret)

      Sets the provided pad's last flow return to provided value and computes the combined flow return for the pads in it.

      The GstFlowReturn parameter should be the last flow return update for a pad in this GstFlowCombiner. It will use this value to be able to shortcut some combinations and avoid looking over all pads again. e.g. The last combined return is the same as the latest obtained GstFlowReturn.

      Parameters:
      pad - the GstPad whose GstFlowReturn to update
      fret - the latest GstFlowReturn received for a pad in this GstFlowCombiner
      Returns:
      The combined GstFlowReturn
      Since:
      1.6