Commit graph

809 commits

Author SHA1 Message Date
Wim Taymans d34184dd03 rtpjitterbuffer: fix writability of properties 2013-09-19 14:32:48 +02:00
Wim Taymans 6bb2626498 rtpjitterbuffer: reevaluate the current timer after timeout
When we trigger the timeout logic of a timer, reevaluate it because it is
possible that it still has the lowest timeout.
2013-09-18 16:33:40 +02:00
Wim Taymans 8d021b6ede rtpjitterbuffer: don't update time when unscheduled
Don't try to estimate the current time when we got unscheduled.
2013-09-18 16:31:26 +02:00
Wim Taymans 65606a25bf rtpjitterbuffer: init packet spacing on first buffer
Already init the packet spacing variables on the first buffer so that we can
calculate the spacing on the second buffer already.
2013-09-18 16:29:37 +02:00
Wim Taymans f2efdf28f5 rtpjitterbuffer: push the lost event from the timer thread
Instead of pushing the lost event from the chain function, schedule a timeout
that will push the lost event from the timer thread. This avoid blocking the
upstream thread while we push and sync the event.
2013-09-18 14:57:09 +02:00
Wim Taymans 5d5fc03e04 rtpjitterbuffer: round gap duration to multiple of duration
Make sure the gap duration in the lost event is a multiple of the packet
duration.
Enable another test.
2013-09-18 14:12:47 +02:00
Wim Taymans 6e4a051d40 rtpjitterbuffer: keep track of duration
Keep track of the estimated duration of missing packets and use it in the lost
event.
Enable another unit test
2013-09-18 12:29:38 +02:00
Wim Taymans ac3bb3acf6 rtpjitterbuffer: handle large gaps with one lost event
When we have a large number of missing packets, generate one lost event for all
the packets that have no chance of being pushed out in time.
Fix and activate unit test for large gaps.
2013-09-18 11:59:28 +02:00
Wim Taymans 26402e1c21 rtpjitterbuffer: refactor lost event sending
Also make sure we only increment the expected seqnum and last
output timestamp.
2013-09-18 11:57:06 +02:00
Wim Taymans f49981a597 jitterbuffer: refactor timeout triggers 2013-09-17 23:29:56 +02:00
Wim Taymans 047021c443 jitterbuffer: simplify the timeout code
Keep track of the current time in the timeout loop.
Loop over all timers and trigger all the expired ones, we can do this in the
same loop that selects the new best timer.
2013-09-17 23:29:56 +02:00
Wim Taymans fa1ef3328b jitterbuffer: rearrange timer update code
Also update the timers when retransmission is disabled. We need to
do this because when we added LOST timers when we detected missing packets and
we need to remove those timers when the packet finally arrives.
2013-09-17 23:29:56 +02:00
Wim Taymans 232fdd8b56 jitterbuffer: release lock on shutdown 2013-09-17 15:19:42 +02:00
Wim Taymans 4de919a17a jitterbuffer: use separate thread for timeouts
Use a separate thread for scheduling the timeouts instead of using the
downstream streaming thread that might block at any time.
2013-09-16 15:55:55 +02:00
Olivier Crête b9ceafe5af rtpsession: Demux RTCP buffers from the RTP stream
If there are RTCP buffers in the RTP stream, process them as
RTCP. This way, we want receive streams following RFC 5761

https://bugzilla.gnome.org/show_bug.cgi?id=687657
2013-09-13 16:25:49 +02:00
Wim Taymans 28e5f90988 rtpbin: use PacketInfo for the sender
Avoid mapping the packet multiple times when sending RTP.
2013-09-13 14:34:28 +02:00
Wim Taymans a02c9473d8 rtpbin: store more in the PacketInfo
Store all info in the PacketInfo so that we can avoid mapping the packet
multiple times.
2013-09-13 14:34:28 +02:00
Wim Taymans e5c789abd6 session: store more in the PacketInfo structure 2013-09-13 14:34:28 +02:00
Wim Taymans 47662f9ca4 rtpbin: RTPArrivalStats -> RTPPacketInfo
Rename a structure because we are also going to use this for the sender
bits.
2013-09-13 14:34:28 +02:00
Wim Taymans c795b72988 source: small cleanups 2013-09-13 14:34:27 +02:00
Wim Taymans 9f9ba21404 jitterbuffer: handle segments with non-0 start
We keep the DTS and PTS in running-time inside the jitterbuffer. Make sure to
transform it back to a buffer timestamp before pushing out the buffer.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=707931
2013-09-12 15:04:30 +02:00
Wim Taymans f1106cde66 session: only update next check time when reconsidering
Don't update the next RTCP check time in all cases but only when we
reconsidered. This avoids delaying sending a full RTCP packet when we
are doing early feedback.
2013-08-27 09:55:52 +02:00
Wim Taymans 47065db0b6 session: add more debug 2013-08-27 09:55:52 +02:00
Wim Taymans 454d75951e jitterbuffer: fix types of the retransmission event 2013-08-27 09:55:52 +02:00
Wim Taymans dd4af0d11c jitterbuffer: only timeout EXPECTED timers on gap
Only timeout the EXPECTED timers when we detect a large seqnum gap.
2013-08-27 09:44:18 +02:00
Wim Taymans 4b7bcc2ec1 rtsession: fix locking
We need to take the session lock when getting and manipulating the
source.
2013-08-26 11:50:27 +02:00
Wim Taymans 3f46527f75 rtpsession: add some more debug 2013-08-26 11:50:13 +02:00
Wim Taymans 54e7e7547a rtxqueue: add property to configure queue size 2013-08-23 15:47:25 +02:00
Wim Taymans 84833bed11 rtpbin: proxy jitterbuffer do-retransmission property 2013-08-23 12:10:19 +02:00
Wim Taymans 89b9019e3e rtx: various improvements
Use locking
Don't push from the event handler, collected packets in a queue and push from
the chain function.
Clear queues on shutdown.
2013-08-21 17:02:27 +02:00
Wim Taymans ee15bc9284 session: generate events correctly
Do correct shifting of the bitmask for lost packets.
2013-08-21 17:02:27 +02:00
Wim Taymans 67523d3ecb rtp: register rtx element better 2013-08-21 17:02:26 +02:00
Wim Taymans 587dc055e9 jitterbuffer: handle EOS
When the queue is empty, and we received EOS, pause and push an EOS
event downstream.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=706387
2013-08-20 14:36:59 +02:00
Wim Taymans 533f26fc99 jitterbuffer: update docs 2013-08-20 10:26:15 +02:00
Wim Taymans c7f9ef8012 jitterbuffer: update all timers
Keep looping over all registered timers so that we can mark them lost instead of
stopping as soon as we find the timer for the current seqnum.
2013-08-20 10:25:17 +02:00
Wim Taymans 5debda9ca1 jitterbuffer: remove unused variables 2013-08-20 08:55:50 +02:00
Wim Taymans a88db5fa2c jitterbuffer: reorganize timer handling
Restructure handling of incomming packet and the gap with the expected seqnum
and register all timers from the _chain function.
Convert a timer to a LOST packet timer when the max amount of retransmission
requests has been reached.
2013-08-19 22:04:51 +02:00
Wim Taymans d9d6eac4bb jitterbuffer: refactor packet spacing calculation 2013-08-19 22:04:50 +02:00
Wim Taymans c4dc159656 jitterbuffer: keep track of last seqnum and dts 2013-08-19 22:04:50 +02:00
Wim Taymans 652ce95ca6 jitterbuffer: small cleanups 2013-08-19 22:04:50 +02:00
Wim Taymans b4a35bbe82 jitterbuffer: reset retransmission timers in add/reschedule
Reset the retransmission timers when adding and rescheduling a timer.
2013-08-19 22:04:50 +02:00
Wim Taymans cf8a0652f3 jitterbuffer: rename variables for packet spacing 2013-08-19 22:04:50 +02:00
Wim Taymans ec82e4ab7c jitterbuffer: remove lost timer when we get the packet
When we receive a packet, also remove the LOST timer for it.
2013-08-19 22:04:50 +02:00
Wim Taymans 2f03b43b21 jitterbuffer: expected seqnum must increase
Only update the expected seqnum when it is bigger than the previous expected
seqnum.
2013-08-19 22:04:50 +02:00
Wim Taymans c5bf376bb5 jitterbuffer: add more debug 2013-08-19 22:04:50 +02:00
Wim Taymans ff825a2919 rtxqueue: add retransmission queue element 2013-08-19 22:04:50 +02:00
Wim Taymans 5fe18ee432 session: add some docs 2013-08-19 22:04:49 +02:00
Wim Taymans 482dacfb54 session: handle NACK feedback and generate events
Handle and parse the feedback NACK packets and generate a Retransmission
event for each NACKed packet
2013-08-19 22:04:49 +02:00
Wim Taymans f11c2c9b3b jitterbuffer: forward flush before stopping dataflow
First forward the flush event and then stop our loop function.
2013-08-14 16:19:32 +02:00
Wim Taymans 48174164eb session: add NACK feedback in RTCP 2013-08-06 15:50:19 +02:00