Skip to content

Commit fef8ea8

Browse files
committed
Update to core 0.11.0 (#13)
* Update to core 0.11.0 * Bump version to 0.5.0
1 parent df182bb commit fef8ea8

File tree

8 files changed

+77
-84
lines changed

8 files changed

+77
-84
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The package can be installed by adding `membrane_ivf_plugin` to your list of dep
1515
```elixir
1616
def deps do
1717
[
18-
{:membrane_ivf_plugin, "~> 0.4.1"}
18+
{:membrane_ivf_plugin, "~> 0.5.0"}
1919
]
2020
end
2121
```

lib/deserializer.ex

+14-13
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ defmodule Membrane.Element.IVF.Deserializer do
1212
alias Membrane.{Buffer, RemoteStream, Time}
1313
alias Membrane.{VP8, VP9}
1414

15-
def_input_pad :input, caps: :any, demand_mode: :auto, demand_unit: :buffers
15+
def_input_pad :input, accepted_format: _any, demand_mode: :auto, demand_unit: :buffers
1616

1717
def_output_pad :output,
18-
caps: {RemoteStream, content_format: one_of([VP9, VP8]), type: :packetized},
18+
accepted_format:
19+
%RemoteStream{content_format: format, type: :packetized} when format in [VP9, VP8],
1920
demand_mode: :auto
2021

2122
defmodule State do
@@ -29,15 +30,15 @@ defmodule Membrane.Element.IVF.Deserializer do
2930
end
3031

3132
@impl true
32-
def handle_init(_options) do
33-
{:ok, %State{}}
33+
def handle_init(_ctx, _options) do
34+
{[], %State{}}
3435
end
3536

3637
@impl true
37-
def handle_caps(_pad, _caps, _ctx, state) do
38-
# ignore incoming caps, we will send our own
38+
def handle_stream_format(_pad, _stream_format, _ctx, state) do
39+
# ignore incoming stream_format, we will send our own
3940
# in handle_process
40-
{:ok, state}
41+
{[], state}
4142
end
4243

4344
@impl true
@@ -46,21 +47,21 @@ defmodule Membrane.Element.IVF.Deserializer do
4647

4748
with {:ok, file_header, rest} <- Headers.parse_ivf_header(state.frame_acc),
4849
{:ok, buffer, rest} <- get_buffer(rest, file_header.scale <|> file_header.rate) do
49-
caps =
50+
stream_format =
5051
case file_header.four_cc do
5152
"VP90" -> %Membrane.RemoteStream{content_format: VP9, type: :packetized}
5253
"VP80" -> %Membrane.RemoteStream{content_format: VP8, type: :packetized}
5354
end
5455

55-
{{:ok, caps: {:output, caps}, buffer: {:output, buffer}},
56+
{[stream_format: {:output, stream_format}, buffer: {:output, buffer}],
5657
%State{
5758
frame_acc: rest,
5859
start_of_stream?: false,
5960
timebase: file_header.scale <|> file_header.rate
6061
}}
6162
else
6263
{:error, :too_short} ->
63-
{:ok, state}
64+
{[], state}
6465

6566
{:error, reason} ->
6667
raise "Deserialization of IVF failed with reason: `#{inspect(reason)}`"
@@ -72,10 +73,10 @@ defmodule Membrane.Element.IVF.Deserializer do
7273

7374
case flush_acc(state, []) do
7475
{:ok, buffers, state} ->
75-
{{:ok, buffer: {:output, buffers}}, state}
76+
{[buffer: {:output, buffers}], state}
7677

7778
{:error, :too_short} ->
78-
{:ok, state}
79+
{[], state}
7980
end
8081
end
8182

@@ -90,7 +91,7 @@ defmodule Membrane.Element.IVF.Deserializer do
9091
defp get_buffer(payload, timebase) do
9192
with {:ok, %FrameHeader{size_of_frame: size_of_frame, timestamp: timestamp}, rest} <-
9293
Headers.parse_ivf_frame_header(payload),
93-
<<frame::binary-size(size_of_frame), rest::binary()>> <- rest do
94+
<<frame::binary-size(size_of_frame), rest::binary>> <- rest do
9495
timestamp = Time.seconds(timestamp * timebase)
9596
{:ok, %Buffer{pts: timestamp, payload: frame}, rest}
9697
else

lib/membrane_element_ivf/headers.ex

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ defmodule Membrane.Element.IVF.Headers do
7474
# bytes 24-27 number of frames in file
7575
# bytes 28-31 unused
7676
@spec create_ivf_header(integer, integer, Ratio.t(), integer, any) :: binary
77-
def create_ivf_header(width, height, timebase, frame_count, caps) do
77+
def create_ivf_header(width, height, timebase, frame_count, stream_format) do
7878
codec_four_cc =
79-
case caps do
79+
case stream_format do
8080
%Membrane.RemoteStream{content_format: VP9} -> "VP90"
8181
%Membrane.RemoteStream{content_format: VP8} -> "VP80"
8282
_unknown -> "\0\0\0\0"
@@ -113,7 +113,7 @@ defmodule Membrane.Element.IVF.Headers do
113113
def parse_ivf_frame_header(payload) when byte_size(payload) < 12,
114114
do: {:error, :too_short}
115115

116-
def parse_ivf_frame_header(<<size_of_frame::32-little, timestamp::64-little, rest::binary()>>) do
116+
def parse_ivf_frame_header(<<size_of_frame::32-little, timestamp::64-little, rest::binary>>) do
117117
{:ok, %FrameHeader{size_of_frame: size_of_frame, timestamp: timestamp}, rest}
118118
end
119119

@@ -124,7 +124,7 @@ defmodule Membrane.Element.IVF.Headers do
124124
def parse_ivf_header(
125125
<<signature::binary-size(4), version::16-little, length_of_header::16-little,
126126
four_cc::binary-size(4), width::16-little, height::16-little, rate::32-little,
127-
scale::32-little, frame_count::32-little, _unused::32, rest::binary()>>
127+
scale::32-little, frame_count::32-little, _unused::32, rest::binary>>
128128
) do
129129
if String.valid?(signature) and String.valid?(four_cc) do
130130
{:ok,

lib/serializer.ex

+8-7
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,22 @@ defmodule Membrane.Element.IVF.Serializer do
1616
frame_count: [spec: [integer], default: 0, description: "number of frames"]
1717

1818
def_input_pad :input,
19-
caps: {RemoteStream, content_format: one_of([VP9, VP8]), type: :packetized},
19+
accepted_format:
20+
%RemoteStream{content_format: format, type: :packetized} when format in [VP9, VP8],
2021
demand_unit: :buffers
2122

22-
def_output_pad :output, caps: :any
23+
def_output_pad :output, accepted_format: _any
2324

2425
defmodule State do
2526
@moduledoc false
2627
defstruct [:width, :height, :timebase, :first_frame, :frame_count]
2728
end
2829

2930
@impl true
30-
def handle_init(options) do
31+
def handle_init(_ctx, options) do
3132
use Ratio
3233

33-
{:ok,
34+
{[],
3435
%State{
3536
width: options.width,
3637
height: options.height,
@@ -42,7 +43,7 @@ defmodule Membrane.Element.IVF.Serializer do
4243

4344
@impl true
4445
def handle_demand(:output, size, :buffers, _ctx, state) do
45-
{{:ok, demand: {:input, size}}, state}
46+
{[demand: {:input, size}], state}
4647
end
4748

4849
@impl true
@@ -61,12 +62,12 @@ defmodule Membrane.Element.IVF.Serializer do
6162
state.height,
6263
state.timebase,
6364
state.frame_count,
64-
ctx.pads.input.caps
65+
ctx.pads.input.stream_format
6566
)
6667

6768
ivf_buffer = (ivf_file_header || "") <> ivf_frame
6869

69-
{{:ok, buffer: {:output, %Buffer{buffer | payload: ivf_buffer}}, redemand: :output},
70+
{[buffer: {:output, %Buffer{buffer | payload: ivf_buffer}}, redemand: :output],
7071
%State{state | first_frame: false}}
7172
end
7273
end

mix.exs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.IVF.Plugin.MixProject do
22
use Mix.Project
33

4-
@version "0.4.1"
4+
@version "0.5.0"
55
@github_url "https://github.com/membraneframework/membrane_ivf_plugin"
66

77
def project do
@@ -37,11 +37,11 @@ defmodule Membrane.IVF.Plugin.MixProject do
3737

3838
defp deps do
3939
[
40-
{:membrane_core, github: "membraneframework/membrane_core", override: true},
40+
{:membrane_core, "~> 0.11.0"},
4141
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
4242
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
4343
{:credo, ">= 0.0.0", only: :dev, runtime: false},
44-
{:membrane_file_plugin, "~> 0.12.0", only: :test}
44+
{:membrane_file_plugin, "~> 0.13.0", only: :test}
4545
]
4646
end
4747

mix.lock

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
%{
2-
"bunch": {:hex, :bunch, "1.3.1", "f8fe80042f9eb474ef2801ae2c9372f9b13d11e7053265dcfc24b9d912e3750b", [:mix], [], "hexpm", "00e21b16ff9bb698b728a01a2fc4b3bf7fc0e87c4bb9c6e4a442324aa8c5e567"},
2+
"bunch": {:hex, :bunch, "1.5.0", "78530e85bc3f53e1711dba654565692e2015cb6d1685e9b53bf7606b14a36c71", [:mix], [], "hexpm", "2c32f8da5d4c9e7a534c8c25aea150da696dd8624ce64f97c21ee193c12258e5"},
33
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
44
"coerce": {:hex, :coerce, "1.0.1", "211c27386315dc2894ac11bc1f413a0e38505d808153367bd5c6e75a4003d096", [:mix], [], "hexpm", "b44a691700f7a1a15b4b7e2ff1fa30bebd669929ac8aa43cffe9e2f8bf051cf1"},
5-
"credo": {:hex, :credo, "1.6.6", "f51f8d45db1af3b2e2f7bee3e6d3c871737bda4a91bff00c5eec276517d1a19c", [: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", "625520ce0984ee0f9f1f198165cd46fa73c1e59a17ebc520038b8fce056a5bdc"},
5+
"credo": {:hex, :credo, "1.6.7", "323f5734350fd23a456f2688b9430e7d517afb313fbd38671b8a4449798a7854", [: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", "41e110bfb007f7eda7f897c10bf019ceab9a0b269ce79f015d54b0dcf4fc7dd3"},
66
"dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"},
7-
"earmark_parser": {:hex, :earmark_parser, "1.4.26", "f4291134583f373c7d8755566122908eb9662df4c4b63caa66a0eabe06569b0a", [:mix], [], "hexpm", "48d460899f8a0c52c5470676611c01f64f3337bad0b26ddab43648428d94aabc"},
7+
"earmark_parser": {:hex, :earmark_parser, "1.4.29", "149d50dcb3a93d9f3d6f3ecf18c918fb5a2d3c001b5d3305c926cddfbd33355b", [:mix], [], "hexpm", "4902af1b3eb139016aed210888748db8070b8125c2342ce3dcae4f38dcc63503"},
88
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
9-
"ex_doc": {:hex, :ex_doc, "0.28.5", "3e52a6d2130ce74d096859e477b97080c156d0926701c13870a4e1f752363279", [: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", "d2c4b07133113e9aa3e9ba27efb9088ba900e9e51caa383919676afdf09ab181"},
9+
"ex_doc": {:hex, :ex_doc, "0.29.0", "4a1cb903ce746aceef9c1f9ae8a6c12b742a5461e6959b9d3b24d813ffbea146", [: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", "f096adb8bbca677d35d278223361c7792d496b3fc0d0224c9d4bc2f651af5db1"},
1010
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
11-
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
11+
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
1212
"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"},
1313
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
1414
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
15-
"membrane_core": {:git, "https://github.com/membraneframework/membrane_core.git", "33c0b4b3419426233d6898f873d7bb045025948c", []},
16-
"membrane_file_plugin": {:hex, :membrane_file_plugin, "0.12.0", "eb940e7a2f2abf30e048bd0b7c2bef9c17c18aa58875b9a833c0bc7e7b1fd709", [:mix], [{:membrane_core, "~> 0.10.0", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "281b9bf9467beead3f973adce55b9844bc4206bb3f3f60f0db8320a4af4fc5ca"},
15+
"membrane_core": {:hex, :membrane_core, "0.11.0", "63ae9f56834ec67680d634d8d69f71b2d46b94f4a0ec8fafcf22d8ce216b8f41", [:mix], [{:bunch, "~> 1.5", [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", "097584018fe948fa3013bfd6bcf002b3ad7cbd13f2259be4f1903f37a7aad7ab"},
16+
"membrane_file_plugin": {:hex, :membrane_file_plugin, "0.13.0", "5d82476706410d372718208b48ace8bbf131f4466bca8f88ca015ebc4dbf5bad", [:mix], [{:membrane_core, "~> 0.11", [hex: :membrane_core, repo: "hexpm", optional: false]}], "hexpm", "efa63530c1a9cf7e8da6ca5b3af9598573a007c89fc7bedf02ffe4ffc1753e66"},
1717
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
1818
"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"},
1919
"qex": {:hex, :qex, "0.5.1", "0d82c0f008551d24fffb99d97f8299afcb8ea9cf99582b770bd004ed5af63fd6", [:mix], [], "hexpm", "935a39fdaf2445834b95951456559e9dc2063d0a055742c558a99987b38d6bab"},

test/integration_test.exs

+18-23
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,25 @@ defmodule Membrane.Element.IVF.IntegrationTest do
1616
use Membrane.Pipeline
1717

1818
@impl true
19-
def handle_init(options) do
20-
spec = %ParentSpec{
21-
children: [
22-
file_source: %Membrane.File.Source{location: options.input.path},
23-
deserializer: IVF.Deserializer,
24-
serializer: %IVF.Serializer{
25-
width: options.input.width,
26-
height: options.input.height,
27-
rate: 30
28-
},
29-
file_sink: %Membrane.File.Sink{location: options.result_file}
30-
],
31-
links: [
32-
link(:file_source) |> to(:deserializer) |> to(:serializer) |> to(:file_sink)
33-
]
34-
}
35-
36-
{{:ok, spec: spec, playback: :playing}, %{}}
19+
def handle_init(_ctx, options) do
20+
spec = [
21+
child(:serializer, %IVF.Serializer{
22+
width: options.input.width,
23+
height: options.input.height,
24+
rate: 30
25+
}),
26+
child(:file_source, %Membrane.File.Source{location: options.input.path})
27+
|> child(:deserializer, IVF.Deserializer)
28+
|> get_child(:serializer)
29+
|> child(:file_sink, %Membrane.File.Sink{location: options.result_file})
30+
]
31+
32+
{[spec: spec, playback: :playing], %{}}
3733
end
3834

3935
@impl true
4036
def handle_child_notification(_notification, _child, _ctx, state) do
41-
{:ok, state}
37+
{[], state}
4238
end
4339
end
4440

@@ -57,22 +53,21 @@ defmodule Membrane.Element.IVF.IntegrationTest do
5753

5854
result_file = Path.join(@results_dir, result)
5955

60-
{:ok, pipeline} =
56+
pipeline =
6157
[
6258
module: TestPipeline,
6359
custom_args: %{
6460
input: input,
6561
result_file: result_file
6662
}
6763
]
68-
|> Testing.Pipeline.start_link()
64+
|> Testing.Pipeline.start_link_supervised!()
6965

70-
assert_pipeline_playback_changed(pipeline, _, :playing)
66+
assert_pipeline_play(pipeline)
7167

7268
assert_end_of_stream(pipeline, :file_sink)
7369

7470
Testing.Pipeline.terminate(pipeline, blocking?: true)
75-
assert_pipeline_playback_changed(pipeline, _, :stopped)
7671

7772
assert File.read!(input.path) ==
7873
File.read!(result_file)

test/serializer_test.exs

+22-26
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,28 @@ defmodule Membrane.Element.IVF.SerializerTest do
1717
use Membrane.Pipeline
1818

1919
@impl true
20-
def handle_init(options) do
20+
def handle_init(_ctx, options) do
2121
sink =
2222
if options.to_file?,
2323
do: %Membrane.File.Sink{location: options.result_file},
2424
else: Testing.Sink
2525

26-
spec = %ParentSpec{
27-
children: [
28-
ivf_serializer: %IVF.Serializer{width: 1080, height: 720, rate: 30},
29-
source: %Testing.Source{
30-
output: Testing.Source.output_from_buffers(options.buffers),
31-
caps: %RemoteStream{content_format: VP9, type: :packetized}
32-
},
33-
sink: sink
34-
],
35-
links: [
36-
link(:source) |> to(:ivf_serializer) |> to(:sink)
37-
]
38-
}
39-
40-
{{:ok, spec: spec, playback: :playing}, %{}}
26+
spec = [
27+
child(:source, %Testing.Source{
28+
output: Testing.Source.output_from_buffers(options.buffers),
29+
stream_format: %RemoteStream{content_format: VP9, type: :packetized}
30+
}),
31+
get_child(:source)
32+
|> child(:ivf_serializer, %IVF.Serializer{width: 1080, height: 720, rate: 30})
33+
|> child(:sink, sink)
34+
]
35+
36+
{[spec: spec, playback: :playing], %{}}
4137
end
4238

4339
@impl true
4440
def handle_child_notification(_notification, _child, _ctx, state) do
45-
{:ok, state}
41+
{[], state}
4642
end
4743
end
4844

@@ -56,25 +52,25 @@ defmodule Membrane.Element.IVF.SerializerTest do
5652
"""
5753
test "appends headers correctly" do
5854
buffer_1 = %Buffer{payload: @frame, pts: 0}
59-
buffer_2 = %Buffer{payload: @frame, pts: Membrane.Time.seconds(1 <|> 30)}
55+
buffer_2 = %Buffer{payload: @frame, pts: Ratio.new(Membrane.Time.second(), 30)}
6056

61-
{:ok, pipeline} =
57+
pipeline =
6258
[
6359
module: TestPipeline,
6460
custom_args: %{
6561
to_file?: false,
6662
buffers: [buffer_1, buffer_2]
6763
}
6864
]
69-
|> Testing.Pipeline.start_link()
65+
|> Testing.Pipeline.start_supervised!()
7066

71-
assert_pipeline_playback_changed(pipeline, _, :playing)
67+
assert_pipeline_play(pipeline)
7268

7369
assert_start_of_stream(pipeline, :sink)
7470

7571
assert_sink_buffer(pipeline, :sink, ivf_buffer)
7672

77-
<<file_header::binary-size(32), frame_header::binary-size(12), _frame::binary()>> =
73+
<<file_header::binary-size(32), frame_header::binary-size(12), _frame::binary>> =
7874
ivf_buffer.payload
7975

8076
<<signature::binary-size(4), version::binary-size(2), length_of_header::binary-size(2),
@@ -98,7 +94,7 @@ defmodule Membrane.Element.IVF.SerializerTest do
9894

9995
assert_sink_buffer(pipeline, :sink, ivf_buffer)
10096

101-
<<frame_header::binary-size(12), _frame::binary()>> = ivf_buffer.payload
97+
<<frame_header::binary-size(12), _frame::binary>> = ivf_buffer.payload
10298
<<size_of_frame::binary-size(4), timestamp::binary-size(8)>> = frame_header
10399

104100
assert size_of_frame == <<byte_size(@frame)::32-little>>
@@ -117,7 +113,7 @@ defmodule Membrane.Element.IVF.SerializerTest do
117113
test "serialize real vp9 buffers" do
118114
buffers = File.read!(@fixtures_dir <> "capture.dump") |> :erlang.binary_to_term()
119115

120-
{:ok, pipeline} =
116+
pipeline =
121117
[
122118
module: TestPipeline,
123119
custom_args: %{
@@ -126,9 +122,9 @@ defmodule Membrane.Element.IVF.SerializerTest do
126122
buffers: buffers
127123
}
128124
]
129-
|> Testing.Pipeline.start_link()
125+
|> Testing.Pipeline.start_supervised!()
130126

131-
assert_pipeline_playback_changed(pipeline, _, :playing)
127+
assert_pipeline_play(pipeline)
132128

133129
assert_start_of_stream(pipeline, :sink)
134130

0 commit comments

Comments
 (0)