JitterBufferT Class |
Handles the creation and release of complete RTP frames.
Namespace: StreamCoders.Rtp
The JitterBufferT type exposes the following members.
Name | Description | |
---|---|---|
JitterBufferT | Initializes a new instance of the JitterBufferT class |
Name | Description | |
---|---|---|
CompleteCount | ||
Count |
Gets the number of frames currently maintained in jitter buffer.
| |
DroppedFrames |
Name | Description | |
---|---|---|
AddPacket(RtpPacket) |
Adds a packet to the jitter. This method will automatically create a frame if one does
not already exist and call playoutBufferToUse.UpdateRelativeTimestamp once on the frame object.
| |
AddPacketT1(RtpPacket) |
Adds a packet to the jitter. This method will automatically create a frame if one does
not already exist and call playoutBufferToUse.UpdateRelativeTimestamp once on the frame object.
| |
Clear |
Removes all frames from jitter buffer.
| |
ContainsFrame |
Checks whether a frame is already contained within the jitter.
| |
FindCompleteFrame |
Finds the first available frame to be release from the jitter.
| |
SetPlayoutBuffer |
Set this to maintain playoutBufferToUse times from within the jitter buffer. RTCP updates will still
have to be managed from the outside by sharing the object.
|
Name | Description | |
---|---|---|
AdaptiveExpiry |
Adaptive expiry automatically adjusts the Expiry time by measuring the weighed average
time of frame completion. Avg += 1/16 * (previous - current);
The initial FrameExpiry in this scenario is still important as the algorithm needs a
starting point.
| |
AdaptiveMaximumThreshold |
In an adaptive expiry scenario, the maximum change is FrameExpiry *
AdaptiveMaximumThreshold.
| |
AdaptiveOvershootFactor |
The adaptive overshoot factor.
| |
CheckFrameComplete |
Some framing types don't set a marker bit. If set to false, the jitter will not check if
the frame is complete and will release it upon FrameExpiry.
| |
CheckGaps |
Check whether frame gaps exist as criteria for a complete frame.
| |
FrameExpiry |
Time to wait before a frame is released from the jitter.
| |
MinimumFrameAge |
The minimum age a frame must have before it is released by the jitter.
| |
Name |
The name.
| |
SkipLateOrIncompleteFrames |
If set to true, the jitter will not release partially completed frames (due to packet
loss etc.). A frame is considered late when the frame age is 1.5 times that of
FrameExpiry.
|
Name | Description | |
---|---|---|
Copy | Overloaded.
Creates a copy of the object.
(Defined by ObjectExtensions.) | |
Copy(Object) | Overloaded.
Creates a deep copy of the object using the supplied object as a target for the copy operation.
(Defined by ObjectExtensions.) |
To handle alternative critera on when a frame is complete, this class needs to be derived and method FindCompleteFrame will need to be overridden.
class Program { static JitterBuffer<H264Frame> jitter = new JitterBuffer<H264Frame>(); static void Main(string[] args) { // Create participant and hook up RTP received event. var participant = ParticipantHelper.CreateUdpParticipant(IPAddress.Parse("127.0.0.1"), 12000, null, 0); participant.OnRtpReceive += participant_OnRtpReceive; while(true) { var frame = jitter.FindCompleteFrame(); if (frame == null) continue; Console.WriteLine("Complete frame received {0}", frame.Timestamp); } } static void participant_OnRtpReceive(object sender, RtpPacket Packet, ArraySegment<byte> RawPacket, EndPoint remoteEndpoint) { jitter.AddPacket(Packet); } }