From 3b403fb3a4259d613bbe1ed30a13f81c02d1c089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kita?= Date: Thu, 9 Apr 2026 10:50:11 +0200 Subject: [PATCH 1/3] Update deps. Fix dialyzer and credo warnings. Bump to v0.10.5 --- README.md | 2 +- lib/membrane_h264_plugin/h264/au_splitter.ex | 6 +++--- lib/membrane_h264_plugin/h265/au_splitter.ex | 6 +++--- lib/membrane_h264_plugin/h26x/nalu_parser.ex | 8 +++----- lib/membrane_h264_plugin/h26x_parser.ex | 2 +- mix.exs | 2 +- mix.lock | 20 ++++++++++---------- test/parser/h264/process_all_test.exs | 2 +- 8 files changed, 23 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index e17d50b..63be735 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The package can be installed by adding `membrane_h26x_plugin` to your list of de ```elixir def deps do [ - {:membrane_h26x_plugin, "~> 0.10.5"} + {:membrane_h26x_plugin, "~> 0.10.6"} ] end ``` diff --git a/lib/membrane_h264_plugin/h264/au_splitter.ex b/lib/membrane_h264_plugin/h264/au_splitter.ex index 3ffb88b..b1c51ae 100644 --- a/lib/membrane_h264_plugin/h264/au_splitter.ex +++ b/lib/membrane_h264_plugin/h264/au_splitter.ex @@ -76,7 +76,7 @@ defmodule Membrane.H264.AUSplitter do """ @spec split([NALu.t()], boolean(), t()) :: {[AUSplitter.access_unit()], t()} def split(nalus, assume_au_aligned \\ false, state) do - state = do_split(nalus, state) + %__MODULE__{} = state = do_split(nalus, state) {aus, state} = if assume_au_aligned do @@ -89,7 +89,7 @@ defmodule Membrane.H264.AUSplitter do {Enum.reject(aus, &Enum.empty?/1), state} end - defp do_split([first_nalu | rest_nalus], %{fsm_state: :first} = state) do + defp do_split([first_nalu | rest_nalus], %__MODULE__{fsm_state: :first} = state) do cond do new_primary_coded_vcl_nalu?(first_nalu, state.previous_primary_coded_picture_nalu) -> do_split( @@ -117,7 +117,7 @@ defmodule Membrane.H264.AUSplitter do end end - defp do_split([first_nalu | rest_nalus], %{fsm_state: :second} = state) do + defp do_split([first_nalu | rest_nalus], %__MODULE__{fsm_state: :second} = state) do cond do first_nalu.type in @non_vcl_nalu_types_at_au_end -> do_split( diff --git a/lib/membrane_h264_plugin/h265/au_splitter.ex b/lib/membrane_h264_plugin/h265/au_splitter.ex index 05f684b..5a0bf5e 100644 --- a/lib/membrane_h264_plugin/h265/au_splitter.ex +++ b/lib/membrane_h264_plugin/h265/au_splitter.ex @@ -64,7 +64,7 @@ defmodule Membrane.H265.AUSplitter do """ @spec split([NALu.t()], boolean(), t()) :: {[AUSplitter.access_unit()], t()} def split(nalus, assume_au_aligned \\ false, state) do - state = do_split(nalus, state) + %__MODULE__{} = state = do_split(nalus, state) {aus, state} = if assume_au_aligned do @@ -77,7 +77,7 @@ defmodule Membrane.H265.AUSplitter do {Enum.reject(aus, &Enum.empty?/1), state} end - defp do_split([first_nalu | rest_nalus], %{fsm_state: :first} = state) do + defp do_split([first_nalu | rest_nalus], %__MODULE__{fsm_state: :first} = state) do cond do access_unit_first_slice_segment?(first_nalu) -> do_split( @@ -105,7 +105,7 @@ defmodule Membrane.H265.AUSplitter do end end - defp do_split([first_nalu | rest_nalus], %{fsm_state: :second} = state) do + defp do_split([first_nalu | rest_nalus], %__MODULE__{fsm_state: :second} = state) do previous_nalu = state.previous_nalu cond do diff --git a/lib/membrane_h264_plugin/h26x/nalu_parser.ex b/lib/membrane_h264_plugin/h26x/nalu_parser.ex index 874980d..a555b30 100644 --- a/lib/membrane_h264_plugin/h26x/nalu_parser.ex +++ b/lib/membrane_h264_plugin/h26x/nalu_parser.ex @@ -106,10 +106,7 @@ defmodule Membrane.H26x.NALuParser do input_stream_structure: Membrane.H264.Parser.stream_structure() } @enforce_keys [:input_stream_structure] - defstruct @enforce_keys ++ - [ - scheme_parser_state: SchemeParser.new() - ] + defstruct @enforce_keys ++ [:scheme_parser_state] @doc """ Returns a structure holding a clear NALu parser state. `input_stream_structure` @@ -118,7 +115,8 @@ defmodule Membrane.H26x.NALuParser do @spec new(Membrane.H264.Parser.stream_structure()) :: t() def new(input_stream_structure) do %__MODULE__{ - input_stream_structure: input_stream_structure + input_stream_structure: input_stream_structure, + scheme_parser_state: SchemeParser.new() } end diff --git a/lib/membrane_h264_plugin/h26x_parser.ex b/lib/membrane_h264_plugin/h26x_parser.ex index 0543a45..767b26e 100644 --- a/lib/membrane_h264_plugin/h26x_parser.ex +++ b/lib/membrane_h264_plugin/h26x_parser.ex @@ -444,7 +444,7 @@ defmodule Membrane.H26x.Parser do end end - @spec first_vcl_nalu(AUSplitter.access_unit(), state()) :: Membrane.H26x.NALu.t() + @spec first_vcl_nalu(AUSplitter.access_unit(), state()) :: Membrane.H26x.NALu.t() | nil defp first_vcl_nalu(au, state) do case state.nalu_parser_mod do Membrane.H264.NALuParser -> diff --git a/mix.exs b/mix.exs index e998f2a..892ebc8 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.H26x.Plugin.Mixfile do use Mix.Project - @version "0.10.5" + @version "0.10.6" @github_url "https://github.com/membraneframework/membrane_h26x_plugin" def project do diff --git a/mix.lock b/mix.lock index 1b92b04..5f36abc 100644 --- a/mix.lock +++ b/mix.lock @@ -1,25 +1,25 @@ %{ "bunch": {:hex, :bunch, "1.6.1", "5393d827a64d5f846092703441ea50e65bc09f37fd8e320878f13e63d410aec7", [:mix], [], "hexpm", "286cc3add551628b30605efbe2fca4e38cc1bea89bcd0a1a7226920b3364fe4a"}, "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, - "coerce": {:hex, :coerce, "1.0.1", "211c27386315dc2894ac11bc1f413a0e38505d808153367bd5c6e75a4003d096", [:mix], [], "hexpm", "b44a691700f7a1a15b4b7e2ff1fa30bebd669929ac8aa43cffe9e2f8bf051cf1"}, - "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"}, + "coerce": {:hex, :coerce, "1.0.2", "5ef791040c92baaa5dd344887563faaeac6e6742573a167493294f8af3672bbe", [:mix], [], "hexpm", "0b3451c729571234fdac478636c298e71d1f2ce1243abed5fa43fa3181b980eb"}, + "credo": {:hex, :credo, "1.7.17", "f92b6aa5b26301eaa5a35e4d48ebf5aa1e7094ac00ae38f87086c562caf8a22f", [: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", "1eb5645c835f0b6c9b5410f94b5a185057bcf6d62a9c2b476da971cde8749645"}, + "dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"}, "earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"}, - "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, - "ex_doc": {:hex, :ex_doc, "0.38.1", "bae0a0bd5b5925b1caef4987e3470902d072d03347114ffe03a55dbe206dd4c2", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "754636236d191b895e1e4de2ebb504c057fe1995fdfdd92e9d75c4b05633008b"}, - "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, + "erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"}, + "ex_doc": {:hex, :ex_doc, "0.40.1", "67542e4b6dde74811cfd580e2c0149b78010fd13001fda7cfeb2b2c2ffb1344d", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "bcef0e2d360d93ac19f01a85d58f91752d930c0a30e2681145feea6bd3516e00"}, + "file_system": {:hex, :file_system, "1.1.1", "31864f4685b0148f25bd3fbef2b1228457c0c89024ad67f7a81a3ffbc0bbad3a", [:mix], [], "hexpm", "7a15ff97dfe526aeefb090a7a9d3d03aa907e100e262a0f8f7746b78f8f87a5d"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, - "makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"}, - "membrane_core": {:hex, :membrane_core, "1.2.3", "0e23f50b2e7dfe95dd6047cc341807991f9d0349cd98455cc5cbfab41ba5233c", [:mix], [{:bunch, "~> 1.6", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 3.0 or ~> 4.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6e3099dcb52d136a4aef84b6fbb20905ea55d9f0d2d6726f7b589e8d169a55cd"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.0.3", "4252d5d4098da7415c390e847c814bad3764c94a814a0b4245176215615e1035", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "953297c02582a33411ac6208f2c6e55f0e870df7f80da724ed613f10e6706afd"}, + "membrane_core": {:hex, :membrane_core, "1.2.6", "22329f6a5ac1f56a58666e3bf48e07dcd0978143c23626226127f3baa3c89a95", [:mix], [{:bunch, "~> 1.6", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 3.0 or ~> 4.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7bdee620f5c1fc492613b12566b1b95e7e09f5eb9364c0fed742fffb16266ab4"}, "membrane_file_plugin": {:hex, :membrane_file_plugin, "0.16.0", "7917f6682c22b9bcfc2ca20ed960eee0f7d03ad31fd5f59ed850f1fe3ddd545a", [:mix], [{:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "b0727998f75a9b4dab8a2baefdfc13c3eac00a04e061ab1b0e61dc5566927acc"}, "membrane_h264_format": {:hex, :membrane_h264_format, "0.6.1", "44836cd9de0abe989b146df1e114507787efc0cf0da2368f17a10c47b4e0738c", [:mix], [], "hexpm", "4b79be56465a876d2eac2c3af99e115374bbdc03eb1dea4f696ee9a8033cd4b0"}, "membrane_h265_format": {:hex, :membrane_h265_format, "0.2.0", "1903c072cf7b0980c4d0c117ab61a2cd33e88782b696290de29570a7fab34819", [:mix], [], "hexpm", "6df418bdf242c0d9f7dbf2e5aea4c2d182e34ac9ad5a8b8cef2610c290002e83"}, "membrane_stream_plugin": {:hex, :membrane_stream_plugin, "0.4.0", "0c4ab72a4e13bf0faa0f1166fbaf68d2e34167dbec345aedb74ce1eb7497bdda", [:mix], [{:membrane_core, "~> 1.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "5a9a9c17783e18ad740e6ddfed364581bdb7ebdab8e61ba2c19a1830356f7eb8"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"}, "numbers": {:hex, :numbers, "5.2.4", "f123d5bb7f6acc366f8f445e10a32bd403c8469bdbce8ce049e1f0972b607080", [:mix], [{:coerce, "~> 1.0", [hex: :coerce, repo: "hexpm", optional: false]}, {:decimal, "~> 1.9 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "eeccf5c61d5f4922198395bf87a465b6f980b8b862dd22d28198c5e6fab38582"}, - "qex": {:hex, :qex, "0.5.1", "0d82c0f008551d24fffb99d97f8299afcb8ea9cf99582b770bd004ed5af63fd6", [:mix], [], "hexpm", "935a39fdaf2445834b95951456559e9dc2063d0a055742c558a99987b38d6bab"}, + "qex": {:hex, :qex, "0.5.2", "a0c861a2de2380314c23ef592349824ca9016c5845380667ff1d9a22a8796f9b", [:mix], [], "hexpm", "6fb81bf3ae354a9abb471b9561538ea3e8540125d803b00f45cbccff52f00496"}, "ratio": {:hex, :ratio, "4.0.1", "3044166f2fc6890aa53d3aef0c336f84b2bebb889dc57d5f95cc540daa1912f8", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:numbers, "~> 5.2.0", [hex: :numbers, repo: "hexpm", optional: false]}], "hexpm", "c60cbb3ccdff9ffa56e7d6d1654b5c70d9f90f4d753ab3a43a6bf40855b881ce"}, - "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "telemetry": {:hex, :telemetry, "1.4.1", "ab6de178e2b29b58e8256b92b382ea3f590a47152ca3651ea857a6cae05ac423", [:rebar3], [], "hexpm", "2172e05a27531d3d31dd9782841065c50dd5c3c7699d95266b2edd54c2dafa1c"}, } diff --git a/test/parser/h264/process_all_test.exs b/test/parser/h264/process_all_test.exs index 1a7eb2b..27448a0 100644 --- a/test/parser/h264/process_all_test.exs +++ b/test/parser/h264/process_all_test.exs @@ -27,7 +27,7 @@ defmodule Membrane.H264.ProcessAllTest do assert_end_of_stream(pid, :sink, :input, timeout) expected = - if length(spss) > 0 and length(ppss) > 0 do + if spss != [] and ppss != 0 do Enum.join([<<>>] ++ spss ++ ppss, @prefix) <> File.read!(in_path) else File.read!(in_path) From dd6bdd5781696888bcea6696094305820d7cf5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kita?= Date: Thu, 9 Apr 2026 12:05:37 +0200 Subject: [PATCH 2/3] implement CR suggestions --- lib/membrane_h264_plugin/h26x/nalu_parser.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/membrane_h264_plugin/h26x/nalu_parser.ex b/lib/membrane_h264_plugin/h26x/nalu_parser.ex index a555b30..5e05560 100644 --- a/lib/membrane_h264_plugin/h26x/nalu_parser.ex +++ b/lib/membrane_h264_plugin/h26x/nalu_parser.ex @@ -105,8 +105,8 @@ defmodule Membrane.H26x.NALuParser do scheme_parser_state: SchemeParser.t(), input_stream_structure: Membrane.H264.Parser.stream_structure() } - @enforce_keys [:input_stream_structure] - defstruct @enforce_keys ++ [:scheme_parser_state] + @enforce_keys [:input_stream_structure, :scheme_parser_state] + defstruct @enforce_keys @doc """ Returns a structure holding a clear NALu parser state. `input_stream_structure` From a123e4905ae96b08f67e59a927834c9d256c2ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kita?= Date: Thu, 9 Apr 2026 12:07:17 +0200 Subject: [PATCH 3/3] implement CR suggestions --- test/parser/h264/process_all_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parser/h264/process_all_test.exs b/test/parser/h264/process_all_test.exs index 27448a0..59230e7 100644 --- a/test/parser/h264/process_all_test.exs +++ b/test/parser/h264/process_all_test.exs @@ -27,7 +27,7 @@ defmodule Membrane.H264.ProcessAllTest do assert_end_of_stream(pid, :sink, :input, timeout) expected = - if spss != [] and ppss != 0 do + if spss != [] and ppss != [] do Enum.join([<<>>] ++ spss ++ ppss, @prefix) <> File.read!(in_path) else File.read!(in_path)