Lower the maximum RTP queuing delay to 10 ms instead of 40 ms to reduce the number of frames dropped when a packet is lost

This commit is contained in:
Cameron Gutman 2014-11-27 21:52:03 -06:00
parent 5fc438a0be
commit 021cfd1737

View File

@ -25,6 +25,11 @@ public class VideoStream {
public static final int FIRST_FRAME_TIMEOUT = 5000;
public static final int RTP_RECV_BUFFER = 256 * 1024;
// We can't request an IDR frame until the depacketizer knows
// that a packet was lost. This timeout bounds the time that
// the RTP queue will wait for missing/reordered packets.
public static final int MAX_RTP_QUEUE_DELAY_MS = 10;
// The ring size MUST be greater than or equal to
// the maximum number of packets in a fully
// presentable frame
@ -201,7 +206,7 @@ public class VideoStream {
VideoPacket ring[] = new VideoPacket[VIDEO_RING_SIZE];
VideoPacket queuedPacket;
int ringIndex = 0;
RtpReorderQueue rtpQueue = new RtpReorderQueue();
RtpReorderQueue rtpQueue = new RtpReorderQueue(16, MAX_RTP_QUEUE_DELAY_MS);
RtpReorderQueue.RtpQueueStatus queueStatus;
// Preinitialize the ring buffer