View Source Membrane.Testing.Sink (Membrane Core v1.1.2)

Sink Element that notifies the pipeline about buffers and events it receives.

By default Sink will demand buffers automatically, but you can override that behaviour by using autodemand option. If set to false no automatic demands shall be made. Demands can be then triggered by sending {:make_demand, size} message.

This element can be used in conjunction with Membrane.Testing.Pipeline to enable asserting on buffers and events it receives.

alias Membrane.Testing
links = [
    ... |>
    child(:sink, %Testing.Sink{}) |>
    ...
]
{:ok, pid} = Testing.Pipeline.start_link(
  spec: links
)

Asserting that Membrane.Testing.Sink element processed a buffer that matches a specific pattern can be achieved using Membrane.Testing.Assertions.assert_sink_buffer/3.

assert_sink_buffer(pid, :sink ,%Membrane.Buffer{payload: 255})

element-options

Element options

Passed via struct Membrane.Testing.Sink.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.

pads

Pads

input

:input

Accepted formats:

_any
Direction::input
Availability::always
Flow control::manual
Demand unit::buffers

Link to this section Summary

Types

t()

Struct containing options for Membrane.Testing.Sink

Functions

Returns description of options available for this module

Link to this section Types

@type t() :: %Membrane.Testing.Sink{autodemand: boolean()}

Struct containing options for Membrane.Testing.Sink

Link to this section Functions

@spec options() :: keyword()

Returns description of options available for this module