From ea1f56aa6ce52de61dd4d778c166b86efc52808f Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Sat, 4 Dec 2021 19:29:06 +0100 Subject: [PATCH 01/14] updated to use new buffer pts field --- lib/deserializer.ex | 2 +- lib/serializer.ex | 2 +- mix.exs | 4 ++-- mix.lock | 16 ++++++++-------- test/fixtures/capture.dump | Bin 182033 -> 198287 bytes test/serializer_test.exs | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/deserializer.ex b/lib/deserializer.ex index 147c122..f3793bb 100644 --- a/lib/deserializer.ex +++ b/lib/deserializer.ex @@ -87,7 +87,7 @@ defmodule Membrane.Element.IVF.Deserializer do Headers.parse_ivf_frame_header(payload), <> <- rest do timestamp = timestamp * (timebase * Time.second()) - {:ok, %Buffer{metadata: %{timestamp: timestamp}, payload: frame}, rest} + {:ok, %Buffer{pts: timestamp, payload: frame}, rest} else _error -> {:error_too_short, payload} end diff --git a/lib/serializer.ex b/lib/serializer.ex index 069b813..a5d6621 100644 --- a/lib/serializer.ex +++ b/lib/serializer.ex @@ -48,7 +48,7 @@ defmodule Membrane.Element.IVF.Serializer do @impl true def handle_process(:input, buffer, ctx, state) do - %Buffer{payload: frame, metadata: %{timestamp: timestamp}} = buffer + %Buffer{payload: frame, pts: timestamp} = buffer ivf_frame = IVF.Headers.create_ivf_frame_header(byte_size(frame), timestamp, state.timebase) <> diff --git a/mix.exs b/mix.exs index cc2b2a3..17d4e69 100644 --- a/mix.exs +++ b/mix.exs @@ -36,11 +36,11 @@ defmodule Membrane.IVF.Plugin.MixProject do defp deps do [ - {:membrane_core, "~> 0.7.0"}, + {:membrane_core, "~> 0.8.0"}, {:ex_doc, "~> 0.24", only: :dev, runtime: false}, {:dialyxir, "~> 1.1.0", only: :dev, runtime: false}, {:credo, "~> 1.4", only: :dev, runtime: false}, - {:membrane_file_plugin, "~> 0.6.0", only: :test} + {:membrane_file_plugin, "~> 0.7.0", only: :test} ] end diff --git a/mix.lock b/mix.lock index 74f11f8..78d1a56 100644 --- a/mix.lock +++ b/mix.lock @@ -2,22 +2,22 @@ "bunch": {:hex, :bunch, "1.3.0", "51b4423088b7fb9e21eae6d6bc5e5d219d955ea5556fbd6130bfb6213df4be32", [:mix], [], "hexpm", "9ad233a2bacc0dae8aa6553a9b9057f27446443b1c5903c3479b6f9f3820ce2d"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "coerce": {:hex, :coerce, "1.0.1", "211c27386315dc2894ac11bc1f413a0e38505d808153367bd5c6e75a4003d096", [:mix], [], "hexpm", "b44a691700f7a1a15b4b7e2ff1fa30bebd669929ac8aa43cffe9e2f8bf051cf1"}, - "credo": {:hex, :credo, "1.5.6", "e04cc0fdc236fefbb578e0c04bd01a471081616e741d386909e527ac146016c6", [:mix], [{:bunt, "~> 0.2.0", [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", "4b52a3e558bd64e30de62a648518a5ea2b6e3e5d2b164ef5296244753fc7eb17"}, + "credo": {:hex, :credo, "1.6.1", "7dc76dcdb764a4316c1596804c48eada9fff44bd4b733a91ccbf0c0f368be61e", [:mix], [{:bunt, "~> 0.2.0", [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", "698607fb5993720c7e93d2d8e76f2175bba024de964e160e2f7151ef3ab82ac5"}, "dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.16", "607709303e1d4e3e02f1444df0c821529af1c03b8578dfc81bb9cf64553d02b9", [:mix], [], "hexpm", "69fcf696168f5a274dd012e3e305027010658b2d1630cef68421d6baaeaccead"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.18", "e1b2be73eb08a49fb032a0208bf647380682374a725dfb5b9e510def8397f6f2", [:mix], [], "hexpm", "114a0e85ec3cf9e04b811009e73c206394ffecfcc313e0b346de0d557774ee97"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "ex_doc": {:hex, :ex_doc, "0.25.5", "ac3c5425a80b4b7c4dfecdf51fa9c23a44877124dd8ca34ee45ff608b1c6deb9", [:mix], [{:earmark_parser, "~> 1.4.0", [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", "688cfa538cdc146bc4291607764a7f1fcfa4cce8009ecd62de03b27197528350"}, + "ex_doc": {:hex, :ex_doc, "0.26.0", "1922164bac0b18b02f84d6f69cab1b93bc3e870e2ad18d5dacb50a9e06b542a3", [:mix], [{:earmark_parser, "~> 1.4.0", [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", "2775d66e494a9a48355db7867478ffd997864c61c65a47d31c4949459281c78d"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, "makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, - "membrane_core": {:hex, :membrane_core, "0.7.0", "fc773f3b79ad3b5631c3a0754c429b333a4e024989aa4a63e49aa796d2fa1bd8", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 2.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4d04d42712d5548cf22993d85a7fdee9f4b6dfe31500ed299ed692fabdbc9824"}, - "membrane_file_plugin": {:hex, :membrane_file_plugin, "0.6.0", "ddaaa67e9de7fd6f03aedb82b0c6f31110cdccce21adf4486af013b3eab943a1", [:mix], [{:membrane_core, "~> 0.7.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.2", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "9a570b96bd6f1053cc33eb47285efcf102532dafdbf78e96c39f6897b01d287e"}, + "membrane_core": {:hex, :membrane_core, "0.8.1", "33df0e4c76c05a2be57042893b05516886462baefdf95b7299e4d2f5db32dea3", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 2.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5574db35f08de1e95648f9c3acce38c5f318216c5a5ae5e3f253f7edad8fdc1b"}, + "membrane_file_plugin": {:hex, :membrane_file_plugin, "0.7.0", "200e416e50e1545473fcfc9020253a797bf884f7d238227466e67266e7e71e5e", [:mix], [{:membrane_core, "~> 0.8.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.2", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "9efe63c780a021552293f3d7ea8b62c93675a8cb9aca34f71e6e979df490cf21"}, "mockery": {:hex, :mockery, "2.3.1", "a02fd60b10ac9ed37a7a2ecf6786c1f1dd5c75d2b079a60594b089fba32dc087", [:mix], [], "hexpm", "1d0971d88ebf084e962da3f2cfee16f0ea8e04ff73a7710428500d4500b947fa"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"}, "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.0", "5a3a9becf67d4006377c4c247ffdaaa8ae5b3634a0caadb788dc24d6125068f4", [:mix], [], "hexpm", "4ad6f6421163cd8204509a119a5c9813cbb969cfb8d802a9dc49b968bffbac2a"}, + "qex": {:hex, :qex, "0.5.1", "0d82c0f008551d24fffb99d97f8299afcb8ea9cf99582b770bd004ed5af63fd6", [:mix], [], "hexpm", "935a39fdaf2445834b95951456559e9dc2063d0a055742c558a99987b38d6bab"}, "ratio": {:hex, :ratio, "2.4.2", "c8518f3536d49b1b00d88dd20d49f8b11abb7819638093314a6348139f14f9f9", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:numbers, "~> 5.2.0", [hex: :numbers, repo: "hexpm", optional: false]}], "hexpm", "441ef6f73172a3503de65ccf1769030997b0d533b1039422f1e5e0e0b4cbf89e"}, - "telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"}, + "telemetry": {:hex, :telemetry, "1.0.0", "0f453a102cdf13d506b7c0ab158324c337c41f1cc7548f0bc0e130bbf0ae9452", [:rebar3], [], "hexpm", "73bc09fa59b4a0284efb4624335583c528e07ec9ae76aca96ea0673850aec57a"}, } diff --git a/test/fixtures/capture.dump b/test/fixtures/capture.dump index d88ba737bd23a3eba98936cc469713c537109364..3315975fc5000c33ba3cd3ef9d49a47bbda3c337 100644 GIT binary patch delta 8905 zcmZ8md0dUzAHL_LxKdh%noLe`28dS*Wmc)91(n`(PQ_WDgJ_sDG)6 zhT^B+S`Wmo4=9i+!~syG!2>^*kqSFkrS)Zhz^fhPL9~j7&1V5p;MfoG2ITbv=o+VF z%FVkf9S?QVppxm(1+t=P{Vu>U8E%R=qc#@-G;f3%8c&sS0HEKEoFuDSTwe>2@h--Q z=lSDOfIb+#4x!V6y*Mf;$JT2nk7J2dg(Iu;=9+Mt^z#=zkf{H(7J#~scap8z{xKdP z#vX9RU6ny&B!HGqT!O|78}>hr3YC+uXszOvaP0hF?%xh0gtPfbBD||bvNG3{+3%ly#e{3!1c*^1wxgaL2Py7&uS~+)#A!G`@mKuE6 z2Gr;`%VHs_UfF=C+p?|@x}r{Nm>0d8_%KM&ooWBTM>0{e47G&9LUbq`_Toxs*)IQF z)VgB0IpDbit8S|=0z{=e=w?9V@r0c}-q0HLS?H*lzZ4T`15B!v%LbcqisT&KM;7#r zhC{W)WXT1P^?*Rh{k)W@4!(ZCcai{k$=r<(Y6Eui5_bi z#%Ypmk{v=*?~MXzZ8G0n11DC3g)d0qo2%OD*Hse$Z_Upc$m)noo*Wg9q*iOK@(o07 z)n0^ks#3l>=EG^y;B*IM_2&M00DZFgl$6>gtw0(P~Vvs7`)4_Phw=NumKwpWV?z4fgfM+JwvyFeD5d0F+V zWMV}<+(vU79A!kk14X$G=aN#?-AT|YJSQc;`|!9^DOC<`fT?WacUQG;pI#mu70e&h z0ITHaIi5iL!&xv{_3XeVYAa4I`tPMlCw;-o?V zM|C6Nu!i9ch;6ha_=xdwt^izTE3#56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N7g)L$tE`Q$#%lX41qghop>*w0Jx6-&jP zf6;gY80`J0I8|c(%Mm14`~nLkxVq9jjD|L)3cr-t#c!~$1h>D#6P%SA4wiFVi#)U# O-OF%lU}I?u5c5AoLb7oH diff --git a/test/serializer_test.exs b/test/serializer_test.exs index a276969..9c83009 100644 --- a/test/serializer_test.exs +++ b/test/serializer_test.exs @@ -55,8 +55,8 @@ defmodule Membrane.Element.IVF.SerializerTest do correctly calculates timestamp in frame header. """ test "appends headers correctly" do - buffer_1 = %Buffer{payload: @frame, metadata: %{timestamp: 0}} - buffer_2 = %Buffer{payload: @frame, metadata: %{timestamp: 100_000_000 <|> 3}} + buffer_1 = %Buffer{payload: @frame, pts: 0} + buffer_2 = %Buffer{payload: @frame, pts: 100_000_000 <|> 3} {:ok, pipeline} = %Testing.Pipeline.Options{ From f46cbf8a788b94dd72442db7479c8986a4af490d Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Sat, 4 Dec 2021 19:36:27 +0100 Subject: [PATCH 02/14] delete dead path --- lib/deserializer.ex | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/deserializer.ex b/lib/deserializer.ex index f3793bb..16eddd0 100644 --- a/lib/deserializer.ex +++ b/lib/deserializer.ex @@ -67,12 +67,9 @@ defmodule Membrane.Element.IVF.Deserializer do def handle_process(:input, buffer, _ctx, state) do state = %State{state | frame_acc: state.frame_acc <> buffer.payload} - with {:ok, buffers, state} <- flush_acc(state, []) do - {{:ok, buffer: {:output, buffers}, redemand: :output}, state} - else - {:error_too_short, payload} -> - {{:ok, redemand: :output}, %State{state | frame_acc: payload}} - end + {:ok, buffers, state} = flush_acc(state, []) + + {{:ok, buffer: {:output, buffers}, redemand: :output}, state} end defp flush_acc(state, buffers) do From 99ba7fe64b09bf2300bb6c0dc25d40c4f75be559 Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Sat, 4 Dec 2021 19:45:31 +0100 Subject: [PATCH 03/14] prepare release --- CHANGELOG.md | 3 +++ README.md | 2 +- mix.exs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ac2c8..73eec54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.3.0 +### Release notes: + * Use new buffer pts field instead of metadata.timestamp #8 ## 0.2.0 ### Release notes: * serialization and deserialization of IVF files #4 diff --git a/README.md b/README.md index 23d3cf0..5635f85 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The package can be installed by adding `membrane_ivf_plugin` to your list of dep ```elixir def deps do [ - {:membrane_ivf_plugin, "~> 0.2.0"} + {:membrane_ivf_plugin, "~> 0.3.0"} ] end ``` diff --git a/mix.exs b/mix.exs index 17d4e69..40881ff 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.IVF.Plugin.MixProject do use Mix.Project - @version "0.2.0" + @version "0.3.0" @github_url "https://github.com/membraneframework/membrane_ivf_plugin" def project do From 02f7314de89d59008fc4592136c454e1921cebea Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Mon, 6 Dec 2021 15:51:57 +0100 Subject: [PATCH 04/14] test if passing 0x0 resolution yields valid ivfs --- lib/serializer.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/serializer.ex b/lib/serializer.ex index a5d6621..a0d409f 100644 --- a/lib/serializer.ex +++ b/lib/serializer.ex @@ -10,8 +10,8 @@ defmodule Membrane.Element.IVF.Serializer do alias Membrane.{Buffer, RemoteStream} alias Membrane.{VP9, VP8} - def_options width: [spec: [integer], description: "width of frame"], - height: [spec: [integer], description: "height of frame"], + def_options width: [spec: [integer], default: 0, description: "width of frame"], + height: [spec: [integer], default: 0, description: "height of frame"], scale: [spec: [integer], default: 1, description: "scale"], rate: [spec: [integer], default: 1_000_000, description: "rate"], frame_count: [spec: [integer], default: 0, description: "number of frames"] From 15d97ef278b7d20a9cf00a9e80e1458c1d813d66 Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Mon, 6 Dec 2021 21:41:33 +0100 Subject: [PATCH 05/14] serializer now accepts plain vp8/9 caps; allow passing options via caps --- lib/membrane_element_ivf/headers.ex | 2 + lib/serializer.ex | 71 +++++++++++++++++++++-------- mix.exs | 4 ++ mix.lock | 2 + 4 files changed, 59 insertions(+), 20 deletions(-) diff --git a/lib/membrane_element_ivf/headers.ex b/lib/membrane_element_ivf/headers.ex index 889b001..23576e7 100644 --- a/lib/membrane_element_ivf/headers.ex +++ b/lib/membrane_element_ivf/headers.ex @@ -81,7 +81,9 @@ defmodule Membrane.Element.IVF.Headers do codec_four_cc = case caps do %Membrane.RemoteStream{content_format: VP9} -> "VP90" + %VP9{} -> "VP90" %Membrane.RemoteStream{content_format: VP8} -> "VP80" + %VP8{} -> "VP80" _unknown -> "\0\0\0\0" end diff --git a/lib/serializer.ex b/lib/serializer.ex index a0d409f..0dd6874 100644 --- a/lib/serializer.ex +++ b/lib/serializer.ex @@ -17,28 +17,38 @@ defmodule Membrane.Element.IVF.Serializer do frame_count: [spec: [integer], default: 0, description: "number of frames"] def_input_pad :input, - caps: {RemoteStream, content_format: one_of([VP9, VP8]), type: :packetized}, + caps: [ + VP8, + VP9, + {RemoteStream, content_format: one_of([VP8, VP9]), type: :packetized} + ], demand_unit: :buffers def_output_pad :output, caps: :any defmodule State do @moduledoc false - defstruct [:width, :height, :timebase, :first_frame, :frame_count] + defstruct [:width, :height, :scale, :rate, :timebase, :frame_count, first_frame: true] end @impl true def handle_init(options) do - use Ratio + update_state(%State{}, options) + end + + @impl true + def handle_caps(:input, %VP8{} = caps, _ctx, state) do + update_state(state, caps) + end + + @impl true + def handle_caps(:input, %VP9{} = caps, _ctx, state) do + update_state(state, caps) + end - {:ok, - %State{ - width: options.width, - height: options.height, - timebase: options.scale <|> options.rate, - frame_count: options.frame_count, - first_frame: true - }} + @impl true + def handle_caps(_, _, _, state) do + {:ok, state} end @impl true @@ -55,19 +65,40 @@ defmodule Membrane.Element.IVF.Serializer do frame ivf_file_header = - if state.first_frame, - do: - IVF.Headers.create_ivf_header( - state.width, - state.height, - state.timebase, - state.frame_count, - ctx.pads.input.caps - ) + if state.first_frame do + if state.width == 0 or state.height == 0, + do: + IO.warn("Serializing stream to IVF without width or height given via options or caps") + + IVF.Headers.create_ivf_header( + state.width, + state.height, + state.timebase, + state.frame_count, + ctx.pads.input.caps + ) + end ivf_buffer = (ivf_file_header || "") <> ivf_frame {{:ok, buffer: {:output, %Buffer{buffer | payload: ivf_buffer}}, redemand: :output}, %State{state | first_frame: false}} end + + defp update_state(state, new_fields) do + use Ratio + + instantiated_fields = + new_fields + |> Map.from_struct() + |> Enum.filter(fn {_, v} -> v != nil end) + |> Enum.into(%{}) + + new_state = + state + |> Map.from_struct() + |> Map.merge(instantiated_fields) + + {:ok, struct!(State, %{new_state | timebase: new_state.scale <|> new_state.rate})} + end end diff --git a/mix.exs b/mix.exs index aaa35e6..2147d0b 100644 --- a/mix.exs +++ b/mix.exs @@ -37,6 +37,10 @@ defmodule Membrane.IVF.Plugin.MixProject do defp deps do [ {:membrane_core, "~> 0.8.0"}, + {:membrane_vp8_format, + github: "membraneframework/membrane_vp8_format", branch: "add-stream-params"}, + {:membrane_vp9_format, + github: "membraneframework/membrane_vp9_format", branch: "add-stream-params"}, {:ex_doc, "~> 0.24", only: :dev, runtime: false}, {:dialyxir, "~> 1.1.0", only: :dev, runtime: false}, {:credo, "~> 1.4", only: :dev, runtime: false}, diff --git a/mix.lock b/mix.lock index 78d1a56..a42a90d 100644 --- a/mix.lock +++ b/mix.lock @@ -14,6 +14,8 @@ "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, "membrane_core": {:hex, :membrane_core, "0.8.1", "33df0e4c76c05a2be57042893b05516886462baefdf95b7299e4d2f5db32dea3", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 2.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5574db35f08de1e95648f9c3acce38c5f318216c5a5ae5e3f253f7edad8fdc1b"}, "membrane_file_plugin": {:hex, :membrane_file_plugin, "0.7.0", "200e416e50e1545473fcfc9020253a797bf884f7d238227466e67266e7e71e5e", [:mix], [{:membrane_core, "~> 0.8.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.2", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "9efe63c780a021552293f3d7ea8b62c93675a8cb9aca34f71e6e979df490cf21"}, + "membrane_vp8_format": {:git, "https://github.com/membraneframework/membrane_vp8_format.git", "b3a2e03181db7d7f8afd74d2a675b6f7be9fdee0", [branch: "add-stream-params"]}, + "membrane_vp9_format": {:git, "https://github.com/membraneframework/membrane_vp9_format.git", "e1931a21c3f081e97055fa90e0c1822c8a134e13", [branch: "add-stream-params"]}, "mockery": {:hex, :mockery, "2.3.1", "a02fd60b10ac9ed37a7a2ecf6786c1f1dd5c75d2b079a60594b089fba32dc087", [:mix], [], "hexpm", "1d0971d88ebf084e962da3f2cfee16f0ea8e04ff73a7710428500d4500b947fa"}, "nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"}, "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"}, From 1dc59af447b5ba77405fcc6cb619c9be5b0f1c3c Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Mon, 6 Dec 2021 21:49:48 +0100 Subject: [PATCH 06/14] fix credo --- lib/serializer.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/serializer.ex b/lib/serializer.ex index 0dd6874..a6622fa 100644 --- a/lib/serializer.ex +++ b/lib/serializer.ex @@ -47,7 +47,7 @@ defmodule Membrane.Element.IVF.Serializer do end @impl true - def handle_caps(_, _, _, state) do + def handle_caps(_pad, _caps, _ctx, state) do {:ok, state} end From 0f87d88775b45cc7f15eda5e7553373590d46d30 Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Mon, 6 Dec 2021 21:55:18 +0100 Subject: [PATCH 07/14] add release note --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d3d701..75751a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.4.0 ### Release notes: * Use new buffer pts field instead of metadata.timestamp #8 + * Allow vp8/vp9 input caps #9 ## 0.3.0 ### Release notes: * fix lint and bump membrane_core From eaac885b148d506fa19a1b4274ac555e00d15085 Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Mon, 6 Dec 2021 22:16:32 +0100 Subject: [PATCH 08/14] deserializer now sends vp8/vp9 caps --- lib/deserializer.ex | 21 +++++++++++++++++---- test/integration_test.exs | 6 +----- test/serializer_test.exs | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/deserializer.ex b/lib/deserializer.ex index 16eddd0..4cf0910 100644 --- a/lib/deserializer.ex +++ b/lib/deserializer.ex @@ -7,7 +7,7 @@ defmodule Membrane.Element.IVF.Deserializer do use Membrane.Filter use Ratio - alias Membrane.{Time, RemoteStream, Buffer} + alias Membrane.{Time, Buffer} alias Membrane.{VP9, VP8} alias Membrane.Element.IVF.Headers alias Membrane.Element.IVF.Headers.FrameHeader @@ -15,7 +15,7 @@ defmodule Membrane.Element.IVF.Deserializer do def_input_pad :input, caps: :any, demand_unit: :buffers def_output_pad :output, - caps: {RemoteStream, content_format: one_of([VP9, VP8]), type: :packetized} + caps: [VP9, VP8] defmodule State do @moduledoc false @@ -45,8 +45,21 @@ defmodule Membrane.Element.IVF.Deserializer do {:ok, buffer, rest} <- get_buffer(rest, file_header.scale <|> file_header.rate) do caps = case file_header.four_cc do - "VP90" -> %Membrane.RemoteStream{content_format: VP9, type: :packetized} - "VP80" -> %Membrane.RemoteStream{content_format: VP8, type: :packetized} + "VP90" -> + %VP9{ + width: file_header.width, + height: file_header.height, + scale: file_header.scale, + rate: file_header.rate + } + + "VP80" -> + %VP8{ + width: file_header.width, + height: file_header.height, + scale: file_header.scale, + rate: file_header.rate + } end {{:ok, caps: {:output, caps}, buffer: {:output, buffer}, redemand: :output}, diff --git a/test/integration_test.exs b/test/integration_test.exs index c93f073..ce74cea 100644 --- a/test/integration_test.exs +++ b/test/integration_test.exs @@ -21,11 +21,7 @@ defmodule Membrane.Element.IVF.IntegrationTest do children: [ file_source: %Membrane.File.Source{location: options.input.path}, deserializer: IVF.Deserializer, - serializer: %IVF.Serializer{ - width: options.input.width, - height: options.input.height, - rate: 30 - }, + serializer: IVF.Serializer, file_sink: %Membrane.File.Sink{location: options.result_file} ], links: [ diff --git a/test/serializer_test.exs b/test/serializer_test.exs index 9c83009..caa2254 100644 --- a/test/serializer_test.exs +++ b/test/serializer_test.exs @@ -25,11 +25,11 @@ defmodule Membrane.Element.IVF.SerializerTest do spec = %ParentSpec{ children: [ - ivf_serializer: %IVF.Serializer{width: 1080, height: 720, rate: 30}, source: %Testing.Source{ output: Testing.Source.output_from_buffers(options.buffers), caps: %RemoteStream{content_format: VP9, type: :packetized} }, + ivf_serializer: %IVF.Serializer{width: 1080, height: 720, rate: 30}, sink: sink ], links: [ From 510fc23654c1abfbf4444d3d93708a6e6ed28d9d Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Wed, 8 Dec 2021 12:30:44 +0100 Subject: [PATCH 09/14] comments --- lib/deserializer.ex | 6 +++--- lib/serializer.ex | 29 ++++++++++++++++++----------- test/serializer_test.exs | 2 +- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/deserializer.ex b/lib/deserializer.ex index 4cf0910..c80d58c 100644 --- a/lib/deserializer.ex +++ b/lib/deserializer.ex @@ -69,7 +69,7 @@ defmodule Membrane.Element.IVF.Deserializer do timebase: file_header.scale <|> file_header.rate }} else - {:error_too_short, _payload} -> + :error_too_short -> {{:ok, redemand: :output}, state} _error -> @@ -88,7 +88,7 @@ defmodule Membrane.Element.IVF.Deserializer do defp flush_acc(state, buffers) do case get_buffer(state.frame_acc, state.timebase) do {:ok, buffer, rest} -> flush_acc(%State{state | frame_acc: rest}, [buffer | buffers]) - _error -> {:ok, buffers |> Enum.reverse(), state} + _error -> {:ok, Enum.reverse(buffers), state} end end @@ -99,7 +99,7 @@ defmodule Membrane.Element.IVF.Deserializer do timestamp = timestamp * (timebase * Time.second()) {:ok, %Buffer{pts: timestamp, payload: frame}, rest} else - _error -> {:error_too_short, payload} + _error -> :error_too_short end end end diff --git a/lib/serializer.ex b/lib/serializer.ex index a6622fa..e82d6bc 100644 --- a/lib/serializer.ex +++ b/lib/serializer.ex @@ -33,17 +33,26 @@ defmodule Membrane.Element.IVF.Serializer do @impl true def handle_init(options) do - update_state(%State{}, options) + use Ratio + state = apply_params_to_state(%State{}, options) + state = %State{state | timebase: state.scale <|> state.rate} + {:ok, state} end @impl true def handle_caps(:input, %VP8{} = caps, _ctx, state) do - update_state(state, caps) + use Ratio + state = apply_params_to_state(state, caps) + state = %State{state | timebase: state.scale <|> state.rate} + {:ok, state} end @impl true def handle_caps(:input, %VP9{} = caps, _ctx, state) do - update_state(state, caps) + use Ratio + state = apply_params_to_state(state, caps) + state = %State{state | timebase: state.scale <|> state.rate} + {:ok, state} end @impl true @@ -68,7 +77,7 @@ defmodule Membrane.Element.IVF.Serializer do if state.first_frame do if state.width == 0 or state.height == 0, do: - IO.warn("Serializing stream to IVF without width or height given via options or caps") + IO.warn("Serializing stream to IVF without width or height. These parameters can be passed via options or caps") IVF.Headers.create_ivf_header( state.width, @@ -85,11 +94,9 @@ defmodule Membrane.Element.IVF.Serializer do %State{state | first_frame: false}} end - defp update_state(state, new_fields) do - use Ratio - - instantiated_fields = - new_fields + defp apply_params_to_state(state, params) do + non_nil_params = + params |> Map.from_struct() |> Enum.filter(fn {_, v} -> v != nil end) |> Enum.into(%{}) @@ -97,8 +104,8 @@ defmodule Membrane.Element.IVF.Serializer do new_state = state |> Map.from_struct() - |> Map.merge(instantiated_fields) + |> Map.merge(non_nil_params) - {:ok, struct!(State, %{new_state | timebase: new_state.scale <|> new_state.rate})} + struct!(State, new_state) end end diff --git a/test/serializer_test.exs b/test/serializer_test.exs index caa2254..a9fc270 100644 --- a/test/serializer_test.exs +++ b/test/serializer_test.exs @@ -29,7 +29,7 @@ defmodule Membrane.Element.IVF.SerializerTest do output: Testing.Source.output_from_buffers(options.buffers), caps: %RemoteStream{content_format: VP9, type: :packetized} }, - ivf_serializer: %IVF.Serializer{width: 1080, height: 720, rate: 30}, + ivf_serializer: %IVF.Serializer{width: 1080, height: 720, rate: 30, scale: 1}, sink: sink ], links: [ From 48d0186a35b5af69842f0ed38f3bf17f4c25ea5a Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Wed, 8 Dec 2021 13:07:06 +0100 Subject: [PATCH 10/14] remove scale, rate --- lib/deserializer.ex | 8 ++------ lib/serializer.ex | 41 +++++++++++++-------------------------- test/integration_test.exs | 2 +- test/serializer_test.exs | 2 +- 4 files changed, 18 insertions(+), 35 deletions(-) diff --git a/lib/deserializer.ex b/lib/deserializer.ex index c80d58c..e49f135 100644 --- a/lib/deserializer.ex +++ b/lib/deserializer.ex @@ -48,17 +48,13 @@ defmodule Membrane.Element.IVF.Deserializer do "VP90" -> %VP9{ width: file_header.width, - height: file_header.height, - scale: file_header.scale, - rate: file_header.rate + height: file_header.height } "VP80" -> %VP8{ width: file_header.width, - height: file_header.height, - scale: file_header.scale, - rate: file_header.rate + height: file_header.height } end diff --git a/lib/serializer.ex b/lib/serializer.ex index e82d6bc..f4f81cd 100644 --- a/lib/serializer.ex +++ b/lib/serializer.ex @@ -34,25 +34,25 @@ defmodule Membrane.Element.IVF.Serializer do @impl true def handle_init(options) do use Ratio - state = apply_params_to_state(%State{}, options) - state = %State{state | timebase: state.scale <|> state.rate} - {:ok, state} + + {:ok, + %State{ + width: options.width, + height: options.height, + timebase: options.scale <|> options.rate, + frame_count: options.frame_count, + first_frame: true + }} end @impl true def handle_caps(:input, %VP8{} = caps, _ctx, state) do - use Ratio - state = apply_params_to_state(state, caps) - state = %State{state | timebase: state.scale <|> state.rate} - {:ok, state} + {:ok, %State{state | height: caps.height, width: caps.width}} end @impl true def handle_caps(:input, %VP9{} = caps, _ctx, state) do - use Ratio - state = apply_params_to_state(state, caps) - state = %State{state | timebase: state.scale <|> state.rate} - {:ok, state} + {:ok, %State{state | height: caps.height, width: caps.width}} end @impl true @@ -77,7 +77,9 @@ defmodule Membrane.Element.IVF.Serializer do if state.first_frame do if state.width == 0 or state.height == 0, do: - IO.warn("Serializing stream to IVF without width or height. These parameters can be passed via options or caps") + IO.warn( + "Serializing stream to IVF without width or height. These parameters can be passed via options or caps" + ) IVF.Headers.create_ivf_header( state.width, @@ -93,19 +95,4 @@ defmodule Membrane.Element.IVF.Serializer do {{:ok, buffer: {:output, %Buffer{buffer | payload: ivf_buffer}}, redemand: :output}, %State{state | first_frame: false}} end - - defp apply_params_to_state(state, params) do - non_nil_params = - params - |> Map.from_struct() - |> Enum.filter(fn {_, v} -> v != nil end) - |> Enum.into(%{}) - - new_state = - state - |> Map.from_struct() - |> Map.merge(non_nil_params) - - struct!(State, new_state) - end end diff --git a/test/integration_test.exs b/test/integration_test.exs index ce74cea..6527349 100644 --- a/test/integration_test.exs +++ b/test/integration_test.exs @@ -21,7 +21,7 @@ defmodule Membrane.Element.IVF.IntegrationTest do children: [ file_source: %Membrane.File.Source{location: options.input.path}, deserializer: IVF.Deserializer, - serializer: IVF.Serializer, + serializer: %IVF.Serializer{rate: 30}, file_sink: %Membrane.File.Sink{location: options.result_file} ], links: [ diff --git a/test/serializer_test.exs b/test/serializer_test.exs index a9fc270..caa2254 100644 --- a/test/serializer_test.exs +++ b/test/serializer_test.exs @@ -29,7 +29,7 @@ defmodule Membrane.Element.IVF.SerializerTest do output: Testing.Source.output_from_buffers(options.buffers), caps: %RemoteStream{content_format: VP9, type: :packetized} }, - ivf_serializer: %IVF.Serializer{width: 1080, height: 720, rate: 30, scale: 1}, + ivf_serializer: %IVF.Serializer{width: 1080, height: 720, rate: 30}, sink: sink ], links: [ From e1b082471bc1e031273719c7216d4052f175f369 Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Fri, 11 Feb 2022 12:19:02 +0100 Subject: [PATCH 11/14] change warn to membrane logger, update deps --- config/config.exs | 3 +++ config/dev.exs | 3 +++ config/prod.exs | 3 +++ config/test.exs | 3 +++ lib/serializer.ex | 5 +++-- mix.exs | 6 +++--- mix.lock | 16 ++++++++-------- 7 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 config/config.exs create mode 100644 config/dev.exs create mode 100644 config/prod.exs create mode 100644 config/test.exs diff --git a/config/config.exs b/config/config.exs new file mode 100644 index 0000000..de0f2cb --- /dev/null +++ b/config/config.exs @@ -0,0 +1,3 @@ +import Config + +import_config("#{config_env()}.exs") diff --git a/config/dev.exs b/config/dev.exs new file mode 100644 index 0000000..a55f6ea --- /dev/null +++ b/config/dev.exs @@ -0,0 +1,3 @@ +import Config + +config :logger, level: :debug diff --git a/config/prod.exs b/config/prod.exs new file mode 100644 index 0000000..3da7d10 --- /dev/null +++ b/config/prod.exs @@ -0,0 +1,3 @@ +import Config + +config :logger, level: :warn diff --git a/config/test.exs b/config/test.exs new file mode 100644 index 0000000..a55f6ea --- /dev/null +++ b/config/test.exs @@ -0,0 +1,3 @@ +import Config + +config :logger, level: :debug diff --git a/lib/serializer.ex b/lib/serializer.ex index f4f81cd..b9ca8fc 100644 --- a/lib/serializer.ex +++ b/lib/serializer.ex @@ -4,12 +4,13 @@ defmodule Membrane.Element.IVF.Serializer do """ use Membrane.Filter - use Membrane.Log alias Membrane.Element.IVF alias Membrane.{Buffer, RemoteStream} alias Membrane.{VP9, VP8} + require Membrane.Logger + def_options width: [spec: [integer], default: 0, description: "width of frame"], height: [spec: [integer], default: 0, description: "height of frame"], scale: [spec: [integer], default: 1, description: "scale"], @@ -77,7 +78,7 @@ defmodule Membrane.Element.IVF.Serializer do if state.first_frame do if state.width == 0 or state.height == 0, do: - IO.warn( + Membrane.Logger.warn( "Serializing stream to IVF without width or height. These parameters can be passed via options or caps" ) diff --git a/mix.exs b/mix.exs index 2147d0b..20cd843 100644 --- a/mix.exs +++ b/mix.exs @@ -8,7 +8,7 @@ defmodule Membrane.IVF.Plugin.MixProject do [ app: :membrane_ivf_plugin, version: @version, - elixir: "~> 1.12", + elixir: "~> 1.13", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), @@ -27,7 +27,7 @@ defmodule Membrane.IVF.Plugin.MixProject do def application do [ - extra_applications: [] + extra_applications: [:logger] ] end @@ -36,7 +36,7 @@ defmodule Membrane.IVF.Plugin.MixProject do defp deps do [ - {:membrane_core, "~> 0.8.0"}, + {:membrane_core, "~> 0.8.2"}, {:membrane_vp8_format, github: "membraneframework/membrane_vp8_format", branch: "add-stream-params"}, {:membrane_vp9_format, diff --git a/mix.lock b/mix.lock index a42a90d..9d6e00f 100644 --- a/mix.lock +++ b/mix.lock @@ -2,22 +2,22 @@ "bunch": {:hex, :bunch, "1.3.0", "51b4423088b7fb9e21eae6d6bc5e5d219d955ea5556fbd6130bfb6213df4be32", [:mix], [], "hexpm", "9ad233a2bacc0dae8aa6553a9b9057f27446443b1c5903c3479b6f9f3820ce2d"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "coerce": {:hex, :coerce, "1.0.1", "211c27386315dc2894ac11bc1f413a0e38505d808153367bd5c6e75a4003d096", [:mix], [], "hexpm", "b44a691700f7a1a15b4b7e2ff1fa30bebd669929ac8aa43cffe9e2f8bf051cf1"}, - "credo": {:hex, :credo, "1.6.1", "7dc76dcdb764a4316c1596804c48eada9fff44bd4b733a91ccbf0c0f368be61e", [:mix], [{:bunt, "~> 0.2.0", [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", "698607fb5993720c7e93d2d8e76f2175bba024de964e160e2f7151ef3ab82ac5"}, + "credo": {:hex, :credo, "1.6.3", "0a9f8925dbc8f940031b789f4623fc9a0eea99d3eed600fe831e403eb96c6a83", [:mix], [{:bunt, "~> 0.2.0", [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", "1167cde00e6661d740fc54da2ee268e35d3982f027399b64d3e2e83af57a1180"}, "dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.18", "e1b2be73eb08a49fb032a0208bf647380682374a725dfb5b9e510def8397f6f2", [:mix], [], "hexpm", "114a0e85ec3cf9e04b811009e73c206394ffecfcc313e0b346de0d557774ee97"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.19", "de0d033d5ff9fc396a24eadc2fcf2afa3d120841eb3f1004d138cbf9273210e8", [:mix], [], "hexpm", "527ab6630b5c75c3a3960b75844c314ec305c76d9899bb30f71cb85952a9dc45"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "ex_doc": {:hex, :ex_doc, "0.26.0", "1922164bac0b18b02f84d6f69cab1b93bc3e870e2ad18d5dacb50a9e06b542a3", [:mix], [{:earmark_parser, "~> 1.4.0", [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", "2775d66e494a9a48355db7867478ffd997864c61c65a47d31c4949459281c78d"}, + "ex_doc": {:hex, :ex_doc, "0.28.0", "7eaf526dd8c80ae8c04d52ac8801594426ae322b52a6156cd038f30bafa8226f", [:mix], [{:earmark_parser, "~> 1.4.19", [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", "e55cdadf69a5d1f4cfd8477122ebac5e1fadd433a8c1022dafc5025e48db0131"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, + "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"}, "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, "makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, - "membrane_core": {:hex, :membrane_core, "0.8.1", "33df0e4c76c05a2be57042893b05516886462baefdf95b7299e4d2f5db32dea3", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 2.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5574db35f08de1e95648f9c3acce38c5f318216c5a5ae5e3f253f7edad8fdc1b"}, + "membrane_core": {:hex, :membrane_core, "0.8.2", "fe9a1ccd8abb10813a8f30bf00133c229fabdf6512594cf8019416714a4de825", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 2.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e94f00cbba5b25fe640d84dbf65e84e22bba212b9df379900553bf245f55b7d3"}, "membrane_file_plugin": {:hex, :membrane_file_plugin, "0.7.0", "200e416e50e1545473fcfc9020253a797bf884f7d238227466e67266e7e71e5e", [:mix], [{:membrane_core, "~> 0.8.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.2", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "9efe63c780a021552293f3d7ea8b62c93675a8cb9aca34f71e6e979df490cf21"}, - "membrane_vp8_format": {:git, "https://github.com/membraneframework/membrane_vp8_format.git", "b3a2e03181db7d7f8afd74d2a675b6f7be9fdee0", [branch: "add-stream-params"]}, - "membrane_vp9_format": {:git, "https://github.com/membraneframework/membrane_vp9_format.git", "e1931a21c3f081e97055fa90e0c1822c8a134e13", [branch: "add-stream-params"]}, + "membrane_vp8_format": {:git, "https://github.com/membraneframework/membrane_vp8_format.git", "5a954c6023606731a041934b15cfc26feab6469b", [branch: "add-stream-params"]}, + "membrane_vp9_format": {:git, "https://github.com/membraneframework/membrane_vp9_format.git", "af223b0f32ad67f367d32259f69af904736a9e6f", [branch: "add-stream-params"]}, "mockery": {:hex, :mockery, "2.3.1", "a02fd60b10ac9ed37a7a2ecf6786c1f1dd5c75d2b079a60594b089fba32dc087", [:mix], [], "hexpm", "1d0971d88ebf084e962da3f2cfee16f0ea8e04ff73a7710428500d4500b947fa"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.2.1", "264fc6864936b59fedb3ceb89998c64e9bb91945faf1eb115d349b96913cc2ef", [:mix], [], "hexpm", "23c31d0ec38c97bf9adde35bc91bc8e1181ea5202881f48a192f4aa2d2cf4d59"}, "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, "2.4.2", "c8518f3536d49b1b00d88dd20d49f8b11abb7819638093314a6348139f14f9f9", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:numbers, "~> 5.2.0", [hex: :numbers, repo: "hexpm", optional: false]}], "hexpm", "441ef6f73172a3503de65ccf1769030997b0d533b1039422f1e5e0e0b4cbf89e"}, From fad3b140972b1d314b1a0a2cd7d2647e3f41154b Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Fri, 11 Feb 2022 12:20:31 +0100 Subject: [PATCH 12/14] require elixir 1.12 --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 20cd843..5823832 100644 --- a/mix.exs +++ b/mix.exs @@ -8,7 +8,7 @@ defmodule Membrane.IVF.Plugin.MixProject do [ app: :membrane_ivf_plugin, version: @version, - elixir: "~> 1.13", + elixir: "~> 1.12", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), From bd965b4d6c8b8569dd903b84d8649237d79b4cff Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Fri, 11 Feb 2022 14:43:33 +0100 Subject: [PATCH 13/14] change pts to dts --- CHANGELOG.md | 2 +- lib/deserializer.ex | 2 +- lib/serializer.ex | 2 +- test/fixtures/capture.dump | Bin 198287 -> 198287 bytes test/serializer_test.exs | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75751a6..d8e977f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.4.0 ### Release notes: - * Use new buffer pts field instead of metadata.timestamp #8 + * Use new buffer dts field instead of metadata.timestamp * Allow vp8/vp9 input caps #9 ## 0.3.0 ### Release notes: diff --git a/lib/deserializer.ex b/lib/deserializer.ex index e49f135..e6b996a 100644 --- a/lib/deserializer.ex +++ b/lib/deserializer.ex @@ -93,7 +93,7 @@ defmodule Membrane.Element.IVF.Deserializer do Headers.parse_ivf_frame_header(payload), <> <- rest do timestamp = timestamp * (timebase * Time.second()) - {:ok, %Buffer{pts: timestamp, payload: frame}, rest} + {:ok, %Buffer{dts: timestamp, payload: frame}, rest} else _error -> :error_too_short end diff --git a/lib/serializer.ex b/lib/serializer.ex index b9ca8fc..327f204 100644 --- a/lib/serializer.ex +++ b/lib/serializer.ex @@ -68,7 +68,7 @@ defmodule Membrane.Element.IVF.Serializer do @impl true def handle_process(:input, buffer, ctx, state) do - %Buffer{payload: frame, pts: timestamp} = buffer + %Buffer{payload: frame, dts: timestamp} = buffer ivf_frame = IVF.Headers.create_ivf_frame_header(byte_size(frame), timestamp, state.timebase) <> diff --git a/test/fixtures/capture.dump b/test/fixtures/capture.dump index 3315975fc5000c33ba3cd3ef9d49a47bbda3c337..04f5ad3815503c104f2ed38f1f3c071c6a4b701a 100644 GIT binary patch delta 7542 zcmZ8mc|cBC6z|^e^-UBiCSe+pNhCDch4L9?Y?EZLVd6NBVU-Vj5^$d)AL zVeGpUN|QB`Wt1hUkcOG}?z!)EZ~xx&&hP%tde6NtZnah1YOA##M#H3;KLnVix!-pZ zBVF9EVUpy9+sZk!UZwwV$+t!c#n{D*?9&M3tPF>Qndr=$6~EkS4G>~ zI!42r%L&H3)+bpE!69ohS#RXlhyk&Deuk{tw(~_SN~ zeW=1j$p%2tJe@V%OXp2tDsh7P{r*u6Sr~PLJMTBDl3m|VWso{*F)W>B6Ja5m_J*XFPp`)?^7(NU0ZM-oxt9BU z$xQg%ex@b29yS}+&1Wwo>)>cL!3dveQ3W;lxP-hSd|u2IYsR2fKsgZwEVO4R`Og>x zl)hiwnem26+`80AEarJJOf41_NPH(gVE70J zOFP2na}z|y)g~d~pY9+ik(8bEo)ywB2ME30p!6Hs`MmQ@!iXC_@cqL?rQzsRV-mVt z9teWxn-iHDi|mySgr+6sGdSYb?E*2lXq%Ej4F28S;{nF=55+*GT|(^Vbo>SQ^h^GW ziLgo7yk03$)uG9|fj`uSNm#Th5~X|ZeaRTL&~+AYu}QtpQum5l2pH@3|G|Mb3y%gt zW$HObovSS!%enghx^u z7vU6?QLLR4O7O)AnectZ6@G)1@(kD@`RW%ukkaP}r5)G3SxTZ~E`)zoj*>NuoBZnH^_($5us!n(6n5VZW{`ZyuJ7*l<$bO6Q6g}>&o&~Hc&Y#l z8&=Sjb&#-rgBd0Yk%dslI-P}g_7cH^$I59}?NVW6j1_3CdwPNmoA_HXY~fMtNb*`o z8h8BwLF)9P16TT0L0m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th>gq6O*(k!@9)~5ess;Rd*DU_t)d@kxLL3jBR;`a9;&P3MbzS#-t_;M*SMPQzGWGg8T zO}R0R*C3y}(u{8P??^P;6>{2^KAE|ZXf`k62Qd!i@MF{D8+Dc0Pk8~cy0E(kk?ryq zkH%#qjZN7{WH%LaQtL`R_8uhQ&=UTR+8y7it5H{co)p@kW%3Eaax3FAh|{yB#Hr|0 z&KZ@|dZDKLI9Ku;NR@U)WDwm4Z_RGd*r_=L-1eRipt>!Z`I8i6ec--C*KhbELaq3h vUm*Eu)9(p_$~dOWBAM0IA3$X7bUN~Ck%~P_ktrrx>e}O&me*X~SWW#u@qm*` diff --git a/test/serializer_test.exs b/test/serializer_test.exs index caa2254..eba32f7 100644 --- a/test/serializer_test.exs +++ b/test/serializer_test.exs @@ -55,8 +55,8 @@ defmodule Membrane.Element.IVF.SerializerTest do correctly calculates timestamp in frame header. """ test "appends headers correctly" do - buffer_1 = %Buffer{payload: @frame, pts: 0} - buffer_2 = %Buffer{payload: @frame, pts: 100_000_000 <|> 3} + buffer_1 = %Buffer{payload: @frame, dts: 0} + buffer_2 = %Buffer{payload: @frame, dts: 100_000_000 <|> 3} {:ok, pipeline} = %Testing.Pipeline.Options{ From 3041ffdce34d261e3cb41e0f3bd69f42995b67fb Mon Sep 17 00:00:00 2001 From: Maks Stachowiak Date: Wed, 9 Mar 2022 10:57:49 +0100 Subject: [PATCH 14/14] 0.9 --- mix.exs | 2 +- mix.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index 5823832..1571a5a 100644 --- a/mix.exs +++ b/mix.exs @@ -36,7 +36,7 @@ defmodule Membrane.IVF.Plugin.MixProject do defp deps do [ - {:membrane_core, "~> 0.8.2"}, + {:membrane_core, "~> 0.9.0", override: true}, {:membrane_vp8_format, github: "membraneframework/membrane_vp8_format", branch: "add-stream-params"}, {:membrane_vp9_format, diff --git a/mix.lock b/mix.lock index 9d6e00f..e1dfe94 100644 --- a/mix.lock +++ b/mix.lock @@ -12,7 +12,7 @@ "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, "makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"}, "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, - "membrane_core": {:hex, :membrane_core, "0.8.2", "fe9a1ccd8abb10813a8f30bf00133c229fabdf6512594cf8019416714a4de825", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 2.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e94f00cbba5b25fe640d84dbf65e84e22bba212b9df379900553bf245f55b7d3"}, + "membrane_core": {:hex, :membrane_core, "0.9.0", "91a79636c6b2fcc6ae2e611670cdca33a0b38ff4dabe8fb7c1d56cba426db787", [:mix], [{:bunch, "~> 1.3", [hex: :bunch, repo: "hexpm", optional: false]}, {:qex, "~> 0.3", [hex: :qex, repo: "hexpm", optional: false]}, {:ratio, "~> 2.0", [hex: :ratio, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ab252e7aa944d23fbb22ce0e8bc75b088cfe3ed1c2c7ba203b1cc2fd794a85ed"}, "membrane_file_plugin": {:hex, :membrane_file_plugin, "0.7.0", "200e416e50e1545473fcfc9020253a797bf884f7d238227466e67266e7e71e5e", [:mix], [{:membrane_core, "~> 0.8.0", [hex: :membrane_core, repo: "hexpm", optional: false]}, {:mockery, "~> 2.2", [hex: :mockery, repo: "hexpm", optional: false]}], "hexpm", "9efe63c780a021552293f3d7ea8b62c93675a8cb9aca34f71e6e979df490cf21"}, "membrane_vp8_format": {:git, "https://github.com/membraneframework/membrane_vp8_format.git", "5a954c6023606731a041934b15cfc26feab6469b", [branch: "add-stream-params"]}, "membrane_vp9_format": {:git, "https://github.com/membraneframework/membrane_vp9_format.git", "af223b0f32ad67f367d32259f69af904736a9e6f", [branch: "add-stream-params"]},