Skip to content

Commit af429fc

Browse files
authored
Merge pull request #160 from membraneframework/fix-remove-children
Fix remove_children and end_of_stream
2 parents ed053a5 + 2cfb954 commit af429fc

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
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.24.0"},
18+
{:membrane_rtp_plugin, "~> 0.24.1"},
1919
{:ex_libsrtp, ">= 0.0.0"} # required only if SRTP/SRTCP support is needed
2020
]
2121
end

lib/membrane/rtp/outbound_tracking_serializer.ex

+12
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,18 @@ defmodule Membrane.RTP.OutboundTrackingSerializer do
259259
{[buffer: {:output, buffer}], %{state | any_buffer_sent?: true}}
260260
end
261261

262+
@impl true
263+
def handle_end_of_stream(_pad, ctx, state) do
264+
if ctx.pads
265+
|> Map.values()
266+
|> Enum.filter(&(&1.direction == :input))
267+
|> Enum.all?(& &1.end_of_stream?) do
268+
{[forward: :end_of_stream], state}
269+
else
270+
{[], state}
271+
end
272+
end
273+
262274
@impl true
263275
def handle_parent_notification(:send_stats, ctx, state) do
264276
%{rtcp_output_pad: rtcp_output} = state

lib/membrane/rtp/session_bin.ex

+3-3
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ defmodule Membrane.RTP.SessionBin do
594594
|> Enum.map(&{&1, ref})
595595
|> Enum.filter(&Map.has_key?(ctx.children, &1))
596596

597-
{[remove_child: children], state}
597+
{[remove_children: children], state}
598598
end
599599

600600
@impl true
@@ -608,7 +608,7 @@ defmodule Membrane.RTP.SessionBin do
608608
_other -> []
609609
end)
610610

611-
{[remove_child: to_remove], state}
611+
{[remove_children: to_remove], state}
612612
end
613613

614614
@impl true
@@ -627,7 +627,7 @@ defmodule Membrane.RTP.SessionBin do
627627
child && not child.terminating?
628628
end)
629629

630-
{[remove_child: to_remove], state}
630+
{[remove_children: to_remove], state}
631631
end
632632

633633
@impl true

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.24.0"
4+
@version "0.24.1"
55
@github_url "https://github.com/membraneframework/membrane_rtp_plugin"
66

77
def project do

0 commit comments

Comments
 (0)