AirPlay.V2.Rtsp2 (AirPlay v0.4.6)

Copy Markdown View Source

RTSP client for AirPlay 2.

Starts as ordinary RTSP for /pair-setup, then can be upgraded to the AP2 ChaCha20-Poly1305 secure channel after transient pairing succeeds.

Summary

Types

t()

@type t() :: %AirPlay.V2.Rtsp2{
  cipher_buffer: term(),
  cseq: term(),
  host: term(),
  plain_buffer: term(),
  port: term(),
  rtsp_session: term(),
  secure: term(),
  session_id: term(),
  sock: term()
}

Functions

close(rtsp2)

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

connect(host, port \\ 7000)

@spec connect(String.t(), :inet.port_number()) :: {:ok, t()} | {:error, term()}

enable_encryption(state, shared_secret)

@spec enable_encryption(t(), binary()) :: t()

parse(buffer)

@spec parse(binary()) :: {:ok, non_neg_integer(), map(), binary(), binary()} | :more

Parse a buffered RTSP response, returning :more until the body is complete.

request(state, method, path, headers \\ [], body \\ <<>>)

@spec request(t(), String.t(), String.t(), list(), binary()) ::
  {:ok, non_neg_integer(), map(), binary(), t()} | {:error, term()}

session_url(state)

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