forked from alpartis/rtp.jitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
78 lines (55 loc) · 2.88 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
project: rtp.jitter
owner: [email protected]
license: MIT open source
Coding style/standards guidelines are important. The standards that
will be enforced are summarized as follows:
1. indent with 4 spaces (no tabs allowed)
2. Unix line endings
3. NO Hungarian notation
With exceptions noted above, standards for this project follow much
of Linux kernel and Google guidelines:
https://www.kernel.org/doc/Documentation/CodingStyle
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
helpful commentary on this topic:
http://www.linuxjournal.com/article/5780
http://thundernet.com/alanpartis/articles/standards.shtml
-----
design discussion:
this is a jitter buffer for RTP packets based on C++11 and STL.
Memory management is something to be wary of; we will store our own
pointer to given packets in our buffer and will return copies of these
pointers when packets are popped off the buffer. In the case of a
buffer reset, or similar activity, we will go ahead and delete any
packets in our buffer at the time.
This implementation assumes that it is operating in a multi-threaded
environment and syncronizes all operations/methods.
Requirements:
R0: eliminate effects of jitter in RTP packet arrival
R1: detect and track missing packets in RTP stream
R2: allow configuration of depth and packet size (in milliseconds)
R3: track and report ongoing jitter stats:
dropped packets
out of order packets
missed packets
jitter (lifetime)
max jitter (lifetime)
current depth
The RTPJitter will manage an internal buffer of RTP frames. The application
layer adds and removes packets from this buffer through the .push() and
.pop() interface. It is up to the application to manage and schedule this
process on its own thread.
A jitter buffer introduces a configured delay in the delivery and
processing of packets; this is the "depth" in milliseconds of the buffer.
Once the first packet is received into an empty buffer, the "depth" timer
starts. Once it expires, packets will be delivered upon request in the
.pop() function until the buffer becomes empty again.
The remaining logic involves how to handle newly arriving packets and
handle the exception cases: missing or out-of-order packets. ... and how
to detect and address jitter.
Jitter will be calculated as the mean deviation from the expected based on
details, definitions, and sample code from RFC3550 section 6.4.1 and
Appendix A.8.
The jitter buffer will not examine, or differentiate, packets based on SSRC.
note 1 - we use a std::deque to implement the internal buffer because it
allows us to ignore the details of memory management for the buffer
as it may grow and shrink.