Skip to content

Commit 23f842a

Browse files
authored
Release v0.1.4 (#12)
* Remove mise.toml. Bump version to v0.1.4. Allow for specifying latency_ms in Client and Server start_link functions
1 parent 10427f6 commit 23f842a

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The package exposes a server and a client module to interact with SRT streams.
1313
```elixir
1414
def deps do
1515
[
16-
{:ex_libsrt, "~> 0.1.3"}
16+
{:ex_libsrt, "~> 0.1.4"}
1717
]
1818
end
1919
```

lib/ex_libsrt/client.ex

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ defmodule ExLibSRT.Client do
99
* `start/4` - starts a client connection to the server with password authentication
1010
* `start_link/3` - starts a client connection to the server and links to current process
1111
* `start_link/4` - starts a client connection to the server with password authentication and links to current process
12+
* `start_link/5` - starts a client connection to the server with password authentication, sets SRT latency and links to current process
1213
* `stop/1` - stops the client connection
1314
* `send_data/2` - sends a packet through the client connection
1415
@@ -42,18 +43,18 @@ defmodule ExLibSRT.Client do
4243
If a password is provided, it must be between 10 and 79 characters long according to SRT specification.
4344
An empty string means no password authentication will be used.
4445
"""
45-
@spec start_link(address :: String.t(), port :: non_neg_integer(), stream_id :: String.t()) ::
46-
{:ok, t()} | {:error, reason :: String.t(), error_code :: integer()}
4746
@spec start_link(
4847
address :: String.t(),
4948
port :: non_neg_integer(),
5049
stream_id :: String.t(),
51-
password :: String.t()
50+
password :: String.t(),
51+
latency_ms :: integer()
5252
) ::
5353
{:ok, t()} | {:error, reason :: String.t(), error_code :: integer()}
54-
def start_link(address, port, stream_id, password \\ "") do
54+
def start_link(address, port, stream_id, password \\ "", latency_ms \\ -1) do
5555
with :ok <- validate_password(password),
56-
{:ok, client_ref} <- ExLibSRT.Native.start_client(address, port, stream_id, password, -1) do
56+
{:ok, client_ref} <-
57+
ExLibSRT.Native.start_client(address, port, stream_id, password, latency_ms) do
5758
Agent.start_link(fn -> client_ref end)
5859
else
5960
{:error, reason, error_code} -> {:error, reason, error_code}

lib/ex_libsrt/server.ex

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ defmodule ExLibSRT.Server do
99
* `start/3` - starts the server with password authentication
1010
* `start_link/2` - starts the server and links to current process
1111
* `start_link/3` - starts the server with password authentication and links to current process
12+
* `start_link/4` - starts the server with password authentication, sets SRT latency and links to current process
1213
* `stop/1` - stops the server
1314
* `accept_awaiting_connect_request/1` - accepts next incoming connection
1415
* `reject_awaiting_connect_request/1` - rejects next incoming connection
@@ -69,13 +70,16 @@ defmodule ExLibSRT.Server do
6970
If a password is provided, it must be between 10 and 79 characters long according to SRT specification.
7071
An empty string means no password authentication will be used.
7172
"""
72-
@spec start_link(address :: String.t(), port :: non_neg_integer()) ::
73+
@spec start_link(
74+
address :: String.t(),
75+
port :: non_neg_integer(),
76+
password :: String.t(),
77+
latency_ms :: integer()
78+
) ::
7379
{:ok, t()} | {:error, reason :: String.t(), error_code :: integer()}
74-
@spec start_link(address :: String.t(), port :: non_neg_integer(), password :: String.t()) ::
75-
{:ok, t()} | {:error, reason :: String.t(), error_code :: integer()}
76-
def start_link(address, port, password \\ "") do
80+
def start_link(address, port, password \\ "", latency_ms \\ -1) do
7781
with :ok <- validate_password(password),
78-
{:ok, server_ref} <- ExLibSRT.Native.start_server(address, port, password, -1) do
82+
{:ok, server_ref} <- ExLibSRT.Native.start_server(address, port, password, latency_ms) do
7983
Agent.start_link(fn -> server_ref end)
8084
else
8185
{:error, reason, error_code} -> {:error, reason, error_code}

mise.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule ExLibSRT.MixProject do
22
use Mix.Project
33

4-
@version "0.1.3"
4+
@version "0.1.4"
55
@github_url "https://github.com/membraneframework/ex_libsrt"
66

77
def project do

0 commit comments

Comments
 (0)