Membrane.UDP.Source (Membrane UDP plugin v0.14.1)

View Source

Element that reads packets from a UDP socket and sends their payloads through the output pad.

By receiving a :close_socket notification this element will close the socket and send end_of_stream to it's output pad.

Element options

Passed via struct Membrane.UDP.Source.t/0

  • local_port_no

    pos_integer()

    Default value: 5000
    A UDP port number used when opening a receiving socket.

  • local_address

    :inet.socket_address()

    Default value: :any
    An IP Address on which the socket will listen. It allows to choose which network interface to use if there's more than one.

  • recv_buffer_size

    pos_integer()

    Default value: 1048576
    Size of the receive buffer. Packages of size greater than this buffer will be truncated

  • pierce_nat_ctx

    %{uri: URI.t(), address: :inet.ip_address(), port: pos_integer()} | nil

    Default value: nil
    Context necessary to make an attempt to create client-side NAT binding by sending an empty datagram from the Membrane.UDP.Source to an arbitrary host.

    • If left as nil, no attempt will ever be made.
    • If filled in, whenever the pipeline switches playback to :playing, one datagram (with an empty payload) will be sent from the opened socket to the :port at :address provided via this option. If :address is not present, it will be parsed from :uri.

    Disclaimer: This is a potential vulnerability. Use with caution.

Pads

:output

Accepted formats:

%RemoteStream{type: :packetized}
Direction::output
Availability::always
Flow control::push

Summary

Types

t()

Struct containing options for Membrane.UDP.Source

Functions

Returns description of options available for this module

Types

t()

@type t() :: %Membrane.UDP.Source{
  local_address: :inet.socket_address(),
  local_port_no: pos_integer(),
  pierce_nat_ctx:
    %{uri: URI.t(), address: :inet.ip_address(), port: pos_integer()} | nil,
  recv_buffer_size: pos_integer()
}

Struct containing options for Membrane.UDP.Source

Functions

options()

@spec options() :: keyword()

Returns description of options available for this module