View Source Membrane.RTMP.Source (Membrane RTMP plugin v0.12.1)
Membrane Element for receiving an RTMP stream. Acts as a RTMP Server.
When initializing, the source sends socket_control_needed_t/0
notification,
upon which it should be granted the control over the socket
via :gen_tcp.controlling_process/2
.
The Source allows for providing custom validator module, that verifies some of the RTMP messages.
The module has to implement the Membrane.RTMP.MessageValidator
behaviour.
If the validation fails, a stream_validation_failed_t/0
notification is sent.
This implementation is limited to only AAC and H264 streams.
element-options
Element options
Passed via struct Membrane.RTMP.Source.t/0
socket
:gen_tcp.socket() | :ssl.sslsocket()
Required
Socket on which the source will be receiving the RTMP or RTMPS stream. The socket must be already connected to the RTMP client and be in non-active mode (active
set tofalse
).In case of RTMPS the
use_ssl?
options must be set to true.use_ssl?
boolean()
Default value:
false
Tells whether the passed socket is a regular TCP socket or SSL one.validator
Membrane.RTMP.MessageValidator.t()
Default value:
%Membrane.RTMP.MessageValidator.Default{}
AMembrane.RTMP.MessageValidator
implementation, used for validating the stream. By default allows every incoming stream.
pads
Pads
output
:output
Accepted formats:
Membrane.RemoteStream
Direction: | :output |
Availability: | :always |
Mode: | :pull |
Demand mode: | :manual |
Link to this section Summary
Types
Notification sent when the RTMP Source element is initialized and it should be granted control over the socket using :gen_tcp.controlling_process/2
.
Same as socket_control_needed_t/0
but for secured socket meant for RTMPS.
Notification sent when the validator denies incoming RTMP stream.
Notification sent when the validator approves given validation stage.
Struct containing options for Membrane.RTMP.Source
Notification sent when the socket has been closed but no media data has flown through it.
Link to this section Types
@type socket_control_needed_t() :: {:socket_control_needed, :gen_tcp.socket(), pid()}
Notification sent when the RTMP Source element is initialized and it should be granted control over the socket using :gen_tcp.controlling_process/2
.
@type ssl_socket_control_needed_t() :: {:ssl_socket_control_needed, :ssl.sslsocket(), pid()}
Same as socket_control_needed_t/0
but for secured socket meant for RTMPS.
@type stream_validation_failed_t() :: {:stream_validation_failed, validation_stage_t(), reason :: any()}
Notification sent when the validator denies incoming RTMP stream.
@type stream_validation_success_t() :: {:stream_validation_success, validation_stage_t(), result :: any()}
Notification sent when the validator approves given validation stage.
@type t() :: %Membrane.RTMP.Source{ socket: :gen_tcp.socket() | :ssl.sslsocket(), use_ssl?: boolean(), validator: Membrane.RTMP.MessageValidator.t() }
Struct containing options for Membrane.RTMP.Source
@type unexpected_socket_closed_t() :: :unexpected_socket_closed
Notification sent when the socket has been closed but no media data has flown through it.
This notification is only sent when the :output
pad never reaches :start_of_stream
.
@type validation_stage_t() :: :publish | :release_stream | :set_data_frame
Link to this section Functions
@spec options() :: keyword()
Returns description of options available for this module