mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-07-03 07:58:41 +00:00
doc: remove trailing whitespace
My vim/git setup wants to fix those on every commit which gets a bit annoying, let's just remove them: sed -i 's/ *$//g' $(git ls-files doc)
This commit is contained in:
parent
ac05f6bb03
commit
f0d3f1f9d2
|
@ -59,5 +59,5 @@ The reason why is this set up like this is that the metadata memory, the data an
|
|||
* +>| data | memory for n_datas data, aligned
|
||||
* | ... <n_datas> blocks | according to alignments
|
||||
* +==============================+
|
||||
|
||||
|
||||
Taken from [here](https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/11f95fe11e07192cec19fddb4fafc708e023e49c/spa/include/spa/buffer/alloc.h).
|
||||
|
|
|
@ -14,7 +14,7 @@ followed by the pod contents. This makes it possible to skip over unknown
|
|||
POD types. The POD start is always aligned to 8 bytes.
|
||||
|
||||
PODs can be efficiently constructed and parsed in real-time threads without
|
||||
requiring memory allocations.
|
||||
requiring memory allocations.
|
||||
|
||||
PODs use the SPA type system for the basic types and containers. See
|
||||
the SPA types for more info.
|
||||
|
@ -30,23 +30,23 @@ PODs can contain a number of basic SPA types:
|
|||
various numeral types, 32 and 64 bits.
|
||||
* `SPA_TYPE_String`: a string
|
||||
* `SPA_TYPE_Bytes`: a byte array
|
||||
* `SPA_TYPE_Rectangle`: a rectangle with width and height
|
||||
* `SPA_TYPE_Rectangle`: a rectangle with width and height
|
||||
* `SPA_TYPE_Fraction`: a fraction with numerator and denominator
|
||||
* `SPA_TYPE_Bitmap`: an array of bits
|
||||
* `SPA_TYPE_Bitmap`: an array of bits
|
||||
|
||||
PODs can be grouped together in these container types:
|
||||
|
||||
* `SPA_TYPE_Array`: an array of equal sized objects
|
||||
* `SPA_TYPE_Array`: an array of equal sized objects
|
||||
* `SPA_TYPE_Struct`: a collection of types and objects
|
||||
* `SPA_TYPE_Object`: an object with properties
|
||||
* `SPA_TYPE_Sequence`: a timed sequence of PODs
|
||||
* `SPA_TYPE_Sequence`: a timed sequence of PODs
|
||||
|
||||
PODs can also contain some extra types:
|
||||
|
||||
* `SPA_TYPE_Pointer`: a typed pointer in memory
|
||||
* `SPA_TYPE_Pointer`: a typed pointer in memory
|
||||
* `SPA_TYPE_Fd`: a file descriptor
|
||||
* `SPA_TYPE_Choice`: a choice of values
|
||||
* `SPA_TYPE_Pod`: a generic type for the POD itself
|
||||
* `SPA_TYPE_Choice`: a choice of values
|
||||
* `SPA_TYPE_Pod`: a generic type for the POD itself
|
||||
|
||||
# Constructing a POD
|
||||
|
||||
|
@ -65,7 +65,7 @@ the stack allocated buffer.
|
|||
```c
|
||||
uint8_t buffer[4096];
|
||||
struct spa_pod_builder b;
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
```
|
||||
|
||||
Next we need to write some object into the builder. Let's write
|
||||
|
@ -176,7 +176,7 @@ interpreted in different ways:
|
|||
* `SPA_CHOICE_None`: no choice, first value is current
|
||||
* `SPA_CHOICE_Range`: range: default, min, max
|
||||
* `SPA_CHOICE_Step`: range with step: default, min, max, step
|
||||
* `SPA_CHOICE_Enum`: enum: default, alternative,...
|
||||
* `SPA_CHOICE_Enum`: enum: default, alternative,...
|
||||
* `SPA_CHOICE_Flags`: bitmask of flags
|
||||
|
||||
Let's illustrate this with a Props object that specifies a range of
|
||||
|
@ -233,7 +233,7 @@ pod = spa_pod_builder_add_object(&b,
|
|||
|
||||
## Fixate
|
||||
|
||||
We can remove all choice values from the object with the
|
||||
We can remove all choice values from the object with the
|
||||
`spa_pod_object_fixate()` method. This modifies the pod in-place and sets all
|
||||
choice properties to `SPA_CHOICE_None`, forcing the default value as the
|
||||
only available value in the choice.
|
||||
|
@ -345,7 +345,7 @@ spa_pod_parser_push_struct(&p, &f);
|
|||
```
|
||||
|
||||
You need to store the context in a `struct spa_pod_frame` to be able
|
||||
to exit the container again later.
|
||||
to exit the container again later.
|
||||
|
||||
You can then parse each field. The parser takes care of moving to the
|
||||
next field.
|
||||
|
@ -415,7 +415,7 @@ Use the iterator for this.
|
|||
|
||||
The parser will handle Choice values as long as they are of type
|
||||
None. It will then parse the single value from the choice. When
|
||||
dealing with other choice values, it's possible to parse the
|
||||
dealing with other choice values, it's possible to parse the
|
||||
property values into a `struct spa_pod` and then inspect the Choice
|
||||
manually, if needed.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ environment.
|
|||
Let get started with the simplest application.
|
||||
|
||||
```c
|
||||
#include <pipewire/pipewire.h>
|
||||
#include <pipewire/pipewire.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
@ -23,41 +23,41 @@ static const struct pw_registry_events registry_events = {
|
|||
.global = registry_event_global,
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct pw_main_loop *loop;
|
||||
struct pw_context *context;
|
||||
struct pw_core *core;
|
||||
struct pw_registry *registry;
|
||||
struct spa_hook registry_listener;
|
||||
|
||||
pw_init(&argc, &argv);
|
||||
|
||||
loop = pw_main_loop_new(NULL /* properties */);
|
||||
context = pw_context_new(pw_main_loop_get_loop(loop),
|
||||
NULL /* properties */,
|
||||
0 /* user_data size */);
|
||||
|
||||
core = pw_context_connect(context,
|
||||
NULL /* properties */,
|
||||
0 /* user_data size */);
|
||||
|
||||
registry = pw_core_get_registry(core, PW_VERSION_REGISTRY,
|
||||
0 /* user_data size */);
|
||||
|
||||
spa_zero(registry_listener);
|
||||
pw_registry_add_listener(registry, ®istry_listener,
|
||||
®istry_events, NULL);
|
||||
|
||||
pw_main_loop_run(loop);
|
||||
|
||||
pw_proxy_destroy((struct pw_proxy*)registry);
|
||||
pw_core_disconnect(core);
|
||||
pw_context_destroy(context);
|
||||
pw_main_loop_destroy(loop);
|
||||
|
||||
return 0;
|
||||
}
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct pw_main_loop *loop;
|
||||
struct pw_context *context;
|
||||
struct pw_core *core;
|
||||
struct pw_registry *registry;
|
||||
struct spa_hook registry_listener;
|
||||
|
||||
pw_init(&argc, &argv);
|
||||
|
||||
loop = pw_main_loop_new(NULL /* properties */);
|
||||
context = pw_context_new(pw_main_loop_get_loop(loop),
|
||||
NULL /* properties */,
|
||||
0 /* user_data size */);
|
||||
|
||||
core = pw_context_connect(context,
|
||||
NULL /* properties */,
|
||||
0 /* user_data size */);
|
||||
|
||||
registry = pw_core_get_registry(core, PW_VERSION_REGISTRY,
|
||||
0 /* user_data size */);
|
||||
|
||||
spa_zero(registry_listener);
|
||||
pw_registry_add_listener(registry, ®istry_listener,
|
||||
®istry_events, NULL);
|
||||
|
||||
pw_main_loop_run(loop);
|
||||
|
||||
pw_proxy_destroy((struct pw_proxy*)registry);
|
||||
pw_core_disconnect(core);
|
||||
pw_context_destroy(context);
|
||||
pw_main_loop_destroy(loop);
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
To compile the simple test application, copy it into a tutorial2.c file and
|
||||
|
|
|
@ -184,7 +184,7 @@ static const struct pw_stream_events stream_events = {
|
|||
```
|
||||
|
||||
We are for the moment only interested now in the `process` event. This event
|
||||
is called whenever we need to produce more data. We'll see how that function
|
||||
is called whenever we need to produce more data. We'll see how that function
|
||||
is implemented but first we need to setup the format of the stream:
|
||||
|
||||
```c
|
||||
|
|
Loading…
Reference in New Issue
Block a user