-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Comment out triggering diamond detection in parents
- Loading branch information
1 parent
a58b363
commit 5a76b10
Showing
7 changed files
with
75 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 21 additions & 21 deletions
42
lib/membrane/core/pipeline/diamond_detection_controller.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters