Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/plain_transport.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ defmodule Mediasoup.PlainTransport do
| listen_ip: nil,
port: nil,
listen_info:
Map.get(option, :listen_info) || TransportListenInfo.create(listen_ip, "udp", port),
Map.get(option, :listen_info) ||
TransportListenInfo.create(listen_ip, "udp", port),
rtcp_listen_info:
Map.get(option, :rtcp_listen_info) ||
TransportListenInfo.create(listen_ip, "udp", nil)
Expand Down
24 changes: 21 additions & 3 deletions lib/transport_listen_info.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,28 @@ defmodule Mediasoup.TransportListenInfo do
@type t :: %{
:ip => String.t(),
:protocol => :tcp | :udp,
:exposeInternalIp => boolean(),
optional(:announcedAddress) => String.t() | nil,
optional(:port) => integer(),
optional(:portRange) => map(),
optional(:flags) => map(),
optional(:sendBufferSize) => integer(),
optional(:recvBufferSize) => integer()
}

@enforce_keys [:ip, :protocol]

defstruct [:ip, :protocol, :announcedAddress, :port, :sendBufferSize, :recvBufferSize]
defstruct [
:ip,
:protocol,
:announcedAddress,
:exposeInternalIp,
:port,
:portRange,
:flags,
:sendBufferSize,
:recvBufferSize
]

def normalize_listen_ip(ip) when is_binary(ip) do
%{:ip => ip}
Expand All @@ -43,7 +56,11 @@ defmodule Mediasoup.TransportListenInfo do
@spec create(binary() | %{:ip => any(), optional(any()) => any()}, any()) :: struct()
def create(ip, protocol) do
listen_ip = normalize_listen_ip(ip)
struct(__MODULE__, Map.merge(listen_ip, %{:protocol => protocol}))

struct(
__MODULE__,
Map.merge(listen_ip, %{:protocol => protocol, :exposeInternalIp => false})
)
end

def create(ip, protocol, port) do
Expand All @@ -53,7 +70,8 @@ defmodule Mediasoup.TransportListenInfo do
__MODULE__,
Map.merge(listen_ip, %{
:protocol => protocol,
:port => port
:port => port,
:exposeInternalIp => false
})
)
end
Expand Down
1 change: 1 addition & 0 deletions lib/webrtc_server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ defmodule Mediasoup.WebRtcServer do
@type webrtc_server_listen_info :: %{
:protocol => :udp | :tcp,
:ip => String.t(),
:exposeInternalIp => boolean(),
optional(:announcedAddress) => String.t() | nil,
optional(:announcedIp) => String.t() | nil,
optional(:port) => integer() | nil
Expand Down
3 changes: 2 additions & 1 deletion lib/webrtc_transport.ex
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ defmodule Mediasoup.WebRtcTransport do
protocol: protocol,
ip: listen_ip.ip,
announcedAddress: listen_ip[:announcedAddress],
port: port
port: port,
exposeInternalIp: listen_ip[:exposeInternalIp] || false
}
end)
end)
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule MediasoupElixir.MixProject do
use Mix.Project

@version "0.16.0"
@version "0.17.0"
@repo "https://github.com/oviceinc/mediasoup-elixir"
@description """
Elixir wrapper for mediasoup
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"castore": {:hex, :castore, "1.0.14", "4582dd7d630b48cf5e1ca8d3d42494db51e406b7ba704e81fbd401866366896a", [], [], "hexpm", "7bc1b65249d31701393edaaac18ec8398d8974d52c647b7904d01b964137b9f4"},
"castore": {:hex, :castore, "1.0.14", "4582dd7d630b48cf5e1ca8d3d42494db51e406b7ba704e81fbd401866366896a", [:mix], [], "hexpm", "7bc1b65249d31701393edaaac18ec8398d8974d52c647b7904d01b964137b9f4"},
"credo": {:hex, :credo, "1.7.12", "9e3c20463de4b5f3f23721527fcaf16722ec815e70ff6c60b86412c695d426c1", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8493d45c656c5427d9c729235b99d498bd133421f3e0a683e5c1b561471291e5"},
"dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
"earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
Expand Down
56 changes: 45 additions & 11 deletions native/mediasoup_elixir/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions native/mediasoup_elixir/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mediasoup_elixir"
version = "3.14.2"
version = "3.18.1"
authors = []
edition = "2021"

Expand All @@ -11,7 +11,7 @@ crate-type = ["cdylib"]

[dependencies]
rustler = { version = "0.36.0", default-features = false, features = ["serde"] }
mediasoup = "0.18.2"
mediasoup = "0.19.1"
futures-lite = "2.3.0"
once_cell = "1.19.0"
num_cpus = "1.16.0"
Expand Down
22 changes: 0 additions & 22 deletions test/integration/test_pipe_transport.ex
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,6 @@ defmodule IntegrateTest.PipeTransportTest do
] === pipe_consumer.rtp_parameters["codecs"]

assert [
%{
"encrypt" => false,
"id" => 6,
"uri" => "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07"
},
%{"encrypt" => false, "id" => 7, "uri" => "urn:ietf:params:rtp-hdrext:framemarking"},
%{"encrypt" => false, "id" => 11, "uri" => "urn:3gpp:video-orientation"},
%{"encrypt" => false, "id" => 12, "uri" => "urn:ietf:params:rtp-hdrext:toffset"},
%{
Expand Down Expand Up @@ -451,12 +445,6 @@ defmodule IntegrateTest.PipeTransportTest do
] === pipe_producer.rtp_parameters["codecs"]

assert [
%{
"encrypt" => false,
"id" => 6,
"uri" => "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07"
},
%{"encrypt" => false, "id" => 7, "uri" => "urn:ietf:params:rtp-hdrext:framemarking"},
%{"encrypt" => false, "id" => 11, "uri" => "urn:3gpp:video-orientation"},
%{"encrypt" => false, "id" => 12, "uri" => "urn:ietf:params:rtp-hdrext:toffset"},
%{
Expand Down Expand Up @@ -565,16 +553,6 @@ defmodule IntegrateTest.PipeTransportTest do
] === pipe_consumer.rtp_parameters["codecs"]

assert [
%{
"encrypt" => false,
"id" => 6,
"uri" => "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07"
},
%{
"encrypt" => false,
"id" => 7,
"uri" => "urn:ietf:params:rtp-hdrext:framemarking"
},
%{"encrypt" => false, "id" => 11, "uri" => "urn:3gpp:video-orientation"},
%{"encrypt" => false, "id" => 12, "uri" => "urn:ietf:params:rtp-hdrext:toffset"},
%{
Expand Down
5 changes: 4 additions & 1 deletion test/integration/test_plain_transport.ex
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ defmodule IntegrateTest.PlainTransportTest do
{_worker, router} = init(worker)

{:ok, transport} =
Router.create_plain_transport(router, %{listenIp: %{ip: "127.0.0.1"}, comedia: false})
Router.create_plain_transport(router, %{
listenIp: %{ip: "127.0.0.1"},
comedia: false
})

assert transport.id == PlainTransport.id(transport)

Expand Down
Loading
Loading