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

Commit 2fba296

Browse files
committed
Provide default implementation of default_encoding function
1 parent ca667be commit 2fba296

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/membrane_rtc_engine/endpoints/webrtc/simulcast_config.ex

+10-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ 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
}
20-
defstruct [
21-
:default_encoding,
22-
enabled: false
23-
]
21+
defstruct enabled: false,
22+
default_encoding: &__MODULE__.default_encoding/1
23+
24+
@doc """
25+
Default implementation of `default_encoding` function in `t:t/0`.
26+
27+
Returns nil, which will result in choosing the highest possible encoding.
28+
"""
29+
def default_encoding(_track), do: nil
2430
end

0 commit comments

Comments
 (0)