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

This file was deleted.

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

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

jobs:
build_test:
uses: membraneframework/membrane_actions/.github/workflows/build-test.yml@main

test:
uses: membraneframework/membrane_actions/.github/workflows/test.yml@main

lint:
uses: membraneframework/membrane_actions/.github/workflows/lint.yml@main
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:
tags:
- "v*"
workflow_dispatch:

jobs:
build_test:
uses: membraneframework/membrane_actions/.github/workflows/build-test.yml@main

test:
uses: membraneframework/membrane_actions/.github/workflows/test.yml@main

lint:
uses: membraneframework/membrane_actions/.github/workflows/lint.yml@main

hex_publish:
needs: [build_test, test, lint]
uses: membraneframework/membrane_actions/.github/workflows/hex-publish.yml@main
secrets:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}

gh_release:
needs: [hex_publish]
uses: membraneframework/membrane_actions/.github/workflows/github-release.yml@main
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The package can be installed by adding `membrane_rtmp_plugin` to your list of de
```elixir
def deps do
[
{:membrane_rtmp_plugin, "~> 0.29.3"}
{:membrane_rtmp_plugin, "~> 0.29.4"}
]
end
```
Expand Down
42 changes: 23 additions & 19 deletions lib/membrane_rtmp_plugin/rtmp/header.ex
Original file line number Diff line number Diff line change
Expand Up @@ -181,25 +181,7 @@ defmodule Membrane.RTMP.Header do
) do
case previous_headers[chunk_stream_id] do
%__MODULE__{} = previous_header ->
if previous_header.extended_timestamp? do
with {timestamp_delta, _extended_timestamp?, rest} <-
extract_timestamp(rest, @extended_timestamp_marker) do
header = %__MODULE__{
previous_header
| timestamp: previous_header.timestamp + timestamp_delta,
timestamp_delta: timestamp_delta
}

{header, rest}
end
else
header = %__MODULE__{
previous_header
| timestamp: previous_header.timestamp + previous_header.timestamp_delta
}

{header, rest}
end
deserialize_type_3_header(previous_header, rest)

_nil ->
{:error, {:missing_previous_header, chunk_stream_id, :type_3}}
Expand All @@ -209,6 +191,28 @@ defmodule Membrane.RTMP.Header do
defp deserialize_message_header(_basic_header, _data, _prev_header),
do: {:error, :need_more_data}

defp deserialize_type_3_header(%__MODULE__{extended_timestamp?: true} = previous_header, rest) do
with {timestamp_delta, _extended_timestamp?, rest} <-
extract_timestamp(rest, @extended_timestamp_marker) do
header = %__MODULE__{
previous_header
| timestamp: previous_header.timestamp + timestamp_delta,
timestamp_delta: timestamp_delta
}

{header, rest}
end
end

defp deserialize_type_3_header(previous_header, rest) do
header = %{
previous_header
| timestamp: previous_header.timestamp + previous_header.timestamp_delta
}

{header, rest}
end

@spec serialize(t()) :: binary()
def serialize(%__MODULE__{chunk_stream_id: chunk_stream_id} = header)
when chunk_stream_id >= 2 and chunk_stream_id <= 63 do
Expand Down
9 changes: 5 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.RTMP.Mixfile do
use Mix.Project

@version "0.29.3"
@version "0.29.4"
@github_url "https://github.com/membraneframework/membrane_rtmp_plugin"

def project do
Expand Down Expand Up @@ -52,9 +52,9 @@ defmodule Membrane.RTMP.Mixfile do
{:ffmpex, "~> 0.11.0", only: :test},
{:membrane_stream_plugin, "~> 0.4.0", only: :test},
# development
{:ex_doc, "~> 0.28", only: :dev, runtime: false},
{:dialyxir, "~> 1.1", only: :dev, runtime: false},
{:credo, "~> 1.6", only: :dev, runtime: false}
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
{:credo, ">= 0.0.0", only: :dev, runtime: false}
]
end

Expand All @@ -65,6 +65,7 @@ defmodule Membrane.RTMP.Mixfile do

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
Expand Down
Loading
Loading