diff --git a/lib/membrane/core/bin.ex b/lib/membrane/core/bin.ex index 56cd57525..1d5d995f5 100644 --- a/lib/membrane/core/bin.ex +++ b/lib/membrane/core/bin.ex @@ -239,15 +239,15 @@ defmodule Membrane.Core.Bin do {:noreply, state} end - defp do_handle_info(Message.new(:start_diamond_detection), state) do - :ok = Parent.DiamondDetectionController.start_diamond_detection(state) - {:noreply, state} - end - - defp do_handle_info(Message.new(:trigger_diamond_detection), state) do - :ok = __MODULE__.DiamondDetectionController.trigger_diamond_detection(state) - {:noreply, state} - end + # defp do_handle_info(Message.new(:start_diamond_detection), state) do + # :ok = Parent.DiamondDetectionController.start_diamond_detection(state) + # {:noreply, state} + # end + + # defp do_handle_info(Message.new(:trigger_diamond_detection), state) do + # :ok = __MODULE__.DiamondDetectionController.trigger_diamond_detection(state) + # {:noreply, state} + # end defp do_handle_info(Message.new(:child_death, [name, reason]), state) do case Parent.ChildLifeController.handle_child_death(name, reason, state) do diff --git a/lib/membrane/core/bin/diamond_detection_controller.ex b/lib/membrane/core/bin/diamond_detection_controller.ex index 3d964ed01..dd0130bdc 100644 --- a/lib/membrane/core/bin/diamond_detection_controller.ex +++ b/lib/membrane/core/bin/diamond_detection_controller.ex @@ -1,12 +1,12 @@ -defmodule Membrane.Core.Bin.DiamondDetectionController do - @moduledoc false +# defmodule Membrane.Core.Bin.DiamondDetectionController do +# @moduledoc false - require Membrane.Core.Message, as: Message +# require Membrane.Core.Message, as: Message - alias Membrane.Core.Bin.State +# alias Membrane.Core.Bin.State - @spec trigger_diamond_detection(State.t()) :: :ok - def trigger_diamond_detection(state) do - Message.send(state.parent_pid, :trigger_diamond_detection) - end -end +# @spec trigger_diamond_detection(State.t()) :: :ok +# def trigger_diamond_detection(state) do +# Message.send(state.parent_pid, :trigger_diamond_detection) +# end +# end diff --git a/lib/membrane/core/parent/child_life_controller.ex b/lib/membrane/core/parent/child_life_controller.ex index bba8bd501..c571bdf82 100644 --- a/lib/membrane/core/parent/child_life_controller.ex +++ b/lib/membrane/core/parent/child_life_controller.ex @@ -103,9 +103,6 @@ defmodule Membrane.Core.Parent.ChildLifeController do """ @spec handle_spec(ChildrenSpec.t(), Parent.state()) :: Parent.state() | no_return() def handle_spec(spec, state) do - - - spec_ref = make_ref() canonical_spec = make_canonical(spec) @@ -165,22 +162,23 @@ defmodule Membrane.Core.Parent.ChildLifeController do dependent_specs: dependent_specs, awaiting_responses: MapSet.new() }) - |> trigger_diamond_detection() + + # |> trigger_diamond_detection() state = StartupUtils.exec_handle_spec_started(all_children_names, state) proceed_spec_startup(spec_ref, state) end - defp trigger_diamond_detection(state) do - cond do - Component.bin?(state) -> - :ok = Bin.DiamondDetectionController.trigger_diamond_detection(state) - state + # defp trigger_diamond_detection(state) do + # cond do + # Component.bin?(state) -> + # :ok = Bin.DiamondDetectionController.trigger_diamond_detection(state) + # state - Component.pipeline?(state) -> - Pipeline.DiamondDetectionController.trigger_diamond_detection(state) - end - end + # Component.pipeline?(state) -> + # Pipeline.DiamondDetectionController.trigger_diamond_detection(state) + # end + # end defp assert_all_static_pads_linked_in_spec!(children_definitions, links) do pads_to_link = diff --git a/lib/membrane/core/parent/diamond_detection_controller.ex b/lib/membrane/core/parent/diamond_detection_controller.ex index 26e0de871..8c4e4a36c 100644 --- a/lib/membrane/core/parent/diamond_detection_controller.ex +++ b/lib/membrane/core/parent/diamond_detection_controller.ex @@ -1,15 +1,15 @@ -defmodule Membrane.Core.Parent.DiamondDetectionController do - @moduledoc false +# defmodule Membrane.Core.Parent.DiamondDetectionController do +# @moduledoc false - require Membrane.Core.Message, as: Message +# require Membrane.Core.Message, as: Message - alias Membrane.Core.Parent +# alias Membrane.Core.Parent - @spec start_diamond_detection(Parent.state()) :: :ok - def start_diamond_detection(state) do - state.children - |> Enum.each(fn {_child, %{pid: child_pid}} -> - Message.send(child_pid, :start_diamond_detection) - end) - end -end +# @spec start_diamond_detection(Parent.state()) :: :ok +# def start_diamond_detection(state) do +# state.children +# |> Enum.each(fn {_child, %{pid: child_pid}} -> +# Message.send(child_pid, :start_diamond_detection) +# end) +# end +# end diff --git a/lib/membrane/core/pipeline.ex b/lib/membrane/core/pipeline.ex index c29de244a..bb865541e 100644 --- a/lib/membrane/core/pipeline.ex +++ b/lib/membrane/core/pipeline.ex @@ -130,15 +130,15 @@ defmodule Membrane.Core.Pipeline do {:noreply, state} end - defp do_handle_info(Message.new(:start_diamond_detection), state) do - state = __MODULE__.DiamondDetectionController.start_diamond_detection(state) - {:noreply, state} - end - - defp do_handle_info(Message.new(:trigger_diamond_detection), state) do - state = __MODULE__.DiamondDetectionController.trigger_diamond_detection(state) - {:noreply, state} - end + # defp do_handle_info(Message.new(:start_diamond_detection), state) do + # state = __MODULE__.DiamondDetectionController.start_diamond_detection(state) + # {:noreply, state} + # end + + # defp do_handle_info(Message.new(:trigger_diamond_detection), state) do + # state = __MODULE__.DiamondDetectionController.trigger_diamond_detection(state) + # {:noreply, state} + # end defp do_handle_info(Message.new(:initialized, child), state) do state = ChildLifeController.handle_child_initialized(child, state) diff --git a/lib/membrane/core/pipeline/diamond_detection_controller.ex b/lib/membrane/core/pipeline/diamond_detection_controller.ex index a63bbceca..8a8e352e2 100644 --- a/lib/membrane/core/pipeline/diamond_detection_controller.ex +++ b/lib/membrane/core/pipeline/diamond_detection_controller.ex @@ -1,27 +1,27 @@ -defmodule Membrane.Core.Pipeline.DiamondDetectionController do - @moduledoc false +# defmodule Membrane.Core.Pipeline.DiamondDetectionController do +# @moduledoc false - require Membrane.Core.Message, as: Message +# require Membrane.Core.Message, as: Message - alias Membrane.Core.Parent - alias Membrane.Core.Pipeline.State +# alias Membrane.Core.Parent +# alias Membrane.Core.Pipeline.State - @spec trigger_diamond_detection(State.t()) :: State.t() - def trigger_diamond_detection(%State{} = state) when state.diamond_detection_triggered? do - state - end +# @spec trigger_diamond_detection(State.t()) :: State.t() +# def trigger_diamond_detection(%State{} = state) when state.diamond_detection_triggered? do +# state +# end - def trigger_diamond_detection(%State{} = state) do - message = Message.new(:start_diamond_detection) - send_after_timeout = Membrane.Time.second() |> Membrane.Time.as_milliseconds(:round) - self() |> Process.send_after(message, send_after_timeout) +# def trigger_diamond_detection(%State{} = state) do +# message = Message.new(:start_diamond_detection) +# send_after_timeout = Membrane.Time.second() |> Membrane.Time.as_milliseconds(:round) +# self() |> Process.send_after(message, send_after_timeout) - %{state | diamond_detection_triggered?: true} - end +# %{state | diamond_detection_triggered?: true} +# end - @spec start_diamond_detection(State.t()) :: State.t() - def start_diamond_detection(%State{} = state) do - :ok = Parent.DiamondDetectionController.start_diamond_detection(state) - %{state | diamond_detection_triggered?: false} - end -end +# @spec start_diamond_detection(State.t()) :: State.t() +# def start_diamond_detection(%State{} = state) do +# :ok = Parent.DiamondDetectionController.start_diamond_detection(state) +# %{state | diamond_detection_triggered?: false} +# end +# end diff --git a/lib/membrane/core/pipeline/state.ex b/lib/membrane/core/pipeline/state.ex index bd50663e2..85118aa70 100644 --- a/lib/membrane/core/pipeline/state.ex +++ b/lib/membrane/core/pipeline/state.ex @@ -34,8 +34,8 @@ defmodule Membrane.Core.Pipeline.State do setup_incomplete?: boolean(), stalker: Membrane.Core.Stalker.t(), subprocess_supervisor: pid(), - awaiting_setup_completition?: boolean(), - diamond_detection_triggered?: boolean() + awaiting_setup_completition?: boolean() + # diamond_detection_triggered?: boolean() } # READ THIS BEFORE ADDING NEW FIELD!!! @@ -59,7 +59,7 @@ defmodule Membrane.Core.Pipeline.State do stalker: nil, resource_guard: nil, subprocess_supervisor: nil, - awaiting_setup_completition?: false, - diamond_detection_triggered?: false + awaiting_setup_completition?: false + # diamond_detection_triggered?: false end