Membrane.Core.InputBuffer (Membrane Core v0.7.0) View Source
Buffer that is attached to the :input
pad when working in a :pull
mode.
It stores Membrane.Buffer
, Membrane.Event
and Membrane.Caps
structs and
prevents the situation where the data in a stream contains the discontinuities.
It also guarantees that element won't be flooded with the incoming data.
Link to this section Summary
Types
Properties that can be passed when creating new InputBuffer
Link to this section Types
Specs
output_t() :: {:empty | :value, [output_value_t()]}
Specs
output_value_t() :: {:event | :caps, any()} | {:buffers, list(), pos_integer()}
Specs
props_t() :: [ preferred_size: pos_integer(), min_demand: pos_integer(), warn_size: pos_integer(), fail_size: pos_integer() ]
Properties that can be passed when creating new InputBuffer
Available options are:
:preferred_size
- size which will be the 'target' for InputBuffer - it will make demands trying to grow to this size. Its default value depends on the setMembrane.Buffer.Metric
and is obtained viaMembrane.Buffer.Metric.input_buf_preferred_size/0
:min_demand
- the minimal size of a demand that can be sent to the linked output pad. This prevents from excessive message passing between elements. Defaults to a quarter of preferred size.warn_size
- in toilet mode (connecting push output to pull input pad), receiving more data than this size triggers a warning. By default it is equal to twice the preferred size.fail_size
- in toilet mode (connecting push output to pull input pad), receiving more data than this results in an element failure. By default, it is four times the preferred size.
Specs
t() :: %Membrane.Core.InputBuffer{ current_size: non_neg_integer(), demand: non_neg_integer(), log_tag: String.t(), metric: module(), min_demand: pos_integer(), preferred_size: pos_integer(), q: Qex.t(), toilet?: boolean(), toilet_props: %{warn: pos_integer(), fail: pos_integer()} }
Link to this section Functions
Specs
Specs
Specs
init( Membrane.Buffer.Metric.unit_t(), pid(), Membrane.Pad.ref_t(), String.t(), props_t() ) :: t()
Specs
Specs
Specs
take_and_demand(t(), non_neg_integer(), pid(), Membrane.Pad.ref_t()) :: {output_t(), t()}