View Source Mediasoup.PipeTransport (mediasoup_elixir v0.9.0)

https://mediasoup.org/documentation/v3/mediasoup/api/#PipeTransport

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Closes the PipeTransport.

Tells whether the given PipeTransport is closed on the local node.

Instructs the router to send audio or video RTP (or SRTP depending on the transport class). This is the way to extract media from mediasoup. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consume

Instructs the router to send data messages to the endpoint via SCTP protocol or directly to the Rust process if the transport is a DirectTransport. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consumedata

Dump internal stat for PipeTransport.

PipeTransport identifier.

Callback implementation for GenServer.init/1.

Instructs the router to receive audio or video RTP (or SRTP depending on the transport class). This is the way to inject media into mediasoup. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-produce

Instructs the router to receive data messages. Those messages can be delivered by an endpoint via SCTP protocol or can be directly sent from the Node.js application if the transport is a DirectTransport. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-producedata

Local SRTP parameters representing the crypto suite and key material used to encrypt sending RTP and SRTP. Those parameters must be given to the paired pipeTransport in the connect() method. https://mediasoup.org/documentation/v3/mediasoup/api/#pipeTransport-srtpParameters

The transport tuple. It refers to both RTP and RTCP since pipe transports use RTCP-mux by design. https://mediasoup.org/documentation/v3/mediasoup/api/#pipeTransport-tuple

Link to this section Types

@type connect_option() :: %{
  :ip => String.t(),
  :port => integer(),
  optional(:srtpParameters) => srtp_parameters_t() | nil
}
@type event_type() :: :on_close | :on_sctp_state_change | :on_tuple
@type sctp_parameters_t() :: map()

https://mediasoup.org/documentation/v3/mediasoup/sctp-parameters/#SctpParameters

@type srtp_parameters_t() :: map()

https://mediasoup.org/documentation/v3/mediasoup/srtp-parameters/#SrtpParameters

@type t() :: %Mediasoup.PipeTransport{id: String.t(), pid: pid()}
@type transport_stat() :: map()
@type transport_tuple() :: map()

https://mediasoup.org/documentation/v3/mediasoup/api/#TransportTuple

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec close(t()) :: :ok

Closes the PipeTransport.

@spec closed?(t()) :: boolean()

Tells whether the given PipeTransport is closed on the local node.

Link to this function

connect(pipe_transport, option)

View Source
@spec connect(t(), option :: connect_option()) ::
  {:ok} | {:error, String.t() | :terminated}

Provides the pipe RTP transport with the remote parameters. https://mediasoup.org/documentation/v3/mediasoup/api/#pipeTransport-connect

Link to this function

consume(transport, option)

View Source
@spec consume(t(), Mediasoup.Consumer.Options.t() | map()) ::
  {:ok, Mediasoup.Consumer.t()} | {:error, String.t() | :terminated}

Instructs the router to send audio or video RTP (or SRTP depending on the transport class). This is the way to extract media from mediasoup. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consume

Link to this function

consume_data(transport, option)

View Source
@spec consume_data(t(), Mediasoup.DataConsumer.Options.t() | map()) ::
  {:ok, Mediasoup.DataConsumer.t()} | {:error, String.t() | :terminated}

Instructs the router to send data messages to the endpoint via SCTP protocol or directly to the Rust process if the transport is a DirectTransport. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-consumedata

@spec dump(t()) :: any() | {:error, :terminated}

Dump internal stat for PipeTransport.

Link to this function

event(transport, listener, event_types \\ [:on_close, :on_sctp_state_change, :on_tuple])

View Source
@spec event(t(), pid(), event_types :: [event_type()]) ::
  {:ok} | {:error, :terminated}

Starts observing event.

Link to this function

get_stats(pipe_transport)

View Source
@spec get_stats(t()) :: [transport_stat()] | {:error, :terminated}

Returns current RTC statistics of the pipe transport. https://mediasoup.org/documentation/v3/mediasoup/api/#pipeTransport-getStats

@spec id(t()) :: String.t()

PipeTransport identifier.

Callback implementation for GenServer.init/1.

Link to this function

produce(transport, option)

View Source
@spec produce(t(), Mediasoup.Producer.Options.t() | map()) ::
  {:ok, Mediasoup.Producer.t()} | {:error, String.t() | :terminated}

Instructs the router to receive audio or video RTP (or SRTP depending on the transport class). This is the way to inject media into mediasoup. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-produce

Link to this function

produce_data(transport, option)

View Source
@spec produce_data(t(), Mediasoup.DataProducer.Options.t() | map()) ::
  {:ok, Mediasoup.DataProducer.t()} | {:error, String.t() | :terminated}

Instructs the router to receive data messages. Those messages can be delivered by an endpoint via SCTP protocol or can be directly sent from the Node.js application if the transport is a DirectTransport. https://mediasoup.org/documentation/v3/mediasoup/api/#transport-producedata

Link to this function

sctp_parameters(pipe_transport)

View Source
@spec sctp_parameters(t()) :: sctp_parameters_t() | {:error, :terminated}

Local SCTP parameters. Or undefined if SCTP is not enabled. https://mediasoup.org/documentation/v3/mediasoup/api/#pipeTransport-sctpParameters

Link to this function

sctp_state(pipe_transport)

View Source
@spec sctp_state(t()) :: String.t() | {:error, :terminated}

Current SCTP state. Or undefined if SCTP is not enabled. https://mediasoup.org/documentation/v3/mediasoup/api/#pipeTransport-sctpState

Link to this function

srtp_parameters(pipe_transport)

View Source
@spec srtp_parameters(t()) :: srtp_parameters_t() | {:error, :terminated}

Local SRTP parameters representing the crypto suite and key material used to encrypt sending RTP and SRTP. Those parameters must be given to the paired pipeTransport in the connect() method. https://mediasoup.org/documentation/v3/mediasoup/api/#pipeTransport-srtpParameters

@spec struct_from_pid(pid()) :: t()
Link to this function

struct_from_pid_and_ref(pid, reference)

View Source
@spec tuple(t()) :: transport_tuple() | {:error, :terminated}

The transport tuple. It refers to both RTP and RTCP since pipe transports use RTCP-mux by design. https://mediasoup.org/documentation/v3/mediasoup/api/#pipeTransport-tuple