Membrane.UDP.Sink (Membrane UDP plugin v0.14.3)

View Source

Element that sends buffers received on the input pad over a UDP socket.

The local and destination addresses are provided at init via the element's options; the destination can additionally be changed at runtime by returning a :notify_child action with a set_destination_notification/0:

{[notify_child: {:sink, {:set_destination, peer_ip, peer_port}}], state}

Element options

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

  • destination_address

    :inet.ip_address()

    Required
    An IP Address that the packets will be sent to.

  • destination_port_no

    destination_port()

    Required
    A UDP port number of a target.

  • local_address

    :inet.socket_address()

    Default value: :any
    An IP Address set for a UDP socket used to sent packets. It allows to specify which network interface to use if there's more than one.

  • local_port_no

    :inet.port_number()

    Default value: 0
    A UDP port number for the socket used to sent packets. If set to 0 (default) the underlying OS will assign a free UDP port.

  • local_socket

    :gen_udp.socket() | nil

    Default value: nil
    Already opened UDP socket, if provided it will be used instead of creating and opening a new one.

Pads

:input

Accepted formats:

_any
Direction::input
Availability::always
Flow control::auto

Summary

Functions

Returns description of options available for this module

Types

destination_port()

@type destination_port() :: 1..65535

set_destination_notification()

@type set_destination_notification() ::
  {:set_destination, :inet.ip_address(), destination_port()}

t()

@type t() :: %Membrane.UDP.Sink{
  destination_address: :inet.ip_address(),
  destination_port_no: destination_port(),
  local_address: :inet.socket_address(),
  local_port_no: :inet.port_number(),
  local_socket: :gen_udp.socket() | nil
}

Struct containing options for Membrane.UDP.Sink

Functions

options()

@spec options() :: keyword()

Returns description of options available for this module