Skip to content

Commit

Permalink
Merge pull request #160 from membraneframework/fix-remove-children
Browse files Browse the repository at this point in the history
Fix remove_children and end_of_stream
  • Loading branch information
mat-hek authored Nov 27, 2023
2 parents ed053a5 + 2cfb954 commit af429fc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The package can be installed by adding `membrane_rtp_plugin` to your list of dep
```elixir
def deps do
[
{:membrane_rtp_plugin, "~> 0.24.0"},
{:membrane_rtp_plugin, "~> 0.24.1"},
{:ex_libsrtp, ">= 0.0.0"} # required only if SRTP/SRTCP support is needed
]
end
Expand Down
12 changes: 12 additions & 0 deletions lib/membrane/rtp/outbound_tracking_serializer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,18 @@ defmodule Membrane.RTP.OutboundTrackingSerializer do
{[buffer: {:output, buffer}], %{state | any_buffer_sent?: true}}
end

@impl true
def handle_end_of_stream(_pad, ctx, state) do
if ctx.pads
|> Map.values()
|> Enum.filter(&(&1.direction == :input))
|> Enum.all?(& &1.end_of_stream?) do
{[forward: :end_of_stream], state}
else
{[], state}
end
end

@impl true
def handle_parent_notification(:send_stats, ctx, state) do
%{rtcp_output_pad: rtcp_output} = state
Expand Down
6 changes: 3 additions & 3 deletions lib/membrane/rtp/session_bin.ex
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ defmodule Membrane.RTP.SessionBin do
|> Enum.map(&{&1, ref})
|> Enum.filter(&Map.has_key?(ctx.children, &1))

{[remove_child: children], state}
{[remove_children: children], state}
end

@impl true
Expand All @@ -608,7 +608,7 @@ defmodule Membrane.RTP.SessionBin do
_other -> []
end)

{[remove_child: to_remove], state}
{[remove_children: to_remove], state}
end

@impl true
Expand All @@ -627,7 +627,7 @@ defmodule Membrane.RTP.SessionBin do
child && not child.terminating?
end)

{[remove_child: to_remove], state}
{[remove_children: to_remove], state}
end

@impl true
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.RTP.Plugin.MixProject do
use Mix.Project

@version "0.24.0"
@version "0.24.1"
@github_url "https://github.com/membraneframework/membrane_rtp_plugin"

def project do
Expand Down

0 comments on commit af429fc

Please sign in to comment.