Mypal/media/mtransport
Fedor 7d3ec22993 Redundant code path cleanup. 2021-02-04 16:54:37 +02:00
..
build Redundant code path cleanup. 2021-02-04 16:54:37 +02:00
test Nuke vim lines. 2021-02-04 16:48:36 +02:00
testlib Nuke vim lines. 2021-02-04 16:48:36 +02:00
third_party Nuke vim lines. 2021-02-04 16:48:36 +02:00
README ooops, some files where missed 2019-03-12 18:31:25 +03:00
common.build Nuke vim lines. 2021-02-04 16:48:36 +02:00
databuffer.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
dtlsidentity.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
dtlsidentity.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
logging.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
m_cpp_utils.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
moz.build Nuke vim lines. 2021-02-04 16:48:36 +02:00
nr_socket_prsock.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
nr_socket_prsock.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
nr_timer.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
nricectx.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
nricectx.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
nricectxhandler.cpp basic source 2019-03-11 13:26:37 +03:00
nricectxhandler.h basic source 2019-03-11 13:26:37 +03:00
nricemediastream.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
nricemediastream.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
nriceresolver.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
nriceresolver.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
nriceresolverfake.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
nriceresolverfake.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
nrinterfaceprioritizer.cpp basic source 2019-03-11 13:26:37 +03:00
nrinterfaceprioritizer.h basic source 2019-03-11 13:26:37 +03:00
rlogconnector.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
rlogconnector.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
runnable_utils.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
sigslot.h basic source 2019-03-11 13:26:37 +03:00
simpletokenbucket.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
simpletokenbucket.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
stun_socket_filter.cpp basic source 2019-03-11 13:26:37 +03:00
stun_socket_filter.h basic source 2019-03-11 13:26:37 +03:00
test_nr_socket.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
test_nr_socket.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportflow.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportflow.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayer.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayer.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerdtls.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerdtls.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerice.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerice.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerlog.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerlog.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerloopback.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerloopback.h Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerprsock.cpp Nuke vim lines. 2021-02-04 16:48:36 +02:00
transportlayerprsock.h Nuke vim lines. 2021-02-04 16:48:36 +02:00

README

This is a generic media transport system for WebRTC.

The basic model is that you have a TransportFlow which contains a
series of TransportLayers, each of which gets an opportunity to
manipulate data up and down the stack (think SysV STREAMS or a
standard networking stack). You can also address individual
sublayers to manipulate them or to bypass reading and writing
at an upper layer; WebRTC uses this to implement DTLS-SRTP.


DATAFLOW MODEL
Unlike the existing nsSocket I/O system, this is a push rather
than a pull system. Clients of the interface do writes downward
with SendPacket() and receive notification of incoming packets
via callbacks registed via sigslot.h. It is the responsibility
of the bottom layer (or any other layer which needs to reference
external events) to arrange for that somehow; typically by
using nsITimer or the SocketTansportService.

This sort of push model is a much better fit for the demands
of WebRTC, expecially because ICE contexts span multiple
network transports.


THREADING MODEL
There are no thread locks. It is the responsibility of the caller to
arrange that any given TransportLayer/TransportFlow is only
manipulated in one thread at once. One good way to do this is to run
everything on the STS thread. Many of the existing layer implementations
(TransportLayerPrsock, TransportLayerIce, TransportLayerLoopback)
already run on STS so in those cases you must run on STS, though
you can do setup on the main thread and then activate them on the
STS.


EXISTING TRANSPORT LAYERS
The following transport layers are currently implemented:

* DTLS -- a wrapper around NSS's DTLS [RFC 6347] stack
* ICE  -- a wrapper around the nICEr ICE [RFC 5245] stack.
* Prsock -- a wrapper around NSPR sockets
* Loopback -- a loopback IO mechanism
* Logging -- a passthrough that just logs its data

The last three are primarily for debugging.