您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

134 行
4.6KB

  1. #ifndef _rtp_profile_h_
  2. #define _rtp_profile_h_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. enum
  7. {
  8. RTP_TYPE_UNKNOWN = 0,
  9. RTP_TYPE_AUDIO,
  10. RTP_TYPE_VIDEO,
  11. RTP_TYPE_SYSTEM,
  12. };
  13. enum { RTP_PAYLOAD_DYNAMIC = 96, };
  14. /// https://en.wikipedia.org/wiki/RTP_audio_video_profile
  15. /// RFC3551 6. Payload Type Definitions (p28)
  16. struct rtp_profile_t
  17. {
  18. int payload; // 0~127, 96-127 dynamic, 35-71 unassigned, 72-76 reserved, 77-95 unassigned
  19. int avtype; // 0-unknown, 1-audio, 2-video, 3-system(audio/video)
  20. int channels; // number of channels
  21. int frequency; // clock rate
  22. char name[32]; // case insensitive
  23. };
  24. /***
  25. {
  26. // audio
  27. { 0, "PCMU", 8000, 1 }, // G711 mu-law
  28. { 1, "", 0, 0 }, // reserved
  29. { 2, "", 0, 0 }, // reserved
  30. { 3, "GSM", 8000, 1 },
  31. { 4, "G723", 8000, 1 },
  32. { 5, "DVI4", 8000, 1 },
  33. { 6, "DVI4", 16000, 1 },
  34. { 7, "LPC", 8000, 1 },
  35. { 8, "PCMA", 8000, 1 }, // G711 A-law
  36. { 9, "G722", 8000, 1 },
  37. {10, "L16", 44100, 2 },
  38. {11, "L16", 44100, 1 },
  39. {12, "QCELP", 8000, 1 },
  40. {13, "CN", 8000, 1 },
  41. {14, "MPA", 90000, 0 }, // MPEG-1/MPEG-2 audio
  42. {15, "G728", 8000, 1 },
  43. {16, "DVI4", 11025, 1 },
  44. {17, "DVI4", 22050, 1 },
  45. {18, "G729", 8000, 1 },
  46. {19, "", 0, 0 }, // reserved
  47. {20, "", 0, 0 }, // unassigned
  48. {21, "", 0, 0 }, // unassigned
  49. {22, "", 0, 0 }, // unassigned
  50. {23, "", 0, 0 }, // unassigned
  51. //{ 0, "G726-40", 8000, 1 },
  52. //{ 0, "G726-32", 8000, 1 },
  53. //{ 0, "G726-24", 8000, 1 },
  54. //{ 0, "G726-16", 8000, 1 },
  55. //{ 0, "G729-D", 8000, 1 },
  56. //{ 0, "G729-E", 8000, 1 },
  57. //{ 0, "GSM-EFR", 8000, 1 },
  58. //{ 0, "L8", var, 1 },
  59. // video
  60. {24, "", 0, 0 }, // unassigned
  61. {25, "CelB", 90000, 0 }, // SUN CELL-B
  62. {26, "JPEG", 90000, 0 },
  63. {27, "", 0, 0 }, // unassigned
  64. {28, "nv", 90000, 0 },
  65. {29, "", 0, 0 }, // unassigned
  66. {30, "", 0, 0 }, // unassigned
  67. {31, "H261", 90000, 0 },
  68. {32, "MPV", 90000, 0 }, // MPEG-1/MPEG-2 video
  69. {33, "MP2T", 90000, 0 }, // MPEG-2 TS
  70. {34, "H263", 90000, 0 },
  71. //{ 0, "H263-1998",90000, 0 },
  72. // 35-71 unassigned
  73. // 72-76 reserved
  74. // 77-95 unassigned
  75. // 96-127 dynamic
  76. {96, "MPG4", 90000, 0 }, // RFC3640 RTP Payload Format for Transport of MPEG-4 Elementary Streams
  77. {97, "MP2P", 90000, 0 }, // RFC3555 4.2.11 Registration of MIME media type video/MP2P
  78. {98, "H264", 90000, 0 }, // RFC6184 RTP Payload Format for H.264 Video
  79. };
  80. ***/
  81. enum
  82. {
  83. RTP_PAYLOAD_PCMU = 0, // ITU-T G.711 PCM µ-Law audio 64 kbit/s (rfc3551)
  84. RTP_PAYLOAD_G723 = 4, // ITU-T G.723.1 8000/1, 30ms (rfc3551)
  85. RTP_PAYLOAD_PCMA = 8, // ITU-T G.711 PCM A-Law audio 64 kbit/s (rfc3551)
  86. RTP_PAYLOAD_G722 = 9, // ITU-T G.722 audio 64 kbit/s (rfc3551)
  87. RTP_PAYLOAD_CN = 13, // Real-time Transport Protocol (RTP) Payload for Comfort Noise (CN) (rfc3389)
  88. RTP_PAYLOAD_MP3 = 14, // MPEG-1/MPEG-2 audio (rfc2250)
  89. RTP_PAYLOAD_G729 = 18, // ITU-T G.729 and G.729a audio 8 kbit/s (rfc3551)
  90. RTP_PAYLOAD_SVACA = 20, // GB28181-2016
  91. RTP_PAYLOAD_JPEG = 26, // JPEG video (rfc2435)
  92. RTP_PAYLOAD_MPV = 32, // MPEG-1 and MPEG-2 video (rfc2250)
  93. RTP_PAYLOAD_MP2T = 33, // MPEG-2 transport stream (rfc2250)
  94. RTP_PAYLOAD_H263 = 34, // H.263 video, first version (1996) (rfc2190)
  95. RTP_PAYLOAD_AV1X = 35, // https://bugs.chromium.org/p/webrtc/issues/detail?id=11042
  96. RTP_PAYLOAD_MP2P = 96, // MPEG-2 Program Streams video (rfc2250)
  97. RTP_PAYLOAD_MP4V = 97, // MP4V-ES MPEG-4 Visual (rfc6416)
  98. RTP_PAYLOAD_H264 = 98, // H.264 video (MPEG-4 Part 10) (rfc6184)
  99. RTP_PAYLOAD_SVAC = 99, // GB28181-2016
  100. RTP_PAYLOAD_H265 = 100, // H.265 video (MPEG-H Part 2) (rfc7798)
  101. RTP_PAYLOAD_MP4A = 101, // MPEG4-generic audio/video MPEG-4 Elementary Streams (rfc3640)
  102. RTP_PAYLOAD_LATM = 102, // MP4A-LATM MPEG-4 Audio (rfc6416)
  103. RTP_PAYLOAD_OPUS = 103, // RTP Payload Format for the Opus Speech and Audio Codec (rfc7587)
  104. RTP_PAYLOAD_MP4ES = 104, // MPEG4-generic audio/video MPEG-4 Elementary Streams (rfc3640)
  105. RTP_PAYLOAD_VP8 = 105, // RTP Payload Format for VP8 Video (rfc7741)
  106. RTP_PAYLOAD_VP9 = 106, // RTP Payload Format for VP9 Video draft-ietf-payload-vp9-03
  107. RTP_PAYLOAD_AV1 = 107, // https://aomediacodec.github.io/av1-rtp-spec/
  108. RTP_PAYLOAD_RTX = 110, // RTP Retransmission Payload Format (rfc4588)
  109. RTP_PAYLOAD_RED = 111, // RTP Payload for Redundant Audio Data (rfc2198)
  110. RTP_PAYLOAD_FEC_ULP = 112, // RTP Payload Format for Generic Forward Error Correction (rfc5109)
  111. RTP_PAYLOAD_FEC_FLEX = 113, // RTP Payload Format for Flexible Forward Error Correction (rfc8267)
  112. RTP_PAYLOAD_FEC_RS = 114, // RTP Payload Format for Reed-Solomon(non-standard/private)
  113. };
  114. ///@param[in] payload RTP payload type(0 ~ 127)
  115. ///@return NULL if not exist
  116. const struct rtp_profile_t* rtp_profile_find(int payload);
  117. #ifdef __cplusplus
  118. }
  119. #endif
  120. #endif /* _rtp_profile_h_ */