Membrane.RTSP.Transport behaviour (Membrane RTSP v0.3.0) View Source

Behaviour describing Transport Layer for Real Time Streaming Protocol

Link to this section Summary

Callbacks

Callback used for cleaning up the transport layer when the session is closed.

Callback for executing requests with a given transport layer.

Callback for handling any transport-layer specific messages. Session will redirect any unknown messages to this callback.

Callback for initialization of transport layer implementation.

Link to this section Callbacks

Specs

close(state :: any()) :: :ok

Callback used for cleaning up the transport layer when the session is closed.

Link to this callback

execute(request, state, options)

View Source

Specs

execute(request :: any(), state :: any(), options :: Keyword.t()) ::
  {:ok, reply :: any()} | {:error, reason :: any()}

Callback for executing requests with a given transport layer.

Link to this callback

handle_info(msg, state)

View Source (optional)

Specs

handle_info(msg :: any(), state :: any()) ::
  {action :: term(), state :: any()}
  | {action :: term(), reply :: any(), state :: any()}

Callback for handling any transport-layer specific messages. Session will redirect any unknown messages to this callback.

It is useful for eg. correctly handling :tcp_close message and similar.

Specs

init(url :: URI.t(), options :: Keyword.t()) :: {:ok, any()} | {:error, any()}

Callback for initialization of transport layer implementation.

Upon successful initialization, the callback should return {:ok, state}. Value of state can be anything, but it is recommended that it contains some information that identifies a transport layer instance.

Link to this section Functions

Link to this function

new(module, url, options \\ [])

View Source
This function is deprecated. Use init/3 instead. It is not recommended to manually initiate transport.

Specs

new(module(), binary() | URI.t(), Keyword.t()) :: {:ok, any()} | {:error, any()}