1This documents the protocol used to pass data over fds between ipcpipelinesrc 2and ipcpipelinesink. 3 4The protocol is used in both directions. However, some combinations do 5not make sense (eg, a buffer going from ipcpipelinesrc to ipcpipelinesink). 6 7The protocol consists of an arbitrary number of variable sized chunks 8with a type. Each chunk has a request ID which can be used to match a 9request with its reply (ack / query result). 10 11Each chunk consists of: 12 - a type (byte): 13 1: ack 14 2: query result 15 3: buffer 16 4: event 17 5: sink message event 18 6: query 19 7: state change 20 8: state lost 21 9: message 22 10: error/warning/info message 23 - a request ID, 4 bytes, little endian 24 - the payload size, 4 bytes, little endian 25 - N bytes payload 26 27Depending on the type, the payload can contain: 28 29 - 1: ack 30 result: 4 bytes, little endian 31 interpreted as GstFlowReturn for buffers, boolean for events and 32 GstStateChangeReturn for state changes 33 - 2: query result 34 result boolean: 1 byte 35 query type: 4 bytes, little endian 36 returned query string representation, NUL terminated 37 - 3: buffer: 38 pts: 8 bytes, little endian 39 dts: 8 bytes, little endian 40 duration: 8 bytes, little endian 41 offset: 8 bytes, little endian 42 offset end: 8 bytes, little endian 43 flags: 8 bytes, little endian 44 buffer size: 4 bytes, little endian 45 data: contents of the buffer data, size specified in "buffer size" 46 number of GstMeta: 4 bytes, little endian 47 For each GstMeta: 48 bytes: 4 bytes, little endian 49 this is the number of bytes before the string representation 50 at the end of this block, including the 4 bytes of itself 51 flags: 4 bytes, little endian 52 length of the GstMetaInfo::api name: 4 bytes, little endian 53 GstMetaInfo::api name: string, NUL terminated 54 GstMetaInfo::size: 8 bytes, little endian 55 length of the string representation: 4 bytes, little endian 56 string representation, NUL terminated 57 - 4: event 58 event type: 4 bytes, little endian 59 sequence number: 4 bytes, little endian 60 direction: 1 byte 61 whether the event is going upstream (1) or downstream (0) 62 string representation, NUL terminated 63 - 5: sink message event 64 message type: 4 bytes, little endian 65 event sequence number: 4 bytes, little endian 66 message sequence number: 4 bytes, little endian 67 length: 4 bytes, little endian 68 event structure name: length bytes, NUL terminated 69 message structure string representation: remaining bytes, NUL terminated 70 - 6: query 71 query type: 4 bytes, little endian 72 direction: 1 byte 73 whether the query is going upstream (1) or downstream (0) 74 string representation, NUL terminated 75 - 7: state change 76 GstStateChange: 4 bytes, little endian 77 - 8: state lost 78 no payload 79 - 9: message 80 message type: 4 bytes, little endian 81 string representation, NUL terminated 82 - 10: error/warning/info message 83 message type (2 = error, 1 = warning, 0 = info): 1 byte 84 error domain string length: 4 bytes, little endian 85 string representation of the error domain, NUL terminated 86 error code: 4 bytes, little endian 87 length: 4 bytes, little endian 88 if zero: no error message 89 if non zero: As many bytes as this length: the error message, NUL terminated 90 length: 4 bytes, little endian 91 if zero: no extra message 92 if non zero: As many bytes as this length: the error extra debug message, NUL terminated 93