Membrane Core v0.3.0 Membrane.Core.InputBuffer 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

t()

Link to this section Types

Link to this type

props_t() View Source
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:

  • :preffered_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 set Membrane.Buffer.Metric and is obtained via Membrane.Buffer.Metric.pullbuffer_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 preffered 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 preffered size.
Link to this type

t() View Source
t() :: %Membrane.Core.InputBuffer{
  current_size: non_neg_integer(),
  demand: non_neg_integer(),
  demand_pid: pid(),
  linked_output_ref: Membrane.Element.Pad.ref_t(),
  metric: module(),
  min_demand: pos_integer(),
  name: Membrane.Element.name_t(),
  preferred_size: pos_integer(),
  q: Qex.t(),
  toilet: %{warn: pos_integer(), fail: pos_integer()}
}

Link to this section Functions

Link to this function

empty?(input_buffer) View Source
empty?(t()) :: boolean()

Link to this function

new(name, demand_pid, linked_output_ref, demand_unit, enable_toilet?, props) View Source
new(
  Membrane.Element.name_t(),
  demand_pid :: pid(),
  Membrane.Element.Pad.ref_t(),
  Membrane.Buffer.Metric.unit_t(),
  enable_toilet? :: boolean(),
  props_t()
) :: t()

Link to this function

parse_props(input) View Source
parse_props(keyword()) :: {:error, reason :: any()} | {:ok, props_t()}

Link to this function

store(pb, type \\ :buffers, v) View Source
store(t(), atom(), any()) :: {:ok, t()} | {:error, any()}