Skip to content

Commit 4672380

Browse files
committed
Release v0.12.4
1 parent df1b737 commit 4672380

42 files changed

Lines changed: 483 additions & 117 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
# Changelog
22

3-
## 1.0.0
3+
# 0.12.4
4+
* Fix compilation error occuring with Elixir 1.15. [#570](https://github.com/membraneframework/membrane_core/pull/570)
5+
6+
# 0.12.3
7+
* Fix bug in fields naming in callback contexts. [#569](https://github.com/membraneframework/membrane_core/pull/569)
8+
* Update exit reasons of Membrane Components and their supervisors. [#567](https://github.com/membraneframework/membrane_core/pull/567)
9+
10+
## 0.12.2
11+
* Fix bug in order of handling actions returned from callbacks.
12+
13+
## 0.12.1
414
* Introduce `:remove_link` action in pipelines and bins.
515
* Add children groups - a mechanism that allows refering to multiple children with a single identifier.
6-
* Rename `remove_child` action into `remove_children` and allow for removing a children group with a single action.
716
* Add an ability to spawn anonymous children.
8-
* Replace `Membrane.Time.round_to_<unit_name>` with `Membrane.Time.as_<unit_name>/2` with second argument equal `:round`. Rename `Membrane.Time.round_to_timebase` to `Membrane.Time.divide_by_timebase/2`. [#494](https://github.com/membraneframework/membrane_core/pull/494)
917
* Remove `:playback` action. Introduce `:setup` action. [#496](https://github.com/membraneframework/membrane_core/pull/496)
1018
* Add `Membrane.Testing.Pipeline.get_child_pid/2`. [#497](https://github.com/membraneframework/membrane_core/pull/497)
1119
* Make callback contexts to be maps. [#504](https://github.com/membraneframework/membrane_core/pull/504)
1220
* All Membrane Elements can be compatible till now on - pads working in `:pull` mode, handling different `demand_units`, can be now linked.
1321
* Output pads working in `:pull` mode should have their `demand_unit` specified. If case it's not available, it's assumed that the pad handles demands in both `:bytes` and `:buffers` units.
14-
* Rename callbacks `handle_process/4` and `handle_write/4` to `handle_buffer/4` in [#506](https://github.com/membraneframework/membrane_core/pull/506)
15-
* The flow control of the pad is now set with a single `:flow_control` option instead of `:mode` and `:demand_mode` options.
1622
* Remove _t suffix from types [#509](https://github.com/membraneframework/membrane_core/pull/509)
1723
* Implement automatic demands in Membrane Sinks and Endpoints. [#512](https://github.com/membraneframework/membrane_core/pull/512)
1824
* Add `handle_child_pad_removed/4` callback in Bins and Pipelines. [#513](https://github.com/membraneframework/membrane_core/pull/513)
1925
* Introduce support for crash groups in Bins. [#521](https://github.com/membraneframework/membrane_core/pull/521)
20-
* Remove `assert_pipeline_play/2` from `Membrane.Testing.Assertions`. [#528](https://github.com/membraneframework/membrane_core/pull/528)
2126
* Make sure enumerable with all elements being `Membrane.Buffer.t()`, passed as `:output` parameter for `Membrane.Testing.Source` won't get rewrapped in `Membrane.Buffer.t()` struct.
2227
* Implement `Membrane.Debug.Filter` and `Membrane.Debug.Sink`. [#552](https://github.com/membraneframework/membrane_core/pull/552)
2328

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This package provides core of the [Membrane Multimedia Framework](https://membra
2121
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.
2222

2323
```elixir
24-
{:membrane_core, "~> 0.11.0"}
24+
{:membrane_core, "~> 0.12.4"}
2525
```
2626

2727
Or, if you'd like to try the latest release candidate, use this version:

benchmark/run/branched_filter.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ defmodule Benchmark.Run.BranchedFilter do
44

55
alias Benchmark.Run.Reductions
66

7-
def_input_pad :input, accepted_format: _any, availability: :on_request
8-
def_output_pad :output, accepted_format: _any, availability: :on_request
7+
def_input_pad :input, accepted_format: _any, availability: :on_request, flow_control: :auto
8+
def_output_pad :output, accepted_format: _any, availability: :on_request, flow_control: :auto
99

1010
def_options number_of_reductions: [spec: integer()],
1111
generator: [spec: (integer() -> integer())],

benchmark/run/linear_filter.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ defmodule Benchmark.Run.LinearFilter do
44

55
alias Benchmark.Run.Reductions
66

7-
def_input_pad :input, accepted_format: _any
8-
def_output_pad :output, accepted_format: _any
7+
def_input_pad :input, accepted_format: _any, flow_control: :auto
8+
def_output_pad :output, accepted_format: _any, flow_control: :auto
99

1010
def_options number_of_reductions: [spec: integer()],
1111
generator: [spec: (integer() -> integer())]

guides/upgrading/v0.11.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Upgrading to v0.11
22

3-
Improvements in v0.11 required some breaking changes, so here comes the guide that will help you adjust your code to the new API. See the [changelog](https://github.com/membraneframework/membrane_core/releases/tag/v0.11.0) for details.
3+
Improvements in v0.11 required some breaking changes, so here comes the guide that will help you adjust your code to the new API. See the [release notes](https://github.com/membraneframework/membrane_core/releases/tag/v0.11.0) for details.
44

55
## Deps upgrade
66

guides/upgrading/v0.12.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Upgrading to v0.12
2+
3+
Between v0.11 and v0.12 some breaking changes have occurred, so here comes the guide that will help you adjust your code to the new API. See the [release notes](https://github.com/membraneframework/membrane_core/releases/tag/v0.12.1) for details.
4+
5+
## Deps upgrade
6+
7+
Upgrade `membrane_core` to `v0.12.1`.
8+
9+
```elixir
10+
defp deps do
11+
[
12+
{:membrane_core, "~> 0.12.1"},
13+
...
14+
]
15+
end
16+
```
17+
18+
## Implement `handle_child_pad_removed/4` callback in bins and pipelines, if it is needed
19+
20+
Now, if bin removes its pad (e.g. by removing an element linked to the bin's inner pad), bin's parent has to have implemented proper `handle_child_pad_removed/4` callback, to handle it. If there is no such a callback, default behaviour is to raise an error.
21+
22+
```elixir
23+
@impl true
24+
def handle_child_pad_removed(:rtp, Pad.ref(:rtp_input, _ssrc), _ctx, state) do
25+
# ...
26+
end
27+
```
28+
29+
## Remove `:playback` action
30+
31+
Now, membrane pipelines enter the playing playback by default and they don't have to return a `:playback` action to do it.
32+
33+
```diff
34+
- @impl true
35+
- def handle_setup(_ctx, state) do
36+
- {[playback: :playing], state}
37+
- end
38+
```
39+
Instead of it, there is a new action introduced in `membrane_core` v0.12, `setup: :incomplete | :complete`. If you want to defer a moment when a component enters the playing playback, you can return `{:setup, :incomplete}` action from `handle_setup` callback. If you do that, a component will enter the playing playback only when you return `{:setup, :complete}` action from another callback, e.g. `handle_info`.
40+
41+
```diff
42+
- @impl true
43+
- def handle_setup(_ctx, state) do
44+
- Process.send_after(self(), :play, 1000)
45+
- {[], state}
46+
- end
47+
-
48+
- @impl true
49+
- def handle_info(:play, _ctx, state) do
50+
- {[playback: :playing], state}
51+
- end
52+
53+
+ @impl true
54+
+ def handle_setup(_ctx, state) do
55+
+ Process.send_after(self(), :play, 1000)
56+
+ {[setup: :incomplete], state}
57+
+ end
58+
+
59+
+ @impl true
60+
+ def handle_info(:play, _ctx, state) do
61+
+ {[setup: :complete], state}
62+
+ end
63+
```
64+
65+
`:setup` action is available not only in pipelines but in bins and elements as well.

guides/upgrading/v1.0.0-rc0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Upgrading to v1.0.0-rc0
22

3-
Between v0.11 and v1.0.0-rc0 some breaking changes have occurred, so here comes the guide that will help you adjust your code to the new API. See the [changelog](https://github.com/membraneframework/membrane_core/releases/tag/v1.0.0-rc0) for detailed description of the changes.
3+
Between v0.11 and v1.0.0-rc0 some breaking changes have occurred, so here comes the guide that will help you adjust your code to the new API. See the [release notes](https://github.com/membraneframework/membrane_core/releases/tag/v1.0.0-rc0) for detailed description of the changes.
44

55
### Deps upgrade
66

lib/membrane/bin.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ defmodule Membrane.Bin do
5050
Callback that is called when new pad has been added to bin. Executed
5151
ONLY for dynamic pads.
5252
53-
Context passed to this callback contains additional field `:pad_options`.
53+
Context passed to this callback contains additional field `:options`.
5454
"""
5555
@callback handle_pad_added(
5656
pad :: Pad.ref(),
@@ -62,7 +62,7 @@ defmodule Membrane.Bin do
6262
Callback that is called when some pad of the bin has been removed. Executed
6363
ONLY for dynamic pads.
6464
65-
Context passed to this callback contains additional field `:pad_options`.
65+
Context passed to this callback contains additional field `:options`.
6666
"""
6767
@callback handle_pad_removed(
6868
pad :: Pad.ref(),
@@ -93,7 +93,7 @@ defmodule Membrane.Bin do
9393
Callback invoked when a child removes its pad.
9494
9595
The callback won't be invoked, when you have initiated the pad removal,
96-
eg. when you have returned `t:Membrane.Bin.Action.remove_link()` action
96+
e.g. when you have returned `t:Membrane.Bin.Action.remove_link()` action
9797
which made one of your children's pads be removed.
9898
"""
9999
@callback handle_child_pad_removed(

lib/membrane/bin/action.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ defmodule Membrane.Bin.Action do
5353
| Membrane.Child.group()
5454
| [Membrane.Child.group()]}
5555

56+
@type remove_child ::
57+
{:remove_child,
58+
Child.name()
59+
| [Child.name()]
60+
| Membrane.Child.group()
61+
| [Membrane.Child.group()]}
62+
5663
@typedoc """
5764
Action that removes link, which relates to specified child and pad.
5865
@@ -134,6 +141,7 @@ defmodule Membrane.Bin.Action do
134141
| notify_parent
135142
| spec
136143
| remove_children
144+
| remove_child
137145
| remove_link
138146
| start_timer
139147
| timer_interval

lib/membrane/bin/callback_context.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule Membrane.Bin.CallbackContext do
66
@typedoc """
77
Type describing context passed to the `Membrane.Bin` callbacks.
88
9-
Field `:pad_options` is present only in `c:Membrane.Bin.handle_pad_added/3`
9+
Field `:options` is present only in `c:Membrane.Bin.handle_pad_added/3`
1010
and `c:Membrane.Bin.handle_pad_removed/3`.
1111
1212
Fields `:members` and `:crash_initiator` are present only in
@@ -21,7 +21,7 @@ defmodule Membrane.Bin.CallbackContext do
2121
:playback => Membrane.Playback.t(),
2222
:resource_guard => Membrane.ResourceGuard.t(),
2323
:utility_supervisor => Membrane.UtilitySupervisor.t(),
24-
optional(:pad_options) => map(),
24+
optional(:options) => map(),
2525
optional(:members) => [Membrane.Child.name()],
2626
optional(:crash_initiator) => Membrane.Child.name()
2727
}

0 commit comments

Comments
 (0)