Skip to content

Commit 506a41e

Browse files
authored
Merge pull request #640 from membraneframework/releases/v1.0.0
Releases/v1.0.0
2 parents 4386843 + 14f45ea commit 506a41e

12 files changed

Lines changed: 61 additions & 159 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ jobs:
154154
at: .
155155
- run: cp -r benchmark/ ~/benchmark_backup/
156156
- run: cp mix.exs ~/benchmark_backup/
157-
- run: docker pull membraneframeworklabs/docker_membrane
158157
- run: docker run -e MIX_ENV=benchmark -v ./:/root/app -v ~/results:/root/results -w /root/app membraneframeworklabs/docker_membrane mix do deps.get, deps.compile --force --all, run benchmark/run.exs /root/results/feature_branch_results
159158
- run: git checkout -f master
160159
- run: cp ~/benchmark_backup/mix.exs ~/app

CHANGELOG.md

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

3-
## 1.0.0-rc1
3+
## 1.0.0
44
* Introduce `:remove_link` action in pipelines and bins.
55
* Add children groups - a mechanism that allows refering to multiple children with a single identifier.
66
* Rename `remove_child` action into `remove_children` and allow for removing a children group with a single action.
@@ -26,7 +26,6 @@
2626
* Add child exit reason to the supervisor exit reason. [#595](https://github.com/membraneframework/membrane_core/pull/595)
2727
* Remove default implementation of `start_/2`, `start_link/2` and `terminate/2` in modules using `Membrane.Pipeline`. [#598](https://github.com/membraneframework/membrane_core/pull/598)
2828
* Remove callback _Membrane.Element.WithInputPads.handle_buffers_batch/4_. [#601](https://github.com/membraneframework/membrane_core/pull/601)
29-
* Sort component state fields in the error logs in the order from the most to the least important. [#614](https://github.com/membraneframework/membrane_core/pull/614)
3029

3130
## 0.11.0
3231
* Separate element_name and pad arguments in handle_element_{start, end}_of_stream signature [#219](https://github.com/membraneframework/membrane_core/issues/219)

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,7 @@ Apart from plugins, Membrane has stream formats, which live in `membrane_X_forma
101101
The API for creating pipelines (and custom elements too) is provided by [membrane_core](https://github.com/membraneframework/membrane_core). To install it, add the following line to your `deps` in `mix.exs` and run `mix deps.get`
102102

103103
```elixir
104-
{:membrane_core, "~> 0.12.9"}
105-
```
106-
107-
Or, if you'd like to try the latest release candidate, use this version:
108-
109-
```elixir
110-
{:membrane_core, "~> 1.0.0-rc1"}
104+
{:membrane_core, "~> 1.0.0"}
111105
```
112106

113107
**Standalone libraries**

lib/membrane/core/bin/pad_controller.ex

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ defmodule Membrane.Core.Bin.PadController do
5151
case PadModel.get_data(state, pad_ref) do
5252
{:error, :unknown_pad} ->
5353
init_pad_data(pad_ref, pad_info, state)
54-
|> Map.update!(:pad_refs, &[pad_ref | &1])
5554

5655
# This case is for pads that were instantiated before the external link request,
5756
# that is in the internal link request (see `handle_internal_link_request/4`).
@@ -282,10 +281,8 @@ defmodule Membrane.Core.Bin.PadController do
282281
@spec handle_unlink(Pad.ref(), Core.Bin.State.t()) :: Core.Bin.State.t()
283282
def handle_unlink(pad_ref, state) do
284283
with {:ok, %{availability: :on_request}} <- PadModel.get_data(state, pad_ref) do
285-
{pad_data, state} =
286-
maybe_handle_pad_removed(pad_ref, state)
287-
|> Map.update!(:pad_refs, &List.delete(&1, pad_ref))
288-
|> PadModel.pop_data!(pad_ref)
284+
state = maybe_handle_pad_removed(pad_ref, state)
285+
{pad_data, state} = PadModel.pop_data!(state, pad_ref)
289286

290287
if pad_data.endpoint do
291288
Message.send(pad_data.endpoint.pid, :handle_unlink, pad_data.endpoint.pad_ref)

lib/membrane/core/bin/state.ex

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defmodule Membrane.Core.Bin.State do
88
use Bunch
99
use Bunch.Access
1010

11-
alias Membrane.{Child, Clock, Pad, Sync}
11+
alias Membrane.{Child, Clock, Sync}
1212
alias Membrane.Core.Child.PadModel
1313
alias Membrane.Core.Parent.ChildLifeController
1414
alias Membrane.Core.Parent.{ChildrenModel, CrashGroup, Link}
@@ -20,7 +20,6 @@ defmodule Membrane.Core.Bin.State do
2020
children: ChildrenModel.children(),
2121
subprocess_supervisor: pid(),
2222
name: Membrane.Bin.name() | nil,
23-
pad_refs: [Pad.ref()],
2423
pads_info: PadModel.pads_info() | nil,
2524
pads_data: PadModel.pads_data() | nil,
2625
parent_pid: pid,
@@ -50,34 +49,23 @@ defmodule Membrane.Core.Bin.State do
5049
stalker: Membrane.Core.Stalker.t()
5150
}
5251

53-
# READ THIS BEFORE ADDING NEW FIELD!!!
54-
55-
# Fields of this structure will be inspected in the same order, in which they occur in the
56-
# list passed to `defstruct`. Take a look at lib/membrane/core/inspect.ex to get more info.
57-
# If you want to add a new field to the state, place it at the spot corresponding to its
58-
# importance and possibly near other related fields. It is suggested, to keep `:pads_data`
59-
# as the last item in the list, because sometimes it is so big, that everything after it
60-
# might be truncated during the inspection.
61-
62-
defstruct module: nil,
63-
name: nil,
64-
parent_pid: nil,
65-
playback: :stopped,
66-
internal_state: nil,
67-
pad_refs: [],
68-
pads_info: nil,
69-
children: %{},
70-
links: %{},
71-
crash_groups: %{},
72-
pending_specs: %{},
73-
synchronization: nil,
74-
initialized?: false,
75-
terminating?: false,
76-
setup_incomplete?: false,
77-
handling_action?: false,
78-
stalker: nil,
79-
resource_guard: nil,
80-
subprocess_supervisor: nil,
81-
children_log_metadata: [],
82-
pads_data: nil
52+
@enforce_keys [:module, :synchronization, :subprocess_supervisor, :resource_guard, :stalker]
53+
defstruct @enforce_keys ++
54+
[
55+
internal_state: nil,
56+
children: %{},
57+
name: nil,
58+
pads_info: nil,
59+
pads_data: nil,
60+
parent_pid: nil,
61+
crash_groups: %{},
62+
children_log_metadata: [],
63+
links: %{},
64+
pending_specs: %{},
65+
playback: :stopped,
66+
initialized?: false,
67+
terminating?: false,
68+
setup_incomplete?: false,
69+
handling_action?: false
70+
]
8371
end

lib/membrane/core/child/pad_spec_handler.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ defmodule Membrane.Core.Child.PadSpecHandler do
2121
| pads_info:
2222
get_pads(state)
2323
|> Map.new(),
24-
pads_data: %{},
25-
pad_refs: []
24+
pads_data: %{}
2625
}
2726
end
2827

lib/membrane/core/element/pad_controller.ex

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,7 @@ defmodule Membrane.Core.Element.PadController do
228228
state = generate_eos_if_needed(pad_ref, state)
229229
state = maybe_handle_pad_removed(pad_ref, state)
230230
state = remove_pad_associations(pad_ref, state)
231-
232-
{pad_data, state} =
233-
Map.update!(state, :pad_refs, &List.delete(&1, pad_ref))
234-
|> PadModel.pop_data!(pad_ref)
231+
{pad_data, state} = PadModel.pop_data!(state, pad_ref)
235232

236233
with %{direction: :input, flow_control: :auto, other_effective_flow_control: :pull} <-
237234
pad_data do
@@ -317,10 +314,7 @@ defmodule Membrane.Core.Element.PadController do
317314
|> merge_pad_mode_data(endpoint.pad_props, other_pad_info, state)
318315
|> then(&struct!(Membrane.Element.PadData, &1))
319316

320-
state =
321-
state
322-
|> put_in([:pads_data, endpoint.pad_ref], pad_data)
323-
|> Map.update!(:pad_refs, &[endpoint.pad_ref | &1])
317+
state = put_in(state, [:pads_data, endpoint.pad_ref], pad_data)
324318

325319
:ok =
326320
AtomicDemand.set_sender_status(

lib/membrane/core/element/state.ex

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ defmodule Membrane.Core.Element.State do
1919
type: Element.type(),
2020
name: Element.name(),
2121
internal_state: Element.state() | nil,
22-
pad_refs: [Pad.ref()] | nil,
2322
pads_info: PadModel.pads_info() | nil,
2423
pads_data: PadModel.pads_data() | nil,
2524
parent_pid: pid,
@@ -46,39 +45,29 @@ defmodule Membrane.Core.Element.State do
4645
stalker: Membrane.Core.Stalker.t()
4746
}
4847

49-
# READ THIS BEFORE ADDING NEW FIELD!!!
50-
51-
# Fields of this structure will be inspected in the same order, in which they occur in the
52-
# list passed to `defstruct`. Take a look at lib/membrane/core/inspect.ex to get more info.
53-
# If you want to add a new field to the state, place it at the spot corresponding to its
54-
# importance and possibly near other related fields. It is suggested, to keep `:pads_data`
55-
# as the last item in the list, because sometimes it is so big, that everything after it
56-
# might be truncated during the inspection.
57-
5848
defstruct [
5949
:module,
60-
:name,
61-
:parent_pid,
62-
:playback,
6350
:type,
51+
:name,
6452
:internal_state,
65-
:pad_refs,
6653
:pads_info,
67-
:synchronization,
54+
:pads_data,
55+
:parent_pid,
56+
:supplying_demand?,
6857
:delayed_demands,
69-
:effective_flow_control,
58+
:handle_demand_loop_counter,
59+
:synchronization,
60+
:demand_size,
7061
:initialized?,
62+
:playback,
63+
:playback_queue,
64+
:resource_guard,
65+
:subprocess_supervisor,
7166
:terminating?,
7267
:setup_incomplete?,
73-
:supplying_demand?,
68+
:effective_flow_control,
7469
:handling_action?,
75-
:stalker,
76-
:resource_guard,
77-
:subprocess_supervisor,
78-
:handle_demand_loop_counter,
79-
:demand_size,
8070
:pads_to_snapshot,
81-
:playback_queue,
82-
:pads_data
71+
:stalker
8372
]
8473
end

lib/membrane/core/inspect.ex

Lines changed: 0 additions & 45 deletions
This file was deleted.

lib/membrane/core/pipeline/state.ex

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ defmodule Membrane.Core.Pipeline.State do
99
use Bunch.Access
1010

1111
alias Membrane.Child
12-
alias Membrane.Core.Parent.{ChildLifeController, ChildrenModel, CrashGroup, Link}
12+
alias Membrane.Core.Parent.{ChildrenModel, CrashGroup, Link}
1313
alias Membrane.Core.Timer
1414

1515
@type t :: %__MODULE__{
16-
module: module,
17-
playback: Membrane.Playback.t(),
1816
internal_state: Membrane.Pipeline.state() | nil,
17+
module: module,
1918
children: ChildrenModel.children(),
20-
links: %{Link.id() => Link.t()},
2119
crash_groups: %{CrashGroup.name() => CrashGroup.t()},
22-
pending_specs: ChildLifeController.pending_specs(),
20+
links: %{Link.id() => Link.t()},
2321
synchronization: %{
2422
timers: %{Timer.id() => Timer.t()},
2523
clock_provider: %{
@@ -29,35 +27,27 @@ defmodule Membrane.Core.Pipeline.State do
2927
},
3028
clock_proxy: Membrane.Clock.t()
3129
},
30+
playback: Membrane.Playback.t(),
3231
initialized?: boolean(),
3332
terminating?: boolean(),
3433
resource_guard: Membrane.ResourceGuard.t(),
3534
setup_incomplete?: boolean(),
3635
handling_action?: boolean(),
37-
stalker: Membrane.Core.Stalker.t(),
38-
subprocess_supervisor: pid()
36+
stalker: Membrane.Core.Stalker.t()
3937
}
4038

41-
# READ THIS BEFORE ADDING NEW FIELD!!!
42-
43-
# Fields of this structure will be inspected in the same order, in which they occur in the
44-
# list passed to `defstruct`. Take a look at lib/membrane/core/inspect.ex to get more info.
45-
# If you want to add a new field to the state, place it at the spot corresponding to its
46-
# importance and possibly near other related fields.
47-
48-
defstruct module: nil,
49-
playback: :stopped,
50-
internal_state: nil,
51-
children: %{},
52-
links: %{},
53-
crash_groups: %{},
54-
pending_specs: %{},
55-
synchronization: nil,
56-
initialized?: false,
57-
terminating?: false,
58-
setup_incomplete?: false,
59-
handling_action?: false,
60-
stalker: nil,
61-
resource_guard: nil,
62-
subprocess_supervisor: nil
39+
@enforce_keys [:module, :synchronization, :subprocess_supervisor, :resource_guard, :stalker]
40+
defstruct @enforce_keys ++
41+
[
42+
internal_state: nil,
43+
children: %{},
44+
crash_groups: %{},
45+
links: %{},
46+
pending_specs: %{},
47+
playback: :stopped,
48+
initialized?: false,
49+
terminating?: false,
50+
setup_incomplete?: false,
51+
handling_action?: false
52+
]
6353
end

0 commit comments

Comments
 (0)