Skip to content

Commit

Permalink
Remove no_response functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Noarkhh committed Sep 2, 2024
1 parent 45e821b commit f2f6838
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions lib/membrane_rtsp/rtsp.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ defmodule Membrane.RTSP do
use GenServer

require Logger
alias Hex.State
alias Hex.State
alias Membrane.RTSP.Parser.Request
alias Membrane.RTSP
alias Membrane.RTSP.{Request, Response, Transport}

Expand Down Expand Up @@ -73,12 +70,6 @@ defmodule Membrane.RTSP do
GenServer.call(session, {:execute, request}, :infinity)
end

@spec request_no_response(pid(), binary(), RTSP.headers(), binary(), nil | binary()) :: :ok
def request_no_response(session, method, headers \\ [], body \\ "", path \\ nil) do
request = %Request{method: method, headers: headers, body: body, path: path}
GenServer.cast(session, {:execute, request})
end

@spec close(pid()) :: :ok
def close(session), do: GenServer.cast(session, :terminate)

Expand Down Expand Up @@ -106,14 +97,6 @@ defmodule Membrane.RTSP do

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

@spec get_parameter_no_response(t(), headers(), binary()) :: :ok
def get_parameter_no_response(session, headers \\ [], body \\ ""),
do: request_no_response(session, "GET_PARAMETER", headers, body)

@spec play_no_response(t(), headers()) :: :ok
def play_no_response(session, headers \\ []),
do: request_no_response(session, "PLAY", headers, "")

@spec describe(t(), headers()) :: Response.result()
def describe(session, headers \\ []), do: request(session, "DESCRIBE", headers, "")

Expand Down Expand Up @@ -194,31 +177,11 @@ defmodule Membrane.RTSP do
{:reply, socket, state}
end

# @impl true
# def handle_call({:parse_response, raw_response}, _from, state) do
# with {:ok, response, state} <- parse_response(raw_response, state) do
# {:reply, {:ok, response}, state}
# else
# {:error, reason} -> {:reply, {:error, reason}, state}
# end
# end

@impl true
def handle_cast(:terminate, %State{} = state) do
{:stop, :normal, state}
end

# @impl true
# def handle_cast({:execute, request}, %State{cseq: cseq} = state) do
# case execute(request, state, false) do
# :ok ->
# {:noreply, %State{state | cseq: cseq + 1}}

# {:error, reason} ->
# raise "Error executing request #{inspect(request)}, reason: #{inspect(reason)}"
# end
# end

@impl true
def handle_info({:tcp, _socket, data}, state) do
Logger.warning("Received an unexpected packet, ignoring: #{inspect(data)}")
Expand Down

0 comments on commit f2f6838

Please sign in to comment.