From 45f99bde6d6f07b189bcce87fdcd7d3ca68986a4 Mon Sep 17 00:00:00 2001 From: "feliks.pobiedzinski@swmansion.com" Date: Tue, 19 Nov 2024 12:04:49 +0100 Subject: [PATCH 1/2] Rename ForwardingFilter to Connector --- CHANGELOG.md | 2 +- lib/membrane/forwarding_filter.ex | 2 +- ...rwarding_filter_test.exs => connector_test.exs} | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) rename test/membrane/integration/{forwarding_filter_test.exs => connector_test.exs} (88%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95f8c125c..04d410f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.2.0 * Add `:max_instances` option for dynamic pads. [#876](https://github.com/membraneframework/membrane_core/pull/876) - * Implement `Membrane.ForwardingFilter`. [#904](https://github.com/membraneframework/membrane_core/pull/904) + * Implement `Membrane.Connector`. [#904](https://github.com/membraneframework/membrane_core/pull/904) ## 1.1.2 * Add new callback `handle_child_terminated/3` along with new assertions. [#894](https://github.com/membraneframework/membrane_core/pull/894) diff --git a/lib/membrane/forwarding_filter.ex b/lib/membrane/forwarding_filter.ex index e7fc680a2..714a731c3 100644 --- a/lib/membrane/forwarding_filter.ex +++ b/lib/membrane/forwarding_filter.ex @@ -1,4 +1,4 @@ -defmodule Membrane.ForwardingFilter do +defmodule Membrane.Connector do @moduledoc """ Membrane Filter with input and output dynamic pads, that forwards incoming data to the opposite side than the one from which it came. diff --git a/test/membrane/integration/forwarding_filter_test.exs b/test/membrane/integration/connector_test.exs similarity index 88% rename from test/membrane/integration/forwarding_filter_test.exs rename to test/membrane/integration/connector_test.exs index 607a419c7..cb8f39dab 100644 --- a/test/membrane/integration/forwarding_filter_test.exs +++ b/test/membrane/integration/connector_test.exs @@ -1,11 +1,11 @@ -defmodule Membrane.Integration.ForwardingFilterTest do +defmodule Membrane.Integration.ConnectorTest do use ExUnit.Case, async: true import Membrane.ChildrenSpec import Membrane.Testing.Assertions alias Membrane.Buffer - alias Membrane.ForwardingFilter + alias Membrane.Connector alias Membrane.Testing require Membrane.Pad, as: Pad @@ -23,12 +23,12 @@ defmodule Membrane.Integration.ForwardingFilterTest do do: {[{action, {:output, item}}], state} end - test "Membrane.ForwardingFilter buffers data until output pad is linked" do + test "Membrane.Connector buffers data until output pad is linked" do pipeline = Testing.Pipeline.start_link_supervised!( spec: child(:source, Source) - |> child(:filter, %ForwardingFilter{ + |> child(:connector, %Connector{ notify_on_event?: true, notify_on_stream_format?: true }) @@ -75,7 +75,7 @@ defmodule Membrane.Integration.ForwardingFilterTest do Testing.Pipeline.terminate(pipeline) end - test "Membrane.ForwardingFilter pauses input demand if output pad is not linked" do + test "Membrane.Connector pauses input demand if output pad is not linked" do atomics_ref = :atomics.new(1, []) :atomics.put(atomics_ref, 1, 0) @@ -90,7 +90,7 @@ defmodule Membrane.Integration.ForwardingFilterTest do spec = child(:source, %Testing.Source{output: {nil, generator}}) |> via_in(:input, auto_demand_size: auto_demand_size) - |> child(:forwarding_filter, ForwardingFilter) + |> child(:connector, Connector) pipeline = Testing.Pipeline.start_link_supervised!(spec: spec) @@ -98,7 +98,7 @@ defmodule Membrane.Integration.ForwardingFilterTest do assert :atomics.get(atomics_ref, 1) == auto_demand_size - spec = get_child(:forwarding_filter) |> child(:sink, Testing.Sink) + spec = get_child(:connector) |> child(:sink, Testing.Sink) Testing.Pipeline.execute_actions(pipeline, spec: spec) Process.sleep(500) From 54313bb90c44994d4245d629da539d2c0f150be0 Mon Sep 17 00:00:00 2001 From: "feliks.pobiedzinski@swmansion.com" Date: Wed, 20 Nov 2024 19:13:37 +0100 Subject: [PATCH 2/2] Fix test, rename file --- lib/membrane/{forwarding_filter.ex => connector.ex} | 0 test/membrane/integration/connector_test.exs | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename lib/membrane/{forwarding_filter.ex => connector.ex} (100%) diff --git a/lib/membrane/forwarding_filter.ex b/lib/membrane/connector.ex similarity index 100% rename from lib/membrane/forwarding_filter.ex rename to lib/membrane/connector.ex diff --git a/test/membrane/integration/connector_test.exs b/test/membrane/integration/connector_test.exs index cb8f39dab..cc6b7102e 100644 --- a/test/membrane/integration/connector_test.exs +++ b/test/membrane/integration/connector_test.exs @@ -41,11 +41,11 @@ defmodule Membrane.Integration.ConnectorTest do Testing.Pipeline.notify_child(pipeline, :source, {type, item}) if type in [:stream_format, :event] do - assert_pipeline_notified(pipeline, :filter, {^type, Pad.ref(:input, _id), ^item}) + assert_pipeline_notified(pipeline, :connector, {^type, Pad.ref(:input, _id), ^item}) end end) - spec = get_child(:filter) |> child(:sink, Testing.Sink) + spec = get_child(:connector) |> child(:sink, Testing.Sink) Testing.Pipeline.execute_actions(pipeline, spec: spec) data @@ -62,7 +62,7 @@ defmodule Membrane.Integration.ConnectorTest do Testing.Pipeline.notify_child(pipeline, :source, {type, item}) if type in [:stream_format, :event] do - assert_pipeline_notified(pipeline, :filter, {^type, Pad.ref(:input, _id), ^item}) + assert_pipeline_notified(pipeline, :connector, {^type, Pad.ref(:input, _id), ^item}) end case type do