1 /* 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_ 12 #define MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_ 13 14 namespace webrtc { 15 16 // Used to estimate rolling average of packets per frame. 17 static const float kFastConvergeMultiplier = 0.4f; 18 static const float kNormalConvergeMultiplier = 0.2f; 19 20 enum { kMaxNumberOfFrames = 300 }; 21 enum { kStartNumberOfFrames = 6 }; 22 enum { kMaxVideoDelayMs = 10000 }; 23 enum { kPacketsPerFrameMultiplier = 5 }; 24 enum { kFastConvergeThreshold = 5 }; 25 26 enum VCMJitterBufferEnum { 27 kMaxConsecutiveOldFrames = 60, 28 kMaxConsecutiveOldPackets = 300, 29 // TODO(sprang): Reduce this limit once codecs don't sometimes wildly 30 // overshoot bitrate target. 31 kMaxPacketsInSession = 1400, // Allows ~2MB frames. 32 kBufferIncStepSizeBytes = 30000, // >20 packets. 33 kMaxJBFrameSizeBytes = 4000000 // sanity don't go above 4Mbyte. 34 }; 35 36 enum VCMFrameBufferEnum { 37 kOutOfBoundsPacket = -7, 38 kNotInitialized = -6, 39 kOldPacket = -5, 40 kGeneralError = -4, 41 kFlushIndicator = -3, // Indicator that a flush has occurred. 42 kTimeStampError = -2, 43 kSizeError = -1, 44 kNoError = 0, 45 kIncomplete = 1, // Frame incomplete. 46 kCompleteSession = 3, // at least one layer in the frame complete. 47 kDuplicatePacket = 5 // We're receiving a duplicate packet. 48 }; 49 50 enum VCMFrameBufferStateEnum { 51 kStateEmpty, // frame popped by the RTP receiver 52 kStateIncomplete, // frame that have one or more packet(s) stored 53 kStateComplete, // frame that have all packets 54 }; 55 56 enum { kH264StartCodeLengthBytes = 4 }; 57 } // namespace webrtc 58 59 #endif // MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_ 60