Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
Update RTP plugin to RTX Enabled version
Browse files Browse the repository at this point in the history
  • Loading branch information
bblaszkow06 committed Jan 31, 2023
1 parent 5eefd91 commit 364651d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
23 changes: 13 additions & 10 deletions lib/membrane_rtc_engine/endpoints/webrtc_endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ defmodule Membrane.RTC.Engine.Endpoint.WebRTC do
],
filter_codecs: [
spec: ({RTPMapping.t(), FMTP.t() | nil} -> boolean()),
default: &SDP.filter_mappings(&1),
default: &SDP.filter_encodings(&1),
description: "Defines function which will filter SDP m-line by codecs"
],
log_metadata: [
Expand Down Expand Up @@ -287,8 +287,6 @@ defmodule Membrane.RTC.Engine.Endpoint.WebRTC do
handshake_opts: state.handshake_opts,
log_metadata: log_metadata,
filter_codecs: state.filter_codecs,
inbound_tracks: [],
outbound_tracks: [],
direction: state.direction,
extensions: state.webrtc_extensions || [],
integrated_turn_options: state.integrated_turn_options,
Expand Down Expand Up @@ -373,7 +371,7 @@ defmodule Membrane.RTC.Engine.Endpoint.WebRTC do

@impl true
def handle_child_notification(
{:new_track, track_id, rid, encoding, _depayloading_filter},
{:new_track, track_id, rid, ssrc, encoding, _depayloading_filter},
_from,
_ctx,
state
Expand All @@ -396,7 +394,7 @@ defmodule Membrane.RTC.Engine.Endpoint.WebRTC do

variant = to_track_variant(rid)

{[notify_parent: {:track_ready, track_id, variant, encoding}], state}
{[notify_parent: {:track_ready, track_id, ssrc, variant, encoding}], state}
end

@impl true
Expand Down Expand Up @@ -880,15 +878,15 @@ defmodule Membrane.RTC.Engine.Endpoint.WebRTC do
track.type,
track.stream_id,
origin,
track.encoding,
track.rtp_mapping.clock_rate,
track.fmtp,
track.selected_encoding_key,
track.selected_encoding.clock_rate,
track.selected_encoding.format_params,
id: track.id,
variants: variants,
active?: track.status != :disabled,
metadata: metadata,
ctx: %{extension_key => track.extmaps},
payload_type: track.rtp_mapping.payload_type
payload_type: track.selected_encoding.payload_type
)
end

Expand All @@ -902,7 +900,12 @@ defmodule Membrane.RTC.Engine.Endpoint.WebRTC do
defp to_keyword_list(%Engine.Track{} = struct),
do: Map.from_struct(struct) |> to_keyword_list()

defp to_keyword_list(%{} = map), do: Enum.map(map, fn {key, value} -> {key, value} end)
defp to_keyword_list(%{} = map) do
Enum.map(map, fn
{:encoding, value} -> {:selected_encoding_key, value}
{key, value} -> {key, value}
end)
end

defp to_track_variant(rid) when rid in ["h", nil], do: :high
defp to_track_variant("m"), do: :medium
Expand Down
4 changes: 2 additions & 2 deletions lib/membrane_rtc_engine/engine.ex
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,13 @@ defmodule Membrane.RTC.Engine do
end

defp handle_endpoint_notification(
{:track_ready, track_id, variant, encoding},
{:track_ready, track_id, ssrc, variant, encoding},
endpoint_id,
_ctx,
state
) do
Membrane.Logger.info(
"New incoming #{encoding} track #{track_id} (variant: #{variant}) from endpoint #{inspect(endpoint_id)}"
"New incoming #{encoding} track #{track_id} (ssrc: #{ssrc} variant: #{variant}) from endpoint #{inspect(endpoint_id)}"
)

track = get_in(state, [:endpoints, endpoint_id]) |> Endpoint.get_track_by_id(track_id)
Expand Down
7 changes: 6 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ defmodule Membrane.RTC.Engine.MixProject do
{:membrane_opentelemetry, "~> 0.1.0"},
{:membrane_core, "~> 0.11.2"},
{:membrane_telemetry_metrics, "~> 0.1.0"},
{:membrane_webrtc_plugin, github: "membraneframework/membrane_webrtc_plugin"},
{:membrane_webrtc_plugin,
github: "membraneframework/membrane_webrtc_plugin", branch: "MV-100-handle-rtx"},
{:membrane_rtp_plugin,
github: "membraneframework/membrane_rtp_plugin",
branch: "RTC-112-outbound-rtx-v2",
override: true},
{:membrane_rtp_format, "~> 0.6.0"},
{:membrane_rtp_vp8_plugin, "~> 0.7.0"},
{:membrane_rtp_opus_plugin, "~> 0.7.0"},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"ex_doc": {:hex, :ex_doc, "0.28.3", "6eea2f69995f5fba94cd6dd398df369fe4e777a47cd887714a0976930615c9e6", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "05387a6a2655b5f9820f3f627450ed20b4325c25977b2ee69bed90af6688e718"},
"ex_dtls": {:hex, :ex_dtls, "0.11.1", "1c4d9e235cd17f688e99b8359da45d132ad52ec91d18d0bac4d3d741cc35f7b8", [:mix], [{:unifex, "~> 1.0", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "249443c51aea5e9560f791cf023d0454533a7ea3efe70b3cb3956d7871147295"},
"ex_libsrtp": {:hex, :ex_libsrtp, "0.5.1", "fd3ff4a4ce0b197e5b750d3f153e865a1f5a7e6092e69f0b6dbf85e4a537e2a9", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:unifex, "~> 1.0", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "2c7b3af06455460f1f9f91b943b8a1a9680cece4e3a32fa81082035f6617cb63"},
"ex_sdp": {:hex, :ex_sdp, "0.8.0", "b9bb7cd398e8ba26a16751d2ccaf148a96109da48806d4bdadfe292c54960214", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}], "hexpm", "5170471318e3f8970c3456cda2f4b9305e7cc8b082ea507e22c1aaae0fa55ebf"},
"ex_sdp": {:hex, :ex_sdp, "0.9.0", "271f9a8dc30119c55f10a98d1de3536e3b8f47046edc23d2da1c75ae5e9399a6", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}], "hexpm", "1fb5ad7a59991ee81781115f9fa02553a74c6893d7d47ef932888da3774a66ed"},
"excoveralls": {:hex, :excoveralls, "0.15.1", "83c8cf7973dd9d1d853dce37a2fb98aaf29b564bf7d01866e409abf59dac2c0e", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "f8416bd90c0082d56a2178cf46c837595a06575f70a5624f164a1ffe37de07e7"},
"fake_turn": {:hex, :fake_turn, "0.2.5", "f0e455bfa254e98c3105744f2cfbea44f2365d2a23577cf10f849f1d65660346", [:rebar3], [{:fast_tls, "1.1.13", [hex: :fast_tls, repo: "hexpm", optional: false]}, {:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "79ea24737330df1958d20bd226f6d889c05765447e163446545555b7024c3647"},
"fast_tls": {:hex, :fast_tls, "1.1.13", "828cdc75e1e8fce8158846d2b971d8b4fe2b2ddcc75b759e88d751079bf78afd", [:rebar3], [{:p1_utils, "1.0.23", [hex: :p1_utils, repo: "hexpm", optional: false]}], "hexpm", "d1f422af40c7777fe534496f508ee86515cb929ad10f7d1d56aa94ce899b44a0"},
Expand Down

0 comments on commit 364651d

Please sign in to comment.