Skip to content

Commit e392e56

Browse files
authored
Merge pull request #50 from membraneframework/fix/no-white-space-beetwen-words
FIX: No whitespace between words
2 parents 1f53885 + 08c3bee commit e392e56

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

basic_pipeline/04_Caps.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ As promised in the [3rd chapter](03_Source.md), we will talk more about the conc
55

66
## What are caps?
77

8-
Caps (an abbreviation of the *capabilities*) is a concept allowing us to define what kind of data is flowing through the [pad](../glossary/glossary.md#pad).
8+
Caps (an abbreviation of the _capabilities_) is a concept allowing us to define what kind of data is flowing through the [pad](../glossary/glossary.md#pad).
99
In the Membrane Framework's nomenclature, we say, that we define a caps specification for a given [element](../glossary/glossary.md#element).
1010

1111
We believe that an example might speak here louder than a plain definition, so we will try to describe the caps with the real-life scenario example.
@@ -22,7 +22,7 @@ Caps help us define a contract between elements and prevent us from connecting i
2222

2323
## When the caps are compatible?
2424

25-
A comparison between caps is made when the pads are connected. Due to freedom in defining the type, the comparison is not that straightforward. It would be good for a responsible Membrane's element architect to be aware of how the caps are compared. You can refer to the implementation of the caps matcher, available [here](https://github.com/membraneframework/membrane_core/blob/82d6162e3df94cd9abc508c58bc0267367b02d58/lib/membrane/caps/matcher.ex#L124)...or follow on this chapter, and learn it by an example.
25+
A comparison between caps is made when the pads are connected. Due to freedom in defining the type, the comparison is not that straightforward. It would be good for a responsible Membrane's element architect to be aware of how the caps are compared. You can refer to the implementation of the caps matcher, available [here](https://github.com/membraneframework/membrane_core/blob/82d6162e3df94cd9abc508c58bc0267367b02d58/lib/membrane/caps/matcher.ex#L124)... or follow on this chapter, and learn it by an example.
2626
Here is how you define a caps specification:
2727

2828
1. First you need to specify the format module
@@ -43,8 +43,8 @@ Module name defines the type of the caps, however it is possible to pass some ot
4343
2. We specify the pad of the element with the format we have just defined, using the `:caps` option. For the purpose of an example, let it be the `:input` pad:
4444

4545
```Elixir
46-
def_input_pad(:input,
47-
demand_unit: :buffers,
46+
def_input_pad(:input,
47+
demand_unit: :buffers,
4848
caps: [
4949
{Format.Raw, pixel_format: one_of([:I420, :I422]), framerate: range(30, 60), width: 480, height: 300},
5050
{Format.Raw, pixel_format: one_of([:I420, :I422]), framerate: range(30, 60), width: 720, height: 480}
@@ -55,7 +55,7 @@ def_input_pad(:input,
5555
As you can see, we pass a list of compatible formats, each described with the tuple, consisting of our module name, and the keywords list fulfilling the
5656
structure defined in that module. For the format's options, we can use the `range/2` or `one_of/1` specifier, which will modify the way in which the comparison between the caps specification and the actual caps received by the element is performed.
5757

58-
3. Once the caps event comes to the element's pad, the caps description sent in that event is confronted with each of the formats in the caps specification list of the pad. If the event's caps description matches even one of the caps formats present in the list it means that caps are matching.
58+
3. Once the caps event comes to the element's pad, the caps description sent in that event is confronted with each of the formats in the caps specification list of the pad. If the event's caps description matches even one of the caps formats present in the list it means that caps are matching.
5959
To match the caps with the particular format (one from the caps specification list), the module (first element of the tuple in caps format description) must be the same and all the options must match. For each option, a value sent within the event is confronted with the specification of the option. The way comparison occurs is dependent on how we defined that option in the specification:
6060

6161
- We have used `framerate: range(30, 60)`, so will accept the framerate value in the given interval, between 30 and 60 FPS.
@@ -85,8 +85,8 @@ Here is the definition of the source element:
8585
# Source element
8686

8787
defmodule Source do
88-
def_output_pad(:output,
89-
demand_unit: :buffers,
88+
def_output_pad(:output,
89+
demand_unit: :buffers,
9090
caps: [
9191
{Format.Raw, pixel_format: one_of([:I420, :I422]), framerate: range(30, 60), width: 480, height: 300},
9292
{Format.Raw, pixel_format: one_of([:I420, :I422]), framerate: range(30, 60), width: 720, height: 480}
@@ -109,16 +109,16 @@ Below there is the draft of the filter implementation:
109109
# Filter
110110

111111
defmodule Filter do
112-
def_input_pad(:input,
113-
demand_unit: :buffers,
112+
def_input_pad(:input,
113+
demand_unit: :buffers,
114114
caps: [
115115
{Format.Raw, pixel_format: one_of([:I420, :I422]), framerate: range(30, 60), width: 480, height: 300},
116116
{Format.Raw, pixel_format: one_of([:I420, :I422]), framerate: range(30, 60), width: 720, height: 480}
117117
]
118118
)
119119

120-
def_output_pad(:output,
121-
demand_unit: :buffers,
120+
def_output_pad(:output,
121+
demand_unit: :buffers,
122122
caps: {Format.Raw, pixel_format: one_of([:I420, :I422]), framerate: range(30, 60), width: 480, height: 300},
123123
)
124124

0 commit comments

Comments
 (0)