View Source Membrane.Testing.Endpoint (Membrane Core v0.11.2)
Membrane element.
element-options
Element options
Passed via struct Membrane.Testing.Endpoint.t/0
autodemandboolean()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_demandmessage.output{initial_state :: any(), generator} | Enum.t()Default value:
{0, &Membrane.Testing.Endpoint.default_buf_gen/2}
Ifoutputis an enumerable withMembrane.Payload.t/0then buffer containing those payloads will be sent through the:outputpad and followed byMembrane.Element.Action.end_of_stream_t/0.If
outputis a{initial_state, function}tuple then the the function will be invoked each timehandle_demandis called. It is an action generator that takes two arguments. The first argument is the state that is initially set toinitial_state. The second one defines the size of the demand. Such function should return{actions, next_state}whereactionsis a list of actions that will be returned fromhandle_demand/4andnext_stateis the value that will be used for the next call.stream_formatstruct()Default value:
%Membrane.RemoteStream{content_format: nil, type: :bytestream}
Stream format to be sent before theoutput.
pads
Pads
input
:input
Accepted formats:
_any| Direction: | :input |
| Availability: | :always |
| Mode: | :pull |
| Demand mode: | :manual |
| Demand unit: | :buffers |
output
:output
Accepted formats:
_any| Direction: | :output |
| Availability: | :always |
| Mode: | :pull |
| Demand mode: | :manual |
Link to this section Summary
Functions
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(), output: {initial_state :: any(), generator()} | Enum.t(), stream_format: struct() }
Struct containing options for Membrane.Testing.Endpoint
Link to this section Functions
@spec default_buf_gen(integer(), integer()) :: {[Membrane.Element.Action.t()], integer()}
@spec options() :: keyword()
Returns description of options available for this module
@spec output_from_buffers([Membrane.Buffer.t()]) :: {[Membrane.Buffer.t()], generator()}
Creates output with generator function from list of buffers.