Membrane.Element.WithOutputPads behaviour (Membrane Core v0.7.0) View Source

Module defining behaviour for source and filter elements.

When used declares behaviour implementation, provides default callback definitions and imports macros.

For more information on implementing elements, see Membrane.Element.Base.

Link to this section Summary

Functions

Macro that defines output pad for the element.

Macro that defines multiple output pads for the element.

Callbacks

Callback called when buffers should be emitted by a source or filter.

Link to this section Functions

Link to this macro

def_output_pad(name, spec)

View Source (macro)

Macro that defines output pad for the element.

Allows to use one_of/1 and range/2 functions from Membrane.Caps.Matcher without module prefix.

It automatically generates documentation from the given definition and adds compile-time caps specs validation.

The type Membrane.Pad.output_spec_t/0 describes how the definition of pads should look.

Link to this macro

def_output_pads(pads)

View Source (macro)
This macro is deprecated. Use `def_output_pad/2 for each pad instead.

Macro that defines multiple output pads for the element.

Deprecated in favor of def_output_pad/2

Link to this section Callbacks

Link to this callback

handle_demand(pad, size, unit, context, state)

View Source (optional)

Specs

Callback called when buffers should be emitted by a source or filter.

It is called only for output pads in the pull mode, as in their case demand is triggered by the input pad of the subsequent element.

In sources, appropriate amount of data should be sent here.

In filters, this callback should usually return :demand action with size sufficient for supplying incoming demand. This will result in calling Membrane.Filter.handle_process_list/4, which is to supply the demand.

If a source is unable to produce enough buffers, or a filter underestimated returned demand, the :redemand action should be used (see Membrane.Element.Action.redemand_t/0).