Gjsify LogoGjsify Logo

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 %GST_FLOW_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:

  • %GST_FLOW_EOS: only if all returns are EOS too
  • %GST_FLOW_NOT_LINKED: only if all returns are NOT_LINKED too
  • %GST_FLOW_ERROR or below: if at least one returns an error return
  • %GST_FLOW_NOT_NEGOTIATED: if at least one returns a not-negotiated return
  • %GST_FLOW_FLUSHING: if at least one returns flushing
  • %GST_FLOW_OK: otherwise

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

record

Hierarchy

  • FlowCombiner

Index

Constructors

Properties

name: string

Methods

  • clear(): void
  • free(): void
  • remove_pad(pad: Gst.Pad): void
  • reset(): void
  • unref(): void
  • 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: Gst.FlowReturn

      the latest #GstFlowReturn received for a pad in this #GstFlowCombiner

    Returns Gst.FlowReturn

  • 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: Gst.Pad

      the #GstPad whose #GstFlowReturn to update

    • fret: Gst.FlowReturn

      the latest #GstFlowReturn received for a pad in this #GstFlowCombiner

    Returns Gst.FlowReturn

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method