Membrane.RTSP (Membrane RTSP v0.12.0)

View Source

Functions for interfacing with a RTSP session

Summary

Functions

Returns a specification to start this module under a supervisor.

Same as start_link/2, but doesn't link the session process.

Starts and links session process with given URL as a base path for requests.

Transfer the control of the TCP socket the session was using to a new process. For more information see :gen_tcp.controlling_process/2. From now on the session won't try to receive responses to requests from the socket, since now an other process is controlling it. Instead of this, the session will synchronously wait for the response to be supplied with handle_response/2.

Types

headers()

@type headers() :: [{binary(), binary()}]

option()

@type option() ::
  {:connection_timeout, non_neg_integer()}
  | {:response_timeout, non_neg_integer()}

options()

@type options() :: [option()]

t()

@type t() :: pid()

Functions

announce(session, headers \\ [], body \\ "")

@spec announce(t(), headers(), binary()) :: Membrane.RTSP.Response.result()

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

close(session)

@spec close(pid()) :: :ok

describe(session, headers \\ [])

@spec describe(t(), headers()) :: Membrane.RTSP.Response.result()

get_parameter(session, headers \\ [], body \\ "")

@spec get_parameter(t(), headers(), binary()) :: Membrane.RTSP.Response.result()

get_socket(session)

@spec get_socket(t()) :: :gen_tcp.socket()

handle_response(session, raw_response)

@spec handle_response(t(), binary()) :: :ok

options(session, headers \\ [])

@spec options(t(), headers()) :: Membrane.RTSP.Response.result()

pause(session, headers \\ [])

@spec pause(t(), headers()) :: Membrane.RTSP.Response.result()

play(session, headers \\ [])

@spec play(t(), headers()) :: Membrane.RTSP.Response.result()

record(session, headers \\ [])

@spec record(t(), headers()) :: Membrane.RTSP.Response.result()

request(session, method, headers \\ [], body \\ "", path \\ nil)

@spec request(pid(), binary(), headers(), binary(), nil | binary()) ::
  Membrane.RTSP.Response.result()

set_parameter(session, headers \\ [], body \\ "")

@spec set_parameter(t(), headers(), binary()) :: Membrane.RTSP.Response.result()

setup(session, path, headers \\ [])

@spec setup(t(), binary(), headers()) :: Membrane.RTSP.Response.result()

start(url, options \\ [])

@spec start(binary() | URI.t(), Keyword.t()) :: GenServer.on_start()

Same as start_link/2, but doesn't link the session process.

start_link(url, options \\ [])

@spec start_link(binary() | URI.t(), options()) :: GenServer.on_start()

Starts and links session process with given URL as a base path for requests.

teardown(session, headers \\ [])

@spec teardown(t(), headers()) :: Membrane.RTSP.Response.result()

transfer_socket_control(session, new_controlling_process)

@spec transfer_socket_control(t(), pid()) ::
  :ok | {:error, :closed | :not_owner | :badarg | :inet.posix()}

Transfer the control of the TCP socket the session was using to a new process. For more information see :gen_tcp.controlling_process/2. From now on the session won't try to receive responses to requests from the socket, since now an other process is controlling it. Instead of this, the session will synchronously wait for the response to be supplied with handle_response/2.

user_agent()

@spec user_agent() :: binary()