View Source Membrane.Testing.Sink (Membrane Core v0.10.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
children = [
    ...,
    sink: %Testing.Sink{}
]
{:ok, pid} = Testing.Pipeline.start_link(
  children: children,
  links: Membrane.ParentSpec.link_linear(children)
)

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

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

Link to this section Summary

Types

t()

Struct containing options for Membrane.Testing.Sink

Functions

Returns pads descriptions for Membrane.Testing.Sink

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 membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]

Returns pads descriptions for Membrane.Testing.Sink

@spec options() :: keyword()

Returns description of options available for this module