summaryrefslogtreecommitdiff
path: root/doc/design.txt
blob: ad9a9c41986ae1e83dfc4abbebf04231bd0bc4a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
PipeWire
--------

PipeWire is a media server that can run graphs of multimedia nodes.
Nodes can run inside the server or in separate processes.

Some of the requirements are:

 - must be efficient for raw video using fd passing and audio with
   shared ringbuffers
 - must be able to provide/consume/process media from any process
 - policy to restrict access to devices and streams
 - extensible

Although an initial goal, the design is not limited to raw video
only and should be able to handle compressed video and other
media as well.

PipeWire uses the SPA plugin API for the nodes in the graph. SPA is
a plugin API designed for low-latency and efficient processing of
any multimedia format.

Some of the application we intend to build

 - v4l2 device provider. Provide controlled access to v4l2 devices
   and share 1 device between multiple processes.

 - gnome-shell video provider. Gnome-shell provides a node that
   gives the contents of the frame buffer for screen sharing or
   screen recording.

 - audio server. Mix and playback multiple audio streams. The design
   is more like CRAS (Chromium audio server) than pulseaudio and with
   the added benefit that processing can be arranged in a graph.

 - Pro audio graph processing like JACK.

 - Media playback backend


Protocol
--------

The native protocol and object model is similar to wayland but with custom
serialization/deserialization of messages. This is because the datastructures
in the messages are more complicated and not easily expressable in xml format.


Extensibility
-------------

The functionality of the server is implemented and extended with modules and
extensions. Modules are server side bits of logic that hook into various
places to provide extra features. This mostly means controlling the processing
graph in some way.

Extensions are the client side version of the modules. Most extensions provide
both a client side and server side init function. New interfaces or new object
implementation can easily be added with modules/extensions.

Some of the extensions that can be written

 - protocol extensions: a client/server side API (.h) together with protocol
   extensions and server/client side logic to implement a new object or
   interface.

 - a module to check security of method calls

 - a module to automatically create or link or relink nodes

 - a module to suspend idle nodes