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
38 changes: 0 additions & 38 deletions .circleci/config.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches: ["**"]
workflow_dispatch:

jobs:
build_test:
uses: membraneframework/membrane_actions/.github/workflows/build-test.yml@setup-commands
with:
setup-commands: apt-get update && apt-get install -y libnice-dev


lint:
uses: membraneframework/membrane_actions/.github/workflows/lint.yml@setup-commands
with:
dialyzer: false
setup-commands: apt-get update && apt-get install -y libnice-dev

test:
uses: membraneframework/membrane_actions/.github/workflows/test.yml@setup-commands
with:
setup-commands: apt-get update && apt-get install -y libnice-dev
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The package can be installed by adding `ex_libnice` to your list of dependencies
```elixir
def deps do
[
{:ex_libnice, "~> 0.8.0"}
{:ex_libnice, "~> 0.8.1"}
]
end
```
Expand Down
2 changes: 1 addition & 1 deletion bundlex.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule ExLibnice.BundlexProject do
native: [
sources: ["native.c", "parser.c"],
deps: [unifex: :unifex],
pkg_configs: ["nice"],
os_deps: [nice: :pkg_config],
interface: [:nif, :cnode],
preprocessor: Unifex
]
Expand Down
34 changes: 17 additions & 17 deletions lib/ex_libnice.ex
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ defmodule ExLibnice do
# Server API
@impl true
def init(opts) do
min_port..max_port = opts[:port_range]
min_port..max_port//_step = opts[:port_range]

{:ok, stun_servers} = lookup_stun_servers(opts[:stun_servers])

Expand All @@ -298,7 +298,7 @@ defmodule ExLibnice do
{:reply, {:ok, stream_id}, put_in(state.stream_components[stream_id], n_components)}

{{:error, cause}, state} ->
Logger.warn("""
Logger.warning("""
Couldn't add stream with #{n_components} components and name "#{inspect(name)}": \
#{inspect(cause)}
""")
Expand All @@ -325,7 +325,7 @@ defmodule ExLibnice do
{:reply, :ok, state}

{{:error, cause}, state} ->
Logger.warn("""
Logger.warning("""
Couldn't forget TURN servers for component: #{inspect(component_id)} in stream: \
#{inspect(stream_id)}, reason: #{inspect(cause)}
""")
Expand All @@ -349,7 +349,7 @@ defmodule ExLibnice do
{:reply, {:ok, added_cand_num}, state}

{{:error, cause}, state} ->
Logger.warn("Couldn't parse remote sdp #{inspect(remote_sdp)}")
Logger.warning("Couldn't parse remote sdp #{inspect(remote_sdp)}")
{:reply, {:error, cause}, state}
end
end
Expand Down Expand Up @@ -409,7 +409,7 @@ defmodule ExLibnice do
{:reply, :ok, state}

{{:error, cause}, state} ->
Logger.warn("peer_candidate_gathering_done: #{inspect(cause)}")
Logger.warning("peer_candidate_gathering_done: #{inspect(cause)}")
{:reply, {:error, cause}, state}
end
end
Expand Down Expand Up @@ -449,8 +449,8 @@ defmodule ExLibnice do
{:reply, :ok, state}
end
else
candidate_check: _ -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
mdns_check: _ -> do_set_remote_candidate(candidate, stream_id, component_id, state)
candidate_check: _x -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
mdns_check: _x -> do_set_remote_candidate(candidate, stream_id, component_id, state)
end
end

Expand All @@ -462,7 +462,7 @@ defmodule ExLibnice do
{:reply, :ok, state}

{{:error, cause}, state} ->
Logger.warn("Couldn't restart ICE")
Logger.warning("Couldn't restart ICE")
{:reply, {:error, cause}, state}
end
end
Expand All @@ -475,7 +475,7 @@ defmodule ExLibnice do
{:reply, :ok, state}

{{:error, cause}, state} ->
Logger.warn("Couldn't restart stream #{inspect(stream_id)}")
Logger.warning("Couldn't restart stream #{inspect(stream_id)}")
{:reply, {:error, cause}, state}
end
end
Expand All @@ -487,7 +487,7 @@ defmodule ExLibnice do
{:reply, :ok, state}

{{:error, cause}, state} ->
Logger.warn("Couldn't send payload: #{inspect(cause)}")
Logger.warning("Couldn't send payload: #{inspect(cause)}")
{:reply, {:error, cause}, state}
end
end
Expand Down Expand Up @@ -546,7 +546,7 @@ defmodule ExLibnice do
{:component_state_failed, _stream_id, _component_id} = msg,
%State{parent: parent} = state
) do
Logger.warn("#{inspect(msg)}")
Logger.warning("#{inspect(msg)}")
send(parent, msg)
{:noreply, state}
end
Expand Down Expand Up @@ -578,7 +578,7 @@ defmodule ExLibnice do

@impl true
def handle_info(msg, state) do
Logger.warn("Unknown message #{inspect(msg)}")
Logger.warning("Unknown message #{inspect(msg)}")
{:noreply, state}
end

Expand All @@ -603,7 +603,7 @@ defmodule ExLibnice do
defp do_set_relay_info(state, stream_id, :all, relay_info) do
case Map.get(state.stream_components, stream_id) do
nil ->
Logger.warn("Couldn't set TURN servers. No stream with id #{inspect(stream_id)}")
Logger.warning("Couldn't set TURN servers. No stream with id #{inspect(stream_id)}")

{{:error, :bad_stream_id}, state}

Expand All @@ -621,7 +621,7 @@ defmodule ExLibnice do
%{server_addr: server_addr, server_port: server_port, relay_type: relay_type}
)
when relay_type not in [:udp, :tcp, :tls] do
Logger.warn("""
Logger.warning("""
Couldn't set TURN server #{inspect(server_addr)} #{inspect(server_port)} \
#{inspect(relay_type)} for component: #{inspect(component_id)} in stream: \
#{inspect(stream_id)}, cause: bad_relay_type
Expand Down Expand Up @@ -656,14 +656,14 @@ defmodule ExLibnice do
{:ok, state}
else
{:error, :failed_to_lookup_addr} = err ->
Logger.warn("""
Logger.warning("""
Couldn't lookup TURN server address #{inspect(server_addr)}
""")

{err, state}

{{:error, cause}, _state} = ret ->
Logger.warn("""
Logger.warning("""
Couldn't set TURN server #{inspect(server_addr)} #{inspect(server_port)} \
#{inspect(relay_type)} for component: #{inspect(component_id)} in stream: \
#{inspect(stream_id)}, cause: #{inspect(cause)}
Expand All @@ -680,7 +680,7 @@ defmodule ExLibnice do
{:reply, :ok, state}

{{:error, cause}, state} ->
Logger.warn("Couldn't set remote candidate: #{inspect(cause)}")
Logger.warning("Couldn't set remote candidate: #{inspect(cause)}")
{:reply, {:error, cause}, state}
end
end
Expand Down
24 changes: 20 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule ExLibnice.MixProject do
use Mix.Project

@version "0.8.0"
@version "0.8.1"
@github_url "https://github.com/membraneframework/ex_libnice"

def project do
Expand All @@ -13,6 +13,7 @@ defmodule ExLibnice.MixProject do
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
dialyzer: dialyzer(),

# hex
description: "Elixir wrapper over libnice",
Expand Down Expand Up @@ -41,12 +42,27 @@ defmodule ExLibnice.MixProject do
{:unifex, "~> 1.0"},
{:bunch, "~> 1.3.0"},
{:mdns, "~> 1.0.12"},
{:ex_doc, "~> 0.23", only: :dev, runtime: false},
{:dialyxir, "~> 1.0", only: :dev, runtime: false},
{:credo, "~> 1.5", only: :dev, runtime: false}
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
{:dialyxir, "~> 1.4", only: :dev, runtime: false},
{:credo, "~> 1.7", only: :dev, runtime: false}
]
end

defp dialyzer() do
opts = [
flags: [:error_handling],
plt_add_apps: [:mix, :syntax_tools]
]

if System.get_env("CI") == "true" do
# Store PLTs in cacheable directory for CI
File.mkdir_p!(Path.join([__DIR__, "priv", "plts"]))
[plt_local_path: "priv/plts", plt_core_path: "priv/plts"] ++ opts
else
opts
end
end

defp package do
[
maintainers: ["Membrane Team"],
Expand Down
Loading
Loading