View Source Membrane.Element.WithInputPads behaviour (Membrane Core v1.1.2)
Module defining behaviour for sink, filter and endpoint elements.
When used declares behaviour implementation, provides default callback definitions and imports macros.
For more information on implementing elements, see Membrane.Element.Base
.
Link to this section Summary
Callbacks
Callback that is called when buffer should be processed by the Element.
Callback invoked when the previous element has finished processing via the pad, and it cannot be used anymore.
Callback invoked when element receives the first buffer from the specific pad, before Elixir.Membrane.Element.WithInputPads.handle_buffer/4
.
Callback invoked when Element is receiving information about new stream format for given pad.
Functions
Macro that defines input pad for the element.
Link to this section Callbacks
@callback handle_buffer( pad :: Membrane.Pad.ref(), buffer :: Membrane.Buffer.t(), context :: Membrane.Element.CallbackContext.t(), state :: Membrane.Element.state() ) :: {[ Membrane.Element.Action.common_actions() | Membrane.Element.Action.stream_actions() | Membrane.Element.Action.forward() ], Membrane.Element.state()}
Callback that is called when buffer should be processed by the Element.
For pads in pull mode it is called when buffer have been demanded (by returning
:demand
action from any callback).
For pads in push mode it is invoked when buffer arrive.
@callback handle_end_of_stream( pad :: Membrane.Pad.ref(), context :: Membrane.Element.CallbackContext.t(), state :: Membrane.Element.state() ) :: {[ Membrane.Element.Action.common_actions() | Membrane.Element.Action.stream_actions() | Membrane.Element.Action.forward() ], Membrane.Element.state()}
Callback invoked when the previous element has finished processing via the pad, and it cannot be used anymore.
@callback handle_start_of_stream( pad :: Membrane.Pad.ref(), context :: Membrane.Element.CallbackContext.t(), state :: Membrane.Element.state() ) :: {[ Membrane.Element.Action.common_actions() | Membrane.Element.Action.stream_actions() | Membrane.Element.Action.forward() ], Membrane.Element.state()}
Callback invoked when element receives the first buffer from the specific pad, before Elixir.Membrane.Element.WithInputPads.handle_buffer/4
.
handle_stream_format(pad, stream_format, context, state)
View Source (optional)@callback handle_stream_format( pad :: Membrane.Pad.ref(), stream_format :: Membrane.StreamFormat.t(), context :: Membrane.Element.CallbackContext.t(), state :: Membrane.Element.state() ) :: {[ Membrane.Element.Action.common_actions() | Membrane.Element.Action.stream_actions() | Membrane.Element.Action.forward() ], Membrane.Element.state()}
Callback invoked when Element is receiving information about new stream format for given pad.
In filters stream format is forwarded through all output pads by default.
Context passed to this callback contains additional field :old_stream_format
.
Link to this section Functions
Macro that defines input pad for the element.
It automatically generates documentation from the given definition and adds compile-time stream format specs validation.
The type Membrane.Pad.element_spec/0
describes how the definition of pads should look.