More work on wire protocol

Make separate payload for the header.
Make release-fd payloads
capture_buffer -> peek_buffer to avoid a copy
remove release-buffer, we really need to release each fd in the buffer
separately.
provide_buffer -> send_buffer so that we can also use this to send the
release-fd messages.
in pinossrc, send back release-fd messages when the fd is no longer in
use.
This commit is contained in:
Wim Taymans 2015-08-31 16:47:32 +02:00
parent c2cf359076
commit 8d1ad2ea63
10 changed files with 351 additions and 155 deletions

View file

@ -55,11 +55,8 @@ Wire
Fixed header
<flags> : 4 bytes : buffer flags
<seq> : 4 bytes : sequence number
<pts> : 8 bytes : presentation time
<dts-offset> : 8 bytes : dts-offset
<length> : 8 bytes : total message length
<version> : 4 bytes : total message length
<length> : 4 bytes : total message length
Followed by 1 or more type-length-data sections
@ -69,28 +66,36 @@ Followed by 1 or more type-length-data sections
Types:
0: fd-payload section
1: header
Header for payload
<flags> : 4 bytes : buffer flags
<seq> : 4 bytes : sequence number
<pts> : 8 bytes : presentation time
<dts-offset> : 8 bytes : dts-offset
2: fd-payload section
Used to send a buffer between client and server.
<id> : 4 bytes : id of the fd-payload
<offset> : 8 bytes : offset
<size> : 8 bytes : size
<fd-index> : 4 bytes : index of fd
<id> : 4 bytes : id of the fd-payload
<offset> : 8 bytes : offset
<size> : 8 bytes : size
<fd-index> : 4 bytes : index of fd
1: release fd-payload
3: release fd-payload
Release a fd-payload with <id>
<id> : 4 bytes : the id number of the released fd-payload
<id> : 4 bytes : the id number of the released fd-payload
2: format change
4: format change
<format-id> : 1 byte : format id
<format> : 0-terminated : contains serialized format
<format-id> : 1 byte : format id
<format> : 0-terminated : contains serialized format
3: property changes
5: property changes
<key> : 0-terminated : key
<value> : 0-terminated : value