1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/mtransport/README Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +This is a generic media transport system for WebRTC. 1.5 + 1.6 +The basic model is that you have a TransportFlow which contains a 1.7 +series of TransportLayers, each of which gets an opportunity to 1.8 +manipulate data up and down the stack (think SysV STREAMS or a 1.9 +standard networking stack). You can also address individual 1.10 +sublayers to manipulate them or to bypass reading and writing 1.11 +at an upper layer; WebRTC uses this to implement DTLS-SRTP. 1.12 + 1.13 + 1.14 +DATAFLOW MODEL 1.15 +Unlike the existing nsSocket I/O system, this is a push rather 1.16 +than a pull system. Clients of the interface do writes downward 1.17 +with SendPacket() and receive notification of incoming packets 1.18 +via callbacks registed via sigslot.h. It is the responsibility 1.19 +of the bottom layer (or any other layer which needs to reference 1.20 +external events) to arrange for that somehow; typically by 1.21 +using nsITimer or the SocketTansportService. 1.22 + 1.23 +This sort of push model is a much better fit for the demands 1.24 +of WebRTC, expecially because ICE contexts span multiple 1.25 +network transports. 1.26 + 1.27 + 1.28 +THREADING MODEL 1.29 +There are no thread locks. It is the responsibility of the caller to 1.30 +arrange that any given TransportLayer/TransportFlow is only 1.31 +manipulated in one thread at once. One good way to do this is to run 1.32 +everything on the STS thread. Many of the existing layer implementations 1.33 +(TransportLayerPrsock, TransportLayerIce, TransportLayerLoopback) 1.34 +already run on STS so in those cases you must run on STS, though 1.35 +you can do setup on the main thread and then activate them on the 1.36 +STS. 1.37 + 1.38 + 1.39 +EXISTING TRANSPORT LAYERS 1.40 +The following transport layers are currently implemented: 1.41 + 1.42 +* DTLS -- a wrapper around NSS's DTLS [RFC 6347] stack 1.43 +* ICE -- a wrapper around the nICEr ICE [RFC 5245] stack. 1.44 +* Prsock -- a wrapper around NSPR sockets 1.45 +* Loopback -- a loopback IO mechanism 1.46 +* Logging -- a passthrough that just logs its data 1.47 + 1.48 +The last three are primarily for debugging. 1.49 + 1.50 + 1.51 + 1.52 + 1.53 + 1.54 + 1.55 + 1.56 + 1.57 + 1.58 + 1.59 + 1.60 + 1.61 + 1.62 +