View Source Membrane.RTMP.Source (Membrane RTMP plugin v0.9.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()

    Required
    Socket on which the source will be receiving the RTMP stream. The socket must be already connected to the RTMP client and be in non-active mode (active set to false).

  • validator

    Membrane.RTMP.MessageValidator

    Required
    A Module implementing Membrane.RTMP.MessageValidator behaviour, used for validating the stream.

pads

Pads

output

:output

Availability :always
Caps Membrane.RemoteStream
Demand mode :manual
Demand unit :buffers
Direction :output
Mode :pull
Name :output

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.

Notification sent when the validator denies incoming RTMP stream.

Notification sent when the validator approves given validation stage..

t()

Struct containing options for Membrane.RTMP.Source

Functions

Returns pads descriptions for Membrane.RTMP.Source

Returns description of options available for this module

Link to this section Types

Link to this type

socket_control_needed_t()

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

Link to this type

stream_validation_failed_t()

View Source
@type stream_validation_failed_t() ::
  {:stream_validation_failed, validation_stage_t(), reason :: any()}

Notification sent when the validator denies incoming RTMP stream.

Link to this type

stream_validation_success_t()

View Source
@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(),
  validator: Membrane.RTMP.MessageValidator
}

Struct containing options for Membrane.RTMP.Source

@type validation_stage_t() :: :publish | :release_stream | :set_data_frame

Link to this section Functions

@spec membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]

Returns pads descriptions for Membrane.RTMP.Source

@spec options() :: keyword()

Returns description of options available for this module