-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
151 additions
and
36 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
defmodule ExWebRTC.PeerConnection.Configuration do | ||
@moduledoc false | ||
|
||
@type bundle_policy() :: | ||
:balanced | ||
| :max_compat | ||
| :max_bundle | ||
|
||
@type ice_transport_policy() :: | ||
:all | ||
| :relay | ||
|
||
@type rtcp_mux_policy() :: | ||
:negotiate | ||
| :require | ||
|
||
@type t() :: %__MODULE__{ | ||
bundle_policy: bundle_policy(), | ||
# TODO certs type | ||
certificates: term(), | ||
ice_candidate_pool_size: non_neg_integer(), | ||
ice_servers: [String.t()], | ||
ice_transport_policy: ice_transport_policy(), | ||
peer_identity: String.t(), | ||
rtcp_mux_policy: rtcp_mux_policy() | ||
} | ||
|
||
defstruct bundle_policy: :balanced, | ||
certificates: nil, | ||
ice_candidate_pool_size: 0, | ||
ice_servers: [], | ||
ice_transport_policy: :all, | ||
peer_identity: nil, | ||
rtcp_mux_policy: :require | ||
|
||
@spec check_support(t()) :: :ok | ||
def check_support(config) do | ||
if config.ice_transport_policy != :all do | ||
raise "#{inspect(config.ice_transport_policy)} ice transport policy is currently not supported" | ||
end | ||
|
||
if config.ice_candidate_pool_size != 0 do | ||
raise "Ice candidate pool size different than 0 (pre-gathering) is currently not supported" | ||
end | ||
|
||
if config.bundle_policy != :max_bundle do | ||
raise "Bundle policy options different than :max_bundle are currently not supported" | ||
end | ||
|
||
if config.certificates != nil do | ||
raise "Certificates configuration option is currently not supported" | ||
end | ||
|
||
if config.peer_identity != nil do | ||
raise "Identify option is currently not supported" | ||
end | ||
|
||
if config.rtcp_mux_policy != :require do | ||
raise "RTCP mux policy option :negotiate is currently not supported" | ||
end | ||
|
||
:ok | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
defmodule ExWebRTC.PeerConnection.SignalingState do | ||
@moduledoc false | ||
|
||
@type t() :: | ||
:stable | ||
| :have_local_offer | ||
| :have_remote_offer | ||
| :have_local_pranswer | ||
| :have_remote_pranswer | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
defmodule ExWebRTC.PeerConnection.Transceiver do | ||
@moduledoc false | ||
|
||
@type kind() :: | ||
:audio | ||
| :video | ||
|
||
@type direction() :: | ||
:sendrecv | ||
| :sendonly | ||
| :recvonly | ||
| :inactive | ||
| :stopped | ||
|
||
@type options() :: [ | ||
direction | ||
] | ||
|
||
# @type t() :: %__MODULE__{ | ||
# mid: String.t() | nil, | ||
# current_direction: direction() | nil, | ||
# direction: direction(), | ||
# receiver: term(), | ||
# sender: term(), | ||
# send_encodings: term(), | ||
# streams: term() | ||
# } | ||
# | ||
# @enforce_keys [:direction] | ||
# defstruct @enforce_keys ++ [:mid, :current_direction] | ||
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