Membrane Core v0.3.2 Membrane.Element View Source
Module containing functions spawning, shutting down, inspecting and controlling playback of elements.
These functions are usually called by Membrane.Pipeline
,
and can be called from elsewhere only if there is a really good reason for
doing so.
Link to this section Summary
Types
Type that defines an element name by which it is identified.
Defines options that can be passed to start/5
/ start_link/5
and received
in Membrane.Element.Base.Mixin.CommonBehaviour.handle_init/1
callback.
Type of user-managed state of element.
Defines possible element types
Functions
Changes the playback state to the new_state
.
Returns a specification to start this module under a supervisor.
Checks whether module is an element.
Sends synchronous call to element, informing it that linking has finished.
Sends synchronous call to element, requesting it to create a new instance of
:on_request
pad.
Checks whether the given term is a valid element name
Sends synchronous calls to two elements, telling them to link with each other.
Changes playback state to :playing
.
Changes playback state to :prepared
.
Sends synchronous call to the given element requesting it to set controlling pid.
Sends synchronous call to the given element requesting it to set watcher.
Stops given element process.
Works similarly to start_link/3
, but does not link to the current process.
Works similarly to start_link/5
, but does not link to the current process.
Works similarly to start_link/5
, but passes element struct (with default values)
as element options.
Starts process for element of given module, initialized with given options and links it to the current process in the supervision tree.
Changes playback state to :stopped
.
Sends synchronous call to element, telling it to unlink all its pads.
Link to this section Types
Type that defines an element name by which it is identified.
Defines options that can be passed to start/5
/ start_link/5
and received
in Membrane.Element.Base.Mixin.CommonBehaviour.handle_init/1
callback.
playback_state_t()
View Sourceplayback_state_t() :: :stopped | :prepared | :playing
Type of user-managed state of element.
Defines possible element types:
- source, producing buffers
- filter, processing buffers
- sink, consuming buffers
Link to this section Functions
change_playback_state(pid, new_state)
View Sourcechange_playback_state(pid(), playback_state_t()) :: :ok
Changes the playback state to the new_state
.
Returns a specification to start this module under a supervisor.
See Supervisor
.
Checks whether module is an element.
Sends synchronous call to element, informing it that linking has finished.
Sends synchronous call to element, requesting it to create a new instance of
:on_request
pad.
Checks whether the given term is a valid element name
Sends synchronous calls to two elements, telling them to link with each other.
Changes playback state to :playing
.
An alias for change_playback_state/2
with proper state.
Changes playback state to :prepared
.
An alias for change_playback_state/2
with proper state.
Sends synchronous call to the given element requesting it to set controlling pid.
It will wait for reply for amount of time passed as second argument (in milliseconds).
Sends synchronous call to the given element requesting it to set watcher.
It will wait for reply for amount of time passed as second argument (in milliseconds).
Stops given element process.
It will wait for reply for amount of time passed as second argument (in milliseconds).
Will trigger calling Membrane.Element.Base.Mixin.CommonBehaviour.handle_shutdown/1
callback.
start(pipeline, module, name)
View Sourcestart(pid(), module(), name_t()) :: GenServer.on_start()
Works similarly to start_link/3
, but does not link to the current process.
start(pipeline, module, name, element_options, process_options \\ [])
View Sourcestart(pid(), module(), name_t(), options_t(), GenServer.options()) :: GenServer.on_start()
Works similarly to start_link/5
, but does not link to the current process.
start_link(pipeline, module, name)
View Sourcestart_link(pid(), module(), name_t()) :: GenServer.on_start()
Works similarly to start_link/5
, but passes element struct (with default values)
as element options.
If element does not define struct, nil
is passed.
start_link(pipeline, module, name, element_options, process_options \\ [])
View Sourcestart_link(pid(), module(), name_t(), options_t(), GenServer.options()) :: GenServer.on_start()
Starts process for element of given module, initialized with given options and links it to the current process in the supervision tree.
Calls GenServer.start_link/3
underneath.
Changes playback state to :stopped
.
An alias for change_playback_state/2
with proper state.
Sends synchronous call to element, telling it to unlink all its pads.