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

Behaviour describing Transport Layer for Real Time Streaming Protocol

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.

Callbacks

@callback 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
@callback execute(request :: any(), state :: any(), options :: Keyword.t()) ::
  :ok | {: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)
@callback 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.

@callback 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.

Functions

Link to this function

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

View Source
This function is deprecated. Use Membrane.RTSP.init/3 instead. It is not recommended to manually initiate transport.
@spec new(module(), binary() | URI.t(), Keyword.t()) :: {:ok, any()} | {:error, any()}