Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / media / mtransport / README
blobf25ae6e3819f97551b3d27886e8829ab29016fac
1 This is a generic media transport system for WebRTC.
3 The basic model is that you have a TransportFlow which contains a
4 series of TransportLayers, each of which gets an opportunity to
5 manipulate data up and down the stack (think SysV STREAMS or a
6 standard networking stack). You can also address individual
7 sublayers to manipulate them or to bypass reading and writing
8 at an upper layer; WebRTC uses this to implement DTLS-SRTP.
11 DATAFLOW MODEL
12 Unlike the existing nsSocket I/O system, this is a push rather
13 than a pull system. Clients of the interface do writes downward
14 with SendPacket() and receive notification of incoming packets
15 via callbacks registed via sigslot.h. It is the responsibility
16 of the bottom layer (or any other layer which needs to reference
17 external events) to arrange for that somehow; typically by
18 using nsITimer or the SocketTansportService.
20 This sort of push model is a much better fit for the demands
21 of WebRTC, expecially because ICE contexts span multiple
22 network transports.
25 THREADING MODEL
26 There are no thread locks. It is the responsibility of the caller to
27 arrange that any given TransportLayer/TransportFlow is only
28 manipulated in one thread at once. One good way to do this is to run
29 everything on the STS thread. Many of the existing layer implementations
30 (TransportLayerPrsock, TransportLayerIce, TransportLayerLoopback)
31 already run on STS so in those cases you must run on STS, though
32 you can do setup on the main thread and then activate them on the
33 STS.
36 EXISTING TRANSPORT LAYERS
37 The following transport layers are currently implemented:
39 * DTLS -- a wrapper around NSS's DTLS [RFC 6347] stack
40 * ICE  -- a wrapper around the nICEr ICE [RFC 5245] stack.
41 * Prsock -- a wrapper around NSPR sockets
42 * Loopback -- a loopback IO mechanism
43 * Logging -- a passthrough that just logs its data
45 The last three are primarily for debugging.