Skip to content

Commit b4da9df

Browse files
authored
Remove RTP extensions on removing SessionBin's output pad (#154)
1 parent d8840e6 commit b4da9df

File tree

10 files changed

+26
-33
lines changed

10 files changed

+26
-33
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The package can be installed by adding `membrane_rtp_plugin` to your list of dep
1515
```elixir
1616
def deps do
1717
[
18-
{:membrane_rtp_plugin, "~> 0.23.0"},
18+
{:membrane_rtp_plugin, "~> 0.23.1"},
1919
{:ex_libsrtp, "~> 0.6.0"} # required only if SRTP/SRTCP support is needed
2020
]
2121
end

lib/membrane/rtcp/parser.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defmodule Membrane.RTCP.Parser do
4545
{actions, state}
4646

4747
{:error, reason} ->
48-
Membrane.Logger.warn("""
48+
Membrane.Logger.warning("""
4949
Couldn't parse rtcp packet:
5050
#{inspect(payload, limit: :infinity)}
5151
Reason: #{inspect(reason)}. Ignoring packet.
@@ -133,7 +133,7 @@ defmodule Membrane.RTCP.Parser do
133133
end
134134

135135
defp process_rtcp(unknown_packet, metadata) do
136-
Membrane.Logger.warn("""
136+
Membrane.Logger.warning("""
137137
Unhandled RTCP packet
138138
#{inspect(unknown_packet, pretty: true, limit: :infinity)}
139139
#{inspect(metadata, pretty: true)}

lib/membrane/rtp/inbound_packet_tracker.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ defmodule Membrane.RTP.InboundPacketTracker do
8282
if abs(delta) > @max_diff do
8383
# The gap is too big, we consider this packet to be malformed
8484
# Ignore it
85-
Membrane.Logger.warn(
85+
Membrane.Logger.warning(
8686
"Dropping packet #{seq_num} with big sequence number difference (#{delta})"
8787
)
8888

lib/membrane/rtp/rtx_parser.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ defmodule Membrane.RTP.RTXParser do
7979
def handle_process(:input, %Buffer{payload: payload, metadata: metadata}, _ctx, state) do
8080
# Ignore empty buffers, most likely used for bandwidth estimation
8181
if byte_size(payload) > 0 do
82-
Membrane.Logger.warn(
82+
Membrane.Logger.warning(
8383
"Received invalid RTX buffer with sequence_number #{metadata.rtp.sequence_number}"
8484
)
8585
end

lib/membrane/rtp/session_bin.ex

+3-10
Original file line numberDiff line numberDiff line change
@@ -609,16 +609,9 @@ defmodule Membrane.RTP.SessionBin do
609609
state = %{state | ssrcs: Map.delete(state.ssrcs, ssrc)}
610610

611611
to_remove =
612-
[
613-
:rtx_funnel,
614-
:rtx,
615-
:rtx_decryptor,
616-
:stream_receive_bin
617-
]
618-
|> Enum.map(&{&1, ssrc})
619-
|> Enum.filter(fn name ->
620-
child = Map.get(ctx.children, name)
621-
child && not child.terminating?
612+
Enum.flat_map(ctx.children, fn
613+
{{name, ^ssrc}, %{terminating?: false}} -> [{name, ssrc}]
614+
_other -> []
622615
end)
623616

624617
{[remove_child: to_remove], state}

lib/membrane/srtcp/decryptor.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ if Code.ensure_loaded?(ExLibSRTP) do
7979

8080
@impl true
8181
def handle_event(_pad, %SRTP.KeyingMaterialEvent{}, _ctx, state) do
82-
Membrane.Logger.warn("Got unexpected SRTP.KeyingMaterialEvent. Ignoring.")
82+
Membrane.Logger.warning("Got unexpected SRTP.KeyingMaterialEvent. Ignoring.")
8383
{[], state}
8484
end
8585

lib/membrane/srtp/decryptor.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ if Code.ensure_loaded?(ExLibSRTP) do
7373

7474
@impl true
7575
def handle_event(_pad, %SRTP.KeyingMaterialEvent{}, _ctx, state) do
76-
Membrane.Logger.warn("Got unexpected SRTP.KeyingMaterialEvent. Ignoring.")
76+
Membrane.Logger.warning("Got unexpected SRTP.KeyingMaterialEvent. Ignoring.")
7777
{[], state}
7878
end
7979

lib/membrane/srtp/encryptor.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if Code.ensure_loaded?(ExLibSRTP) do
8989

9090
@impl true
9191
def handle_event(_pad, %SRTP.KeyingMaterialEvent{}, _ctx, state) do
92-
Membrane.Logger.warn("Got unexpected SRTP.KeyingMaterialEvent. Ignoring.")
92+
Membrane.Logger.warning("Got unexpected SRTP.KeyingMaterialEvent. Ignoring.")
9393
{[], state}
9494
end
9595

@@ -124,7 +124,7 @@ if Code.ensure_loaded?(ExLibSRTP) do
124124
raise "Failed to protect #{inspect(packet_type)} due to unhandled error #{reason}"
125125

126126
{:error, reason} ->
127-
Membrane.Logger.warn("Ignoring #{inspect(packet_type)} packet due to `#{reason}`")
127+
Membrane.Logger.warning("Ignoring #{inspect(packet_type)} packet due to `#{reason}`")
128128
[]
129129
end
130130
end

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.RTP.Plugin.MixProject do
22
use Mix.Project
33

4-
@version "0.23.0"
4+
@version "0.23.1"
55
@github_url "https://github.com/membraneframework/membrane_rtp_plugin"
66

77
def project do

mix.lock

+13-13
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)