Membrane Core v0.5.0 Membrane.Parent behaviour View Source
Module that manages a common part between pipelines and bins.
Link to this section Summary
Types
Type that defines all valid return values from most callbacks.
Functions
Brings common stuff needed to implement a parent. Used by
Membrane.Pipeline.__using__/1
and Membrane.Bin.__using__/1
.
Callbacks
Callback invoked when pipeline's element receives Membrane.Event.EndOfStream
event.
Callback invoked when pipeline's element receives Membrane.Event.StartOfStream
event.
Callback invoked when a notification comes in from an element.
Callback invoked when bin receives a message that is not recognized as an internal membrane message.
Callback invoked when bin transition from :playing
to :prepared
state has finished,
that is all of its children are prepared to be stopped.
Callback invoked when bin is in :playing
state, i.e. all its children
are in this state.
Callback invoked when bin is in :playing
state, i.e. all its children
are in this state.
Callback invoked when Membrane.ParentSpec
is linked and in the same playback
state as bin.
Callback invoked when bin transition from :stopped
to :prepared
state has finished,
that is all of its children are prepared to enter :playing
state.
Link to this section Types
callback_return_t()
View Sourcecallback_return_t() :: Membrane.Core.CallbackHandler.callback_return_t( Membrane.Parent.Action.t(), internal_state_t() )
Type that defines all valid return values from most callbacks.
state_t()
View Sourcestate_t() :: Membrane.Core.Bin.State.t() | Membrane.Core.Pipeline.State.t()
Link to this section Functions
Brings common stuff needed to implement a parent. Used by
Membrane.Pipeline.__using__/1
and Membrane.Bin.__using__/1
.
Options:
:bring_spec?
- if true (default) imports and aliasesMembrane.ParentSpec
:bring_pad?
- if true (default) requires and aliasesMembrane.Pad
Link to this section Callbacks
handle_element_end_of_stream({}, state)
View Sourcehandle_element_end_of_stream( {Membrane.Child.name_t(), Membrane.Pad.ref_t()}, state :: internal_state_t() ) :: callback_return_t()
Callback invoked when pipeline's element receives Membrane.Event.EndOfStream
event.
handle_element_start_of_stream({}, state)
View Sourcehandle_element_start_of_stream( {Membrane.Child.name_t(), Membrane.Pad.ref_t()}, state :: internal_state_t() ) :: callback_return_t()
Callback invoked when pipeline's element receives Membrane.Event.StartOfStream
event.
handle_notification(notification, element, state)
View Sourcehandle_notification( notification :: Membrane.Notification.t(), element :: Membrane.Child.name_t(), state :: internal_state_t() ) :: callback_return_t()
Callback invoked when a notification comes in from an element.
handle_other(message, state)
View Sourcehandle_other(message :: any(), state :: internal_state_t()) :: callback_return_t()
Callback invoked when bin receives a message that is not recognized as an internal membrane message.
Useful for receiving ticks from timer, data sent from NIFs or other stuff.
handle_playing_to_prepared(state)
View Sourcehandle_playing_to_prepared(state :: internal_state_t()) :: callback_return_t()
Callback invoked when bin transition from :playing
to :prepared
state has finished,
that is all of its children are prepared to be stopped.
handle_prepared_to_playing(state)
View Sourcehandle_prepared_to_playing(state :: internal_state_t()) :: callback_return_t()
Callback invoked when bin is in :playing
state, i.e. all its children
are in this state.
handle_prepared_to_stopped(state)
View Sourcehandle_prepared_to_stopped(state :: internal_state_t()) :: callback_return_t()
Callback invoked when bin is in :playing
state, i.e. all its children
are in this state.
handle_spec_started(children, state)
View Sourcehandle_spec_started( children :: [Membrane.Child.name_t()], state :: internal_state_t() ) :: callback_return_t()
Callback invoked when Membrane.ParentSpec
is linked and in the same playback
state as bin.
This callback can be started from c:handle_init/1
callback or as
t:Membrane.Core.Parent.Action.spec_action_t/0
action.
handle_stopped_to_prepared(state)
View Sourcehandle_stopped_to_prepared(state :: internal_state_t()) :: callback_return_t()
Callback invoked when bin transition from :stopped
to :prepared
state has finished,
that is all of its children are prepared to enter :playing
state.