2017-05-23 19:15:33 +02:00
|
|
|
PipeWire
|
|
|
|
|
--------
|
2015-08-21 11:46:29 +02:00
|
|
|
|
2017-01-19 18:10:00 +01:00
|
|
|
The idea is to make a server where you can provide
|
2015-08-21 11:46:29 +02:00
|
|
|
and consume media to/from.
|
|
|
|
|
|
|
|
|
|
Some of the requirements are:
|
|
|
|
|
|
|
|
|
|
- must be efficient for raw video using fd passing
|
2016-05-09 12:16:04 +02:00
|
|
|
- must be able to provide/consume/process media from any process
|
2015-08-21 11:46:29 +02:00
|
|
|
- streaming media only (no seeking)
|
|
|
|
|
- policy to restrict access to devices and streams
|
|
|
|
|
|
|
|
|
|
Although an initial goal, the design is not limited to raw video
|
|
|
|
|
only and should be able to handle compressed video and other
|
|
|
|
|
streamable media as well.
|
|
|
|
|
|
|
|
|
|
The design is in some part inspired by pulseaudio, hence its original
|
2017-01-19 18:10:00 +01:00
|
|
|
name. Increasinly we also seem to add functionality of jack and
|
|
|
|
|
GStreamer.
|
2015-08-21 11:46:29 +02:00
|
|
|
|
|
|
|
|
|
2017-01-19 18:10:00 +01:00
|
|
|
Protocol
|
|
|
|
|
--------
|
2016-05-05 13:31:18 +02:00
|
|
|
|
2017-01-19 18:10:00 +01:00
|
|
|
The protocol is similar to wayland but with custom
|
|
|
|
|
serialization/deserialization of messages. This is because the datastructures
|
|
|
|
|
in the messages are more complicated.
|
2015-08-21 11:46:29 +02:00
|
|
|
|
|
|
|
|
|
2015-12-04 16:39:29 +01:00
|
|
|
fd management
|
|
|
|
|
-------------
|
|
|
|
|
|
2016-08-25 17:07:40 +02:00
|
|
|
Clients receive fds with buffers and memory after a format was negotiated.
|
|
|
|
|
Updates to these buffers are notified by a message containing the id of the
|
|
|
|
|
buffer.
|
2015-12-04 16:39:29 +01:00
|
|
|
|
2015-08-21 11:46:29 +02:00
|
|
|
Wire
|
|
|
|
|
----
|
|
|
|
|
|
2016-08-25 17:07:40 +02:00
|
|
|
The wire protocol for the node control channel is a serialization of
|
|
|
|
|
structures.
|
2016-07-28 21:19:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
+-----+ +----+ +----+
|
|
|
|
|
| | | S | | |
|
|
|
|
|
| ----- ----- |
|
|
|
|
|
+-----+ +----+ +----+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+----+
|
|
|
|
|
| |
|
|
|
|
|
| C |
|
|
|
|
|
+----+
|
|
|
|
|
|
|
|
|
|
|
2016-08-05 19:46:37 +02:00
|
|
|
Client Proxy
|
|
|
|
|
| INIT
|
|
|
|
|
node-update |
|
|
|
|
|
-------------------------------------->|
|
|
|
|
|
port-update |
|
|
|
|
|
-------------------------------------->|
|
|
|
|
|
state-change CONFIGURE | CONFIGURE
|
|
|
|
|
-------------------------------------->|
|
|
|
|
|
|<--- enum-ports
|
|
|
|
|
|<--- enum-formats
|
|
|
|
|
|<--- add-port
|
|
|
|
|
|<--- remove-port
|
|
|
|
|
set-property |<--- set-property
|
|
|
|
|
<--------------------------------------|
|
|
|
|
|
set-format |<--- set-format
|
|
|
|
|
<--------------------------------------|
|
|
|
|
|
|
|
|
|
|
|
port-update |
|
|
|
|
|
-------------------------------------->|
|
|
|
|
|
state-change READY | READY
|
|
|
|
|
-------------------------------------->|
|
|
|
|
|
|<--- port memory requirements
|
|
|
|
|
add-mem |<--- use-buffers
|
|
|
|
|
<--------------------------------------|
|
|
|
|
|
remove-mem |
|
|
|
|
|
<--------------------------------------|
|
|
|
|
|
add-buffer |
|
|
|
|
|
<--------------------------------------|
|
|
|
|
|
remove-buffer |
|
|
|
|
|
<--------------------------------------|
|
|
|
|
|
|
|
|
|
|
|
pause |<--- stop
|
|
|
|
|
<--------------------------------------|
|
|
|
|
|
state-change PAUSED | PAUSED
|
|
|
|
|
-------------------------------------->|
|
|
|
|
|
|
|
|
|
|
|
play |<--- start
|
|
|
|
|
<--------------------------------------|
|
|
|
|
|
state-change STREAMING | STREAMING
|
|
|
|
|
-------------------------------------->|
|
|
|
|
|
|
|
|
|
|
|
need-input |
|
|
|
|
|
<------------------------------------->|
|
|
|
|
|
have-output |
|
|
|
|
|
<------------------------------------->|
|
|
|
|
|
process-buffer |
|
|
|
|
|
<------------------------------------->|
|
|
|
|
|
reuse-buffer |
|
|
|
|
|
<------------------------------------->|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-28 21:19:20 +02:00
|
|
|
1) Update config C->S INIT
|
|
|
|
|
|
|
|
|
|
node-update
|
|
|
|
|
port-update
|
2016-08-02 16:34:44 +02:00
|
|
|
state change CONFIGURE
|
2016-07-28 21:19:20 +02:00
|
|
|
|
|
|
|
|
2) Set formats S->C CONFIGURE
|
|
|
|
|
|
|
|
|
|
set-property
|
|
|
|
|
enumerate ports
|
2016-07-30 20:35:34 +02:00
|
|
|
add-port
|
|
|
|
|
remove-port
|
2016-07-28 21:19:20 +02:00
|
|
|
enumerate formats
|
|
|
|
|
set-format
|
|
|
|
|
|
2016-07-30 20:35:34 +02:00
|
|
|
3) Buffer requirements update C->S
|
2016-07-28 21:19:20 +02:00
|
|
|
|
|
|
|
|
Update port status
|
2016-08-02 16:34:44 +02:00
|
|
|
state change READY if enough formats are set
|
2016-07-28 21:19:20 +02:00
|
|
|
|
2016-07-30 20:35:34 +02:00
|
|
|
4) Start S->C READY
|
2016-07-28 21:19:20 +02:00
|
|
|
|
|
|
|
|
read port memory requirements
|
|
|
|
|
add_mem
|
2016-07-30 20:35:34 +02:00
|
|
|
remove_mem
|
2016-07-28 21:19:20 +02:00
|
|
|
add_buffer
|
2016-07-30 20:35:34 +02:00
|
|
|
remove_buffer
|
2016-08-02 16:34:44 +02:00
|
|
|
command START/PAUSE
|
2016-07-28 21:19:20 +02:00
|
|
|
|
2016-08-02 16:34:44 +02:00
|
|
|
5) Pause S->C PAUSED
|
2016-07-28 21:19:20 +02:00
|
|
|
|
2016-08-02 16:34:44 +02:00
|
|
|
state change STREAMING
|
|
|
|
|
set-format to NULL -> state change to CONFIGURE
|
2016-07-28 21:19:20 +02:00
|
|
|
|
2016-08-02 16:34:44 +02:00
|
|
|
5) data transfer C->S STREAMING
|
2016-07-28 21:19:20 +02:00
|
|
|
|
|
|
|
|
need-input
|
2016-07-30 20:35:34 +02:00
|
|
|
have-output
|
|
|
|
|
|
2016-07-28 21:19:20 +02:00
|
|
|
process_buffer
|
|
|
|
|
reuse_buffer
|
2016-08-02 16:34:44 +02:00
|
|
|
state change PAUSED
|
2016-07-28 21:19:20 +02:00
|
|
|
|
|
|
|
|
6) data transfer S->C
|
|
|
|
|
|
|
|
|
|
process_buffer
|
|
|
|
|
reuse_buffer
|
|
|
|
|
|
|
|
|
|
7) format change C->S
|
|
|
|
|
|
|
|
|
|
port-update
|
2016-08-02 16:34:44 +02:00
|
|
|
state change CONFIGURE
|
2016-07-28 21:19:20 +02:00
|
|
|
|
|
|
|
|
8) format change S->C
|
|
|
|
|
|
2016-07-30 20:35:34 +02:00
|
|
|
Send set-format change on ports -> READY if new memory requirements
|
2016-08-02 16:34:44 +02:00
|
|
|
-> PAUSED/STREAMING if all ok
|
|
|
|
|
|
|
|
|
|
9) format-change to NULL
|
2016-07-28 21:19:20 +02:00
|
|
|
|
2016-08-02 16:34:44 +02:00
|
|
|
state change CONFIGURE
|
2016-07-28 21:19:20 +02:00
|
|
|
|
2016-07-30 20:35:34 +02:00
|
|
|
10) ERROR
|