Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Rados13 committed Apr 12, 2024
1 parent 78f1c2d commit f028251
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
39 changes: 0 additions & 39 deletions lib/report_parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,36 +62,6 @@ defmodule RecordingConverter.ReportParser do
|> then(fn {actions, _acc} -> actions end)
end

defp generate_unregister_output_actions(track_actions) do
{audio_end_timestamp, video_end_timestamp} = get_audio_and_video_end_timestamp(track_actions)

[
Compositor.schedule_unregister_audio_output(audio_end_timestamp),
Compositor.schedule_unregister_video_output(video_end_timestamp)
]
|> Enum.reject(&is_nil(&1))
end

defp generate_unregister_input_actions(track_actions) do
track_actions
|> Enum.filter(fn {atom, _track, _offset} -> atom == :end end)
|> Enum.map(fn {_atom, track, offset} ->
Compositor.schedule_unregister_input(offset, track.id)
end)
end

defp get_audio_and_video_end_timestamp(track_actions) do
{audio_tracks, video_tracks} =
Enum.split_with(track_actions, fn {_atom, track, _timestamp} ->
track["type"] == "audio"
end)

audio_end_timestamp = calculate_end_timestamp(audio_tracks)
video_end_timestamp = calculate_end_timestamp(video_tracks)

{audio_end_timestamp || video_end_timestamp, video_end_timestamp || audio_end_timestamp}
end

defp calculate_track_duration(track) do
clock_rate_ms = div(track["clock_rate"], 1_000)

Expand All @@ -102,13 +72,4 @@ defmodule RecordingConverter.ReportParser do
|> Membrane.Time.milliseconds()
|> Membrane.Time.as_nanoseconds(:round)
end

defp calculate_end_timestamp(tracks) do
if Enum.count(tracks) > 0 do
{_atom, _video_track, timestamp} = Enum.at(tracks, -1)
timestamp
else
nil
end
end
end
1 change: 0 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"membrane_tcp_plugin": {:hex, :membrane_tcp_plugin, "0.3.0", "6c685e570773102391f66deafc653abf276f3f39f1d247f4fafb0d73aedee834", [:mix], [{:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.3.0", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "54f222fd8bcffd297d0519d7e041708a1d23884414d9ff795e7689ffd082c85e"},
"membrane_tee_plugin": {:hex, :membrane_tee_plugin, "0.12.0", "f94989b4080ef4b7937d74c1a14d3379577c7bd4c6d06e5a2bb41c351ad604d4", [:mix], [{:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "0d61c9ed5e68e5a75d54200e1c6df5739c0bcb52fee0974183ad72446a179887"},
"membrane_telemetry_metrics": {:hex, :membrane_telemetry_metrics, "0.1.0", "cb93d28356b436b0597736c3e4153738d82d2a14ff547f831df7e9051e54fc06", [:mix], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6.1", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "aba28dc8311f70ced95d984509be930fac55857d2d18bffcf768815e627be3f0"},
"membrane_udp_plugin": {:hex, :membrane_udp_plugin, "0.12.0", "f3930a592f975f5aef924ff70b1072e55451de16ec5dce7dd264ecf9d034b9ad", [:mix], [{:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.3.0", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "65e846f7523e443215b6954136971d4f00a8e8f375ef015153daa535ce607769"},
"membrane_video_compositor_plugin": {:git, "https://github.com/membraneframework/membrane_video_compositor_plugin.git", "2315dbf1a8f06d17e98a8f1fe4102bb5c420a109", []},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
Expand Down

0 comments on commit f028251

Please sign in to comment.