jitter_buffer_common.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_
  11. #define MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_
  12. namespace webrtc {
  13. // Used to estimate rolling average of packets per frame.
  14. static const float kFastConvergeMultiplier = 0.4f;
  15. static const float kNormalConvergeMultiplier = 0.2f;
  16. enum { kMaxNumberOfFrames = 300 };
  17. enum { kStartNumberOfFrames = 6 };
  18. enum { kMaxVideoDelayMs = 10000 };
  19. enum { kPacketsPerFrameMultiplier = 5 };
  20. enum { kFastConvergeThreshold = 5 };
  21. enum VCMJitterBufferEnum {
  22. kMaxConsecutiveOldFrames = 60,
  23. kMaxConsecutiveOldPackets = 300,
  24. // TODO(sprang): Reduce this limit once codecs don't sometimes wildly
  25. // overshoot bitrate target.
  26. kMaxPacketsInSession = 1400, // Allows ~2MB frames.
  27. kBufferIncStepSizeBytes = 30000, // >20 packets.
  28. kMaxJBFrameSizeBytes = 4000000 // sanity don't go above 4Mbyte.
  29. };
  30. enum VCMFrameBufferEnum {
  31. kOutOfBoundsPacket = -7,
  32. kNotInitialized = -6,
  33. kOldPacket = -5,
  34. kGeneralError = -4,
  35. kFlushIndicator = -3, // Indicator that a flush has occurred.
  36. kTimeStampError = -2,
  37. kSizeError = -1,
  38. kNoError = 0,
  39. kIncomplete = 1, // Frame incomplete.
  40. kCompleteSession = 3, // at least one layer in the frame complete.
  41. kDuplicatePacket = 5 // We're receiving a duplicate packet.
  42. };
  43. enum VCMFrameBufferStateEnum {
  44. kStateEmpty, // frame popped by the RTP receiver
  45. kStateIncomplete, // frame that have one or more packet(s) stored
  46. kStateComplete, // frame that have all packets
  47. };
  48. enum { kH264StartCodeLengthBytes = 4 };
  49. } // namespace webrtc
  50. #endif // MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_