diff --git a/README.md b/README.md index 12f45a2..fa8c395 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.2"} + {:membrane_h26x_plugin, "~> 0.10.3"} ] end ``` diff --git a/lib/membrane_h264_plugin/h264/au_splitter.ex b/lib/membrane_h264_plugin/h264/au_splitter.ex index 3a8a22e..3ffb88b 100644 --- a/lib/membrane_h264_plugin/h264/au_splitter.ex +++ b/lib/membrane_h264_plugin/h264/au_splitter.ex @@ -91,7 +91,7 @@ defmodule Membrane.H264.AUSplitter do defp do_split([first_nalu | rest_nalus], %{fsm_state: :first} = state) do cond do - is_new_primary_coded_vcl_nalu(first_nalu, state.previous_primary_coded_picture_nalu) -> + new_primary_coded_vcl_nalu?(first_nalu, state.previous_primary_coded_picture_nalu) -> do_split( rest_nalus, %__MODULE__{ @@ -139,7 +139,7 @@ defmodule Membrane.H264.AUSplitter do } ) - is_new_primary_coded_vcl_nalu(first_nalu, state.previous_primary_coded_picture_nalu) -> + new_primary_coded_vcl_nalu?(first_nalu, state.previous_primary_coded_picture_nalu) -> do_split( rest_nalus, %__MODULE__{ @@ -215,15 +215,15 @@ defmodule Membrane.H264.AUSplitter do defguardp idrs_with_idr_pic_id_differ(a, b) when a.nal_unit_type == 5 and b.nal_unit_type == 5 and a.idr_pic_id != b.idr_pic_id - defp is_new_primary_coded_vcl_nalu(%{type: type}, _last_nalu) + defp new_primary_coded_vcl_nalu?(%{type: type}, _last_nalu) when not NALuTypes.is_vcl_nalu_type(type), do: false - defp is_new_primary_coded_vcl_nalu(_nalu, nil), do: true + defp new_primary_coded_vcl_nalu?(_nalu, nil), do: true # Conditions based on 7.4.1.2.4 "Detection of the first VCL NAL unit of a primary coded picture" # of the "ITU-T Rec. H.264 (01/2012)" - defp is_new_primary_coded_vcl_nalu(%{parsed_fields: nalu}, %{parsed_fields: last_nalu}) + defp new_primary_coded_vcl_nalu?(%{parsed_fields: nalu}, %{parsed_fields: last_nalu}) when first_mb_in_slice_zero(nalu) when frame_num_differs(nalu, last_nalu) when pic_parameter_set_id_differs(nalu, last_nalu) @@ -238,7 +238,7 @@ defmodule Membrane.H264.AUSplitter do true end - defp is_new_primary_coded_vcl_nalu(_nalu, _last_nalu) do + defp new_primary_coded_vcl_nalu?(_nalu, _last_nalu) do false end end diff --git a/lib/membrane_h264_plugin/h264/au_timestamp_generator.ex b/lib/membrane_h264_plugin/h264/au_timestamp_generator.ex index c829d0a..4d5d8e2 100644 --- a/lib/membrane_h264_plugin/h264/au_timestamp_generator.ex +++ b/lib/membrane_h264_plugin/h264/au_timestamp_generator.ex @@ -19,7 +19,7 @@ defmodule Membrane.H264.AUTimestampGenerator do if vcl_nalu.type == :idr do {0, 0} else - # TODO: As described in the spec, we should check for presence of the + # As described in the spec, we should check for presence of the # memory_management_control_operation syntax element equal to 5 # in the previous reference picture and calculate prev_pic_order_cnt_*sb # values accordingly if it's there. Since getting to that information diff --git a/lib/membrane_h264_plugin/h265/nalu_parser/schemes/sps.ex b/lib/membrane_h264_plugin/h265/nalu_parser/schemes/sps.ex index 8cee77e..ceb1d41 100644 --- a/lib/membrane_h264_plugin/h265/nalu_parser/schemes/sps.ex +++ b/lib/membrane_h264_plugin/h265/nalu_parser/schemes/sps.ex @@ -132,7 +132,7 @@ defmodule Membrane.H265.NALuParser.Schemes.SPS do <> = payload if pred_mode_flag == 0 do - {_, payload} = ExpGolombConverter.to_integer(payload) + {_number, payload} = ExpGolombConverter.to_integer(payload) {payload, state, next_coeff} else coef_num = min(64, 1 <<< (4 + (idx <<< 1))) diff --git a/lib/membrane_h264_plugin/h26x/nalu_parser/scheme_parser.ex b/lib/membrane_h264_plugin/h26x/nalu_parser/scheme_parser.ex index 416d428..eb3c733 100644 --- a/lib/membrane_h264_plugin/h26x/nalu_parser/scheme_parser.ex +++ b/lib/membrane_h264_plugin/h26x/nalu_parser/scheme_parser.ex @@ -192,7 +192,7 @@ defmodule Membrane.H26x.NALuParser.SchemeParser do variables = lexems |> Enum.map(fn lexem -> - variable_name = String.slice(lexem, 1..-2) + variable_name = String.slice(lexem, 1..-2//-1) Map.get(state, variable_name) |> Integer.to_string() end) diff --git a/lib/membrane_h264_plugin/h26x/nalu_splitter.ex b/lib/membrane_h264_plugin/h26x/nalu_splitter.ex index 2c9e4c1..07ffd2f 100644 --- a/lib/membrane_h264_plugin/h26x/nalu_splitter.ex +++ b/lib/membrane_h264_plugin/h26x/nalu_splitter.ex @@ -74,7 +74,7 @@ defmodule Membrane.H26x.NALuSplitter do |> :binary.matches([<<0, 0, 0, 1>>, <<0, 0, 1>>]) |> Enum.chunk_every(2, 1, [{byte_size(payload), nil}]) |> then(&Enum.drop(&1, -1)) - |> Enum.map(fn [{from, _prefix_len}, {to, _}] -> + |> Enum.map(fn [{from, _from_prefix_len}, {to, _to_prefix_len}] -> len = to - from :binary.part(payload, from, len) end) diff --git a/lib/membrane_h264_plugin/h26x_parser.ex b/lib/membrane_h264_plugin/h26x_parser.ex index 4a83551..1e7020e 100644 --- a/lib/membrane_h264_plugin/h26x_parser.ex +++ b/lib/membrane_h264_plugin/h26x_parser.ex @@ -25,7 +25,11 @@ defmodule Membrane.H26x.Parser do @type raw_stream_structure :: :annexb | {codec_tag :: atom(), decoder_configuration_record :: binary()} - @typep callback_return :: Membrane.Element.Base.callback_return() + @typep callback_return :: + {[ + Membrane.Element.Action.common_actions() + | Membrane.Element.Action.stream_actions() + ], Membrane.Element.state()} @doc """ Invoked each time a new stream format arrives. It should return a tuple of 3 @@ -137,7 +141,7 @@ defmodule Membrane.H26x.Parser do framerate: Map.get(stream_format, :framerate) || state.framerate }} - not is_input_stream_structure_change_allowed?( + not input_stream_structure_change_allowed?( input_stream_structure, state.input_stream_structure ) -> @@ -198,7 +202,8 @@ defmodule Membrane.H26x.Parser do state | nalu_splitter: nalu_splitter, nalu_parser: nalu_parser, - au_splitter: au_splitter + au_splitter: au_splitter, + previous_buffer_timestamps: {buffer.pts || buffer.dts, buffer.dts || buffer.pts} } prepare_actions_for_aus(access_units, ctx, state) @@ -279,12 +284,17 @@ defmodule Membrane.H26x.Parser do end end - @spec is_input_stream_structure_change_allowed?(stream_structure(), stream_structure()) :: + @spec input_stream_structure_change_allowed?(stream_structure(), stream_structure()) :: boolean() - def is_input_stream_structure_change_allowed?(:annexb, :annexb), do: true - def is_input_stream_structure_change_allowed?({codec_tag, _}, {codec_tag, _}), do: true + def input_stream_structure_change_allowed?(:annexb, :annexb), do: true + + def input_stream_structure_change_allowed?( + {codec_tag, _from_prefix_len}, + {codec_tag, _to_prefix_len} + ), + do: true - def is_input_stream_structure_change_allowed?(_stream_structure1, _stream_structure2), + def input_stream_structure_change_allowed?(_stream_structure1, _stream_structure2), do: false @spec merge_parameter_sets(parameter_sets(), parameter_sets()) :: parameter_sets() @@ -379,7 +389,14 @@ defmodule Membrane.H26x.Parser do @spec clean_state(state(), callback_context()) :: {[AUSplitter.access_unit()], state()} def clean_state(state, ctx) do {nalus_payloads, nalu_splitter} = NALuSplitter.split(<<>>, true, state.nalu_splitter) - {nalus, nalu_parser} = state.nalu_parser_mod.parse_nalus(nalus_payloads, state.nalu_parser) + + {nalus, nalu_parser} = + state.nalu_parser_mod.parse_nalus( + nalus_payloads, + state.previous_buffer_timestamps, + state.nalu_parser + ) + {access_units, au_splitter} = state.au_splitter_mod.split(nalus, true, state.au_splitter) state = %{ diff --git a/mix.exs b/mix.exs index dc261b1..8fd5e1b 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.H26x.Plugin.Mixfile do use Mix.Project - @version "0.10.2" + @version "0.10.3" @github_url "https://github.com/membraneframework/membrane_h26x_plugin" def project do diff --git a/mix.lock b/mix.lock index f730683..1b92b04 100644 --- a/mix.lock +++ b/mix.lock @@ -1,25 +1,25 @@ %{ - "bunch": {:hex, :bunch, "1.6.0", "4775f8cdf5e801c06beed3913b0bd53fceec9d63380cdcccbda6be125a6cfd54", [:mix], [], "hexpm", "ef4e9abf83f0299d599daed3764d19e8eac5d27a5237e5e4d5e2c129cfeb9a22"}, - "bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, + "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.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"}, - "dialyxir": {:hex, :dialyxir, "1.4.1", "a22ed1e7bd3a3e3f197b68d806ef66acb61ee8f57b3ac85fc5d57354c5482a93", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "84b795d6d7796297cca5a3118444b80c7d94f7ce247d49886e7c291e1ae49801"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.35", "437773ca9384edf69830e26e9e7b2e0d22d2596c4a6b17094a3b29f01ea65bb8", [:mix], [], "hexpm", "8652ba3cb85608d0d7aa2d21b45c6fad4ddc9a1f9a1f1b30ca3a246f0acc33f6"}, - "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "ex_doc": {:hex, :ex_doc, "0.30.6", "5f8b54854b240a2b55c9734c4b1d0dd7bdd41f71a095d42a70445c03cf05a281", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "bd48f2ddacf4e482c727f9293d9498e0881597eae6ddc3d9562bd7923375109f"}, - "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, - "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [: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", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"}, - "makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"}, - "membrane_core": {:hex, :membrane_core, "1.0.0", "1b543aefd952283be1f2a215a1db213aa4d91222722ba03cd35280622f1905ee", [:mix], [{:bunch, "~> 1.6", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 3.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "352c90fd0a29942143c4bf7a727cc05c632e323f50a1a4e99321b1e8982f1533"}, + "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"}, + "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"}, + "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"}, "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.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"}, + "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"}, - "ratio": {:hex, :ratio, "3.0.2", "60a5976872a4dc3d873ecc57eed1738589e99d1094834b9c935b118231297cfb", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:numbers, "~> 5.2.0", [hex: :numbers, repo: "hexpm", optional: false]}], "hexpm", "3a13ed5a30ad0bfd7e4a86bf86d93d2b5a06f5904417d38d3f3ea6406cdfc7bb"}, - "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, + "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"}, } diff --git a/test/integration/h264/modes_test.exs b/test/integration/h264/modes_test.exs index 98157aa..038cf98 100644 --- a/test/integration/h264/modes_test.exs +++ b/test/integration/h264/modes_test.exs @@ -28,7 +28,7 @@ defmodule Membrane.H264.ModesTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = prepare_h264_buffers(binary, :au_aligned) @@ -56,7 +56,7 @@ defmodule Membrane.H264.ModesTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = prepare_h264_buffers(binary, :au_aligned) @@ -86,7 +86,7 @@ defmodule Membrane.H264.ModesTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = input_buffers diff --git a/test/integration/h264/timestamp_generation_test.exs b/test/integration/h264/timestamp_generation_test.exs index 2cf85e7..a873a40 100644 --- a/test/integration/h264/timestamp_generation_test.exs +++ b/test/integration/h264/timestamp_generation_test.exs @@ -45,7 +45,7 @@ defmodule Membrane.H264.TimestampGenerationTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = prepare_h264_buffers(binary, :au_aligned) @@ -87,7 +87,7 @@ defmodule Membrane.H264.TimestampGenerationTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = prepare_h264_buffers(binary, :au_aligned) diff --git a/test/integration/h265/modes_test.exs b/test/integration/h265/modes_test.exs index eda77f4..c14d46d 100644 --- a/test/integration/h265/modes_test.exs +++ b/test/integration/h265/modes_test.exs @@ -29,7 +29,7 @@ defmodule Membrane.H265.ModesTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = prepare_h265_buffers(binary, :au_aligned) @@ -57,7 +57,7 @@ defmodule Membrane.H265.ModesTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = prepare_h265_buffers(binary, :au_aligned) @@ -87,7 +87,7 @@ defmodule Membrane.H265.ModesTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = input_buffers diff --git a/test/integration/h265/timestamp_generation_test.exs b/test/integration/h265/timestamp_generation_test.exs index 062ee86..903f0ba 100644 --- a/test/integration/h265/timestamp_generation_test.exs +++ b/test/integration/h265/timestamp_generation_test.exs @@ -69,7 +69,7 @@ defmodule Membrane.H265.TimestampGenerationTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = prepare_h265_buffers(binary, :au_aligned) @@ -113,7 +113,7 @@ defmodule Membrane.H265.TimestampGenerationTest do assert_sink_playing(pid, :sink) send_buffers_actions = for buffer <- input_buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, send_buffers_actions ++ [end_of_stream: :output]) output_buffers = prepare_h265_buffers(binary, :au_aligned) diff --git a/test/parser/h264/repeat_parameter_sets_test.exs b/test/parser/h264/repeat_parameter_sets_test.exs index 72da0d7..7c9fc73 100644 --- a/test/parser/h264/repeat_parameter_sets_test.exs +++ b/test/parser/h264/repeat_parameter_sets_test.exs @@ -46,7 +46,7 @@ defmodule Membrane.H264.RepeatParameterSetsTest do assert_sink_playing(pipeline_pid, :sink) actions = for buffer <- buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pipeline_pid, :source, actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pipeline_pid, :source, actions ++ [end_of_stream: :output]) output_buffers = prepare_h264_buffers( @@ -105,7 +105,7 @@ defmodule Membrane.H264.RepeatParameterSetsTest do assert_sink_playing(pid, :sink) actions = for buffer <- buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, actions ++ [end_of_stream: :output]) File.read!(ref_path) |> prepare_h264_buffers(:au_aligned) diff --git a/test/parser/h264/stream_structure_conversion_test.exs b/test/parser/h264/stream_structure_conversion_test.exs index d9460c6..a26c8fa 100644 --- a/test/parser/h264/stream_structure_conversion_test.exs +++ b/test/parser/h264/stream_structure_conversion_test.exs @@ -43,7 +43,7 @@ defmodule Membrane.H264.StreamStructureConversionTest do buffers = prepare_h264_buffers(data, mode, :annexb, false) assert_sink_playing(pipeline_pid, :sink) actions = for buffer <- buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pipeline_pid, :source, actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pipeline_pid, :source, actions ++ [end_of_stream: :output]) assert_end_of_stream(pipeline_pid, :sink, :input, 3_000) @@ -231,12 +231,12 @@ defmodule Membrane.H264.StreamStructureConversionTest do Enum.map_join(parser_types, fn parser_type -> case parser_type do :annexb -> "annexb -> " - {:avc1, _} -> "avc1 -> " - {:avc3, _} -> "avc3 -> " + {:avc1, _prefix_len} -> "avc1 -> " + {:avc3, _prefix_len} -> "avc3 -> " end end) - identical_order? = not Enum.any?(parser_types, &match?({:avc1, _}, &1)) + identical_order? = not Enum.any?(parser_types, &match?({:avc1, _prefix_len}, &1)) stream_name = "stream #{tested_stream_structure_name} -> #{parser_chain_string}#{tested_stream_structure_name}#{name_suffix}" diff --git a/test/parser/h265/repeat_parameter_sets_test.exs b/test/parser/h265/repeat_parameter_sets_test.exs index d152d66..c654a51 100644 --- a/test/parser/h265/repeat_parameter_sets_test.exs +++ b/test/parser/h265/repeat_parameter_sets_test.exs @@ -56,7 +56,7 @@ defmodule Membrane.H265.RepeatParameterSetsTest do assert_sink_playing(pipeline_pid, :sink) actions = for buffer <- buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pipeline_pid, :source, actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pipeline_pid, :source, actions ++ [end_of_stream: :output]) output_buffers = prepare_h265_buffers( @@ -116,7 +116,7 @@ defmodule Membrane.H265.RepeatParameterSetsTest do assert_sink_playing(pid, :sink) actions = for buffer <- buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pid, :source, actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pid, :source, actions ++ [end_of_stream: :output]) File.read!(ref_path) |> prepare_h265_buffers(:au_aligned) diff --git a/test/parser/h265/stream_structure_conversion_test.exs b/test/parser/h265/stream_structure_conversion_test.exs index b808786..1f90559 100644 --- a/test/parser/h265/stream_structure_conversion_test.exs +++ b/test/parser/h265/stream_structure_conversion_test.exs @@ -46,7 +46,7 @@ defmodule Membrane.H265.StreamStructureConversionTest do buffers = prepare_h265_buffers(data, mode, :annexb, false) assert_sink_playing(pipeline_pid, :sink) actions = for buffer <- buffers, do: {:buffer, {:output, buffer}} - Pipeline.message_child(pipeline_pid, :source, actions ++ [end_of_stream: :output]) + Pipeline.notify_child(pipeline_pid, :source, actions ++ [end_of_stream: :output]) assert_end_of_stream(pipeline_pid, :sink, :input, 3_000) @@ -241,12 +241,12 @@ defmodule Membrane.H265.StreamStructureConversionTest do Enum.map_join(parser_types, fn parser_type -> case parser_type do :annexb -> "annexb -> " - {:hvc1, _} -> "hvc1 -> " - {:hev1, _} -> "hev1 -> " + {:hvc1, _prefix_len} -> "hvc1 -> " + {:hev1, _prefix_len} -> "hev1 -> " end end) - identical_order? = not Enum.any?(parser_types, &match?({:hvc1, _}, &1)) + identical_order? = not Enum.any?(parser_types, &match?({:hvc1, _prefix_len}, &1)) stream_name = "stream #{tested_stream_structure_name} -> #{parser_chain_string}#{tested_stream_structure_name}#{name_suffix}" diff --git a/test/support/fixture_generator.exs b/test/support/fixture_generator.exs index ee3e092..b730b6b 100644 --- a/test/support/fixture_generator.exs +++ b/test/support/fixture_generator.exs @@ -140,7 +140,7 @@ defmodule AVCFixtureGenerator do end) end - defp generate_fixture(input_location, output_alignment, {avc, _} = stream_structure) do + defp generate_fixture(input_location, output_alignment, {avc, _prefix_len} = stream_structure) do output_location = input_location |> Path.split()