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

Commit 4f7e44d

Browse files
committed
Provide default implementation of default_encoding function
1 parent ca667be commit 4f7e44d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/membrane_rtc_engine/endpoints/webrtc/simulcast_config.ex

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ defmodule Membrane.RTC.Engine.Endpoint.WebRTC.SimulcastConfig do
1212
* `default_encoding` - function used to determine initial encoding
1313
this endpoint is willing to receive for given track.
1414
It is called for each track this endpoint subscribes for.
15+
If not provided, the highest possible encoding will be used.
1516
"""
1617
@type t() :: %__MODULE__{
1718
enabled: boolean(),
1819
default_encoding: (Track.t() -> String.t())
1920
}
2021
defstruct [
21-
:default_encoding,
22-
enabled: false
22+
enabled: false,
23+
default_encoding: &__MODULE__.default_encoding/1
2324
]
25+
26+
@doc """
27+
Default implementation of `default_encoding` function in `t:t/0`.
28+
29+
Returns nil, which will result in choosing the highest possible encoding.
30+
"""
31+
def default_encoding(_track), do: nil
2432
end

0 commit comments

Comments
 (0)