View Source Membrane.Testing.Endpoint (Membrane Core v0.10.2)

Membrane element.

element-options

Element options

Passed via struct Membrane.Testing.Endpoint.t/0

  • autodemand

    boolean

    Default value: true
    If true element will automatically make demands. If it is set to false demand has to be triggered manually by sending :make_demand message.

  • output

    {initial_state :: any(), generator} | Enum.t()

    Default value: {0, &Membrane.Testing.Endpoint.default_buf_gen/2}
    If output is an enumerable with Membrane.Payload.t() then buffer containing those payloads will be sent through the :output pad and followed by Membrane.Element.Action.end_of_stream_t/0.

    If output is a {initial_state, function} tuple then the the function will be invoked each time handle_demand is called. It is an action generator that takes two arguments. The first argument is the state that is initially set to initial_state. The second one defines the size of the demand. Such function should return {actions, next_state} where actions is a list of actions that will be returned from handle_demand/4 and next_state is the value that will be used for the next call.

  • caps

    struct()

    Default value: %Membrane.RemoteStream{content_format: nil, type: :bytestream}
    Caps to be sent before the output.

pads

Pads

input

:input

Availability :always
Caps :any
Demand mode :manual
Demand unit :buffers
Direction :input
Mode :pull
Name :input

output

:output

Availability :always
Caps :any
Demand mode :manual
Demand unit :buffers
Direction :output
Mode :pull
Name :output

Link to this section Summary

Types

t()

Struct containing options for Membrane.Testing.Endpoint

Functions

Returns pads descriptions for Membrane.Testing.Endpoint

Returns description of options available for this module

Creates output with generator function from list of buffers.

Link to this section Types

@type generator() ::
  (state :: any(), buffers_cnt :: pos_integer() ->
     {[Membrane.Element.Action.t()], state :: any()})
@type t() :: %Membrane.Testing.Endpoint{
  autodemand: boolean(),
  caps: struct(),
  output: {initial_state :: any(), generator()} | Enum.t()
}

Struct containing options for Membrane.Testing.Endpoint

Link to this section Functions

Link to this function

default_buf_gen(generator_state, size)

View Source
@spec default_buf_gen(integer(), integer()) ::
  {[Membrane.Element.Action.t()], integer()}
@spec membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]

Returns pads descriptions for Membrane.Testing.Endpoint

@spec options() :: keyword()

Returns description of options available for this module

Link to this function

output_from_buffers(data)

View Source
@spec output_from_buffers([Membrane.Buffer.t()]) ::
  {[Membrane.Buffer.t()], generator()}

Creates output with generator function from list of buffers.