-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c260827
commit 7d691fa
Showing
51 changed files
with
585 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Upgrading to v0.12 | ||
|
||
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. | ||
|
||
## Deps upgrade | ||
|
||
Upgrade `membrane_core` to `v0.12.1`. | ||
|
||
```elixir | ||
defp deps do | ||
[ | ||
{:membrane_core, "~> 0.12.1"}, | ||
... | ||
] | ||
end | ||
``` | ||
|
||
## Implement `handle_child_pad_removed/4` callback in bins and pipelines, if it is needed | ||
|
||
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. | ||
|
||
```elixir | ||
@impl true | ||
def handle_child_pad_removed(:rtp, Pad.ref(:rtp_input, _ssrc), _ctx, state) do | ||
# ... | ||
end | ||
``` | ||
|
||
## Remove `:playback` action | ||
|
||
Now, membrane pipelines enter the playing playback by default and they don't have to return a `:playback` action to do it. | ||
|
||
```diff | ||
- @impl true | ||
- def handle_setup(_ctx, state) do | ||
- {[playback: :playing], state} | ||
- end | ||
``` | ||
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`. | ||
|
||
```diff | ||
- @impl true | ||
- def handle_setup(_ctx, state) do | ||
- Process.send_after(self(), :play, 1000) | ||
- {[], state} | ||
- end | ||
- | ||
- @impl true | ||
- def handle_info(:play, _ctx, state) do | ||
- {[playback: :playing], state} | ||
- end | ||
|
||
+ @impl true | ||
+ def handle_setup(_ctx, state) do | ||
+ Process.send_after(self(), :play, 1000) | ||
+ {[setup: :incomplete], state} | ||
+ end | ||
+ | ||
+ @impl true | ||
+ def handle_info(:play, _ctx, state) do | ||
+ {[setup: :complete], state} | ||
+ end | ||
``` | ||
|
||
`:setup` action is available not only in pipelines but in bins and elements as well. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.