niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_ |
| 12 | #define MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
mikhal@webrtc.org | 119c67d | 2013-01-31 17:18:02 +0000 | [diff] [blame] | 14 | namespace webrtc { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 15 | |
agalusza@google.com | d818dcb | 2013-07-29 21:48:11 +0000 | [diff] [blame] | 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 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 20 | enum { kMaxNumberOfFrames = 300 }; |
| 21 | enum { kStartNumberOfFrames = 6 }; |
| 22 | enum { kMaxVideoDelayMs = 10000 }; |
agalusza@google.com | d818dcb | 2013-07-29 21:48:11 +0000 | [diff] [blame] | 23 | enum { kPacketsPerFrameMultiplier = 5 }; |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 24 | enum { kFastConvergeThreshold = 5 }; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 25 | |
mikhal@webrtc.org | 119c67d | 2013-01-31 17:18:02 +0000 | [diff] [blame] | 26 | enum VCMJitterBufferEnum { |
sprang | 907dcfd | 2015-08-05 01:09:11 -0700 | [diff] [blame] | 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. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | }; |
| 35 | |
mikhal@webrtc.org | 119c67d | 2013-01-31 17:18:02 +0000 | [diff] [blame] | 36 | enum VCMFrameBufferEnum { |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 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, |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame^] | 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. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 48 | }; |
| 49 | |
mikhal@webrtc.org | 119c67d | 2013-01-31 17:18:02 +0000 | [diff] [blame] | 50 | enum VCMFrameBufferStateEnum { |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 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 |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | }; |
| 55 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 56 | enum { kH264StartCodeLengthBytes = 4 }; |
mikhal@webrtc.org | 119c67d | 2013-01-31 17:18:02 +0000 | [diff] [blame] | 57 | } // namespace webrtc |
stefan@webrtc.org | 4c059d8 | 2011-10-13 07:35:37 +0000 | [diff] [blame] | 58 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 59 | #endif // MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_ |