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

Link to this type

callback_return_t()

View Source
callback_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.

Link to this type

internal_state_t()

View Source
internal_state_t() :: map() | struct()
Link to this type

state_t()

View Source
state_t() :: Membrane.Core.Bin.State.t() | Membrane.Core.Pipeline.State.t()

Link to this section Functions

Link to this macro

__using__(options)

View Source (macro)

Brings common stuff needed to implement a parent. Used by Membrane.Pipeline.__using__/1 and Membrane.Bin.__using__/1.

Options:

Link to this section Callbacks

Link to this callback

handle_element_end_of_stream({}, state)

View Source
handle_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.

Link to this callback

handle_element_start_of_stream({}, state)

View Source
handle_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.

Link to this callback

handle_notification(notification, element, state)

View Source
handle_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.

Link to this callback

handle_other(message, state)

View Source
handle_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.

Link to this callback

handle_playing_to_prepared(state)

View Source
handle_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.

Link to this callback

handle_prepared_to_playing(state)

View Source
handle_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.

Link to this callback

handle_prepared_to_stopped(state)

View Source
handle_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.

Link to this callback

handle_spec_started(children, state)

View Source
handle_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.

Link to this callback

handle_stopped_to_prepared(state)

View Source
handle_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.