You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 10 месеца
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #ifndef _sdp_a_fmtp_h_
  2. #define _sdp_a_fmtp_h_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. // H.264
  7. enum {
  8. SDP_A_FMTP_H264_PROFILE_LEVEL_ID = 0x00000001,
  9. SDP_A_FMTP_H264_MAX_RECV_LEVEL = 0x00000002,
  10. SDP_A_FMTP_H264_MAX_MBPS = 0x00000004,
  11. SDP_A_FMTP_H264_MAX_SMBPS = 0x00000008,
  12. SDP_A_FMTP_H264_MAX_FS = 0x00000010,
  13. SDP_A_FMTP_H264_MAX_CPB = 0x00000020,
  14. SDP_A_FMTP_H264_MAX_DPB = 0x00000040,
  15. SDP_A_FMTP_H264_MAX_BR = 0x00000080,
  16. SDP_A_FMTP_H264_REDUNDANT_PIC_CAP = 0x00000100,
  17. SDP_A_FMTP_H264_SPROP_PARAMETER_SETS = 0x00000200,
  18. SDP_A_FMTP_H264_SPROP_LEVEL_PARAMETER_SETS = 0x00000400,
  19. SDP_A_FMTP_H264_USE_LEVEL_SRC_PARAMETER_SETS= 0x00000800,
  20. SDP_A_FMTP_H264_IN_BAND_PARAMETER_SETS = 0x00001000,
  21. SDP_A_FMTP_H264_LEVEL_ASYMMETRY_ALLOWED = 0x00002000,
  22. SDP_A_FMTP_H264_PACKETIZATION_MODE = 0x00004000,
  23. SDP_A_FMTP_H264_SPROP_INTERLEAVING_DEPTH = 0x00008000,
  24. SDP_A_FMTP_H264_SPROP_DEINT_BUF_REQ = 0x00010000,
  25. SDP_A_FMTP_H264_DEINT_BUF_CAP = 0x00020000,
  26. SDP_A_FMTP_H264_SPROP_INIT_BUF_TIME = 0x00040000,
  27. SDP_A_FMTP_H264_SPROP_MAX_DON_DIFF = 0x00080000,
  28. SDP_A_FMTP_H264_MAX_RCMD_NALU_SIZE = 0x00100000,
  29. SDP_A_FMTP_H264_SAR_UNDERSTOOD = 0x00200000,
  30. SDP_A_FMTP_H264_SAR_SUPPORTED = 0x00400000,
  31. };
  32. struct sdp_a_fmtp_h264_t
  33. {
  34. int flags; // test with (1<<SDP_A_FMTP_H264_xxx)
  35. char profile_level_id[7]; // (p39): profile_idc/profile_iop/level_idc
  36. int max_recv_level; // (p42): profile_iop/level_idc
  37. int max_mbps; // (p43): maximum macroblock processing rate in units of macroblocks per second
  38. int max_smbps;// (p44)
  39. int max_fs; // (p44): the maximum frame size in units of macroblocks.
  40. int max_cpb; // (p45): the maximum coded picture buffer size
  41. int max_dpb; // (p46): the maximum decoded picture buffer size in units of 8/3 macroblocks
  42. int max_br; // (p47): the maximum video bitrate
  43. int redundant_pic_cap; // (p48): 0-no redundant coded picture, 1-other
  44. char sprop_parameter_sets[512]; // (p48)
  45. char sprop_level_parameter_sets[128];
  46. int use_level_src_parameter_sets; // (p50) value: 0/1 only
  47. int in_band_parameter_sets; // (p50) value: 0/1 only
  48. int level_asymmetry_allowed; // (p51)
  49. int packetization_mode; // (p51) 0-single NAL mode, 1-non-interleaved mode, 2-interleaved mode
  50. int sprop_interleaving_depth; // (p51)
  51. unsigned int sprop_deint_buf_req; // (p52) value: [0,4294967295]
  52. unsigned int deint_buf_cap; // (p52) value: [0,4294967295]
  53. char sprop_init_buf_time[512]; // (p53)
  54. unsigned int sprop_max_don_diff; // (p54) value: [0,32767]
  55. unsigned int max_rcmd_nalu_size; // (p55) value: [0,4294967295]
  56. int sar_understood;
  57. int sar_supported;
  58. };
  59. int sdp_a_fmtp_h264(const char* fmtp, int *format, struct sdp_a_fmtp_h264_t *h264);
  60. // H.265
  61. enum {
  62. SDP_A_FMTP_H265_SPROP_VPS = 0x00000100,
  63. SDP_A_FMTP_H265_SPROP_SPS = 0x00000200,
  64. SDP_A_FMTP_H265_SPROP_PPS = 0x00000400,
  65. SDP_A_FMTP_H265_SPROP_SEI = 0x00000800,
  66. };
  67. struct sdp_a_fmtp_h265_t
  68. {
  69. int flags; // test with (1<<SDP_A_FMTP_H265_xxx)
  70. char sprop_vps[1];
  71. char sprop_sps[1];
  72. char sprop_pps[1];
  73. char sprop_sei[1];
  74. };
  75. int sdp_a_fmtp_h265(const char* fmtp, int *format, struct sdp_a_fmtp_h265_t *h265);
  76. // mpeg4-generic
  77. enum {
  78. SDP_A_FMTP_MPEG4_OBJECTTYPE = 0x0001,
  79. SDP_A_FMTP_MPEG4_CONSTANTSIZE = 0x0002,
  80. SDP_A_FMTP_MPEG4_CONSTANTDURATION = 0x0004,
  81. SDP_A_FMTP_MPEG4_MAXDISPLACEMENT = 0x0008,
  82. SDP_A_FMTP_MPEG4_DEINTERLEAVEBUFFERSIZE = 0x0010,
  83. SDP_A_FMTP_MPEG4_SIZELENGTH = 0x0020,
  84. SDP_A_FMTP_MPEG4_INDEXLENGTH = 0x0040,
  85. SDP_A_FMTP_MPEG4_INDEXDELTALENGTH = 0x0080,
  86. SDP_A_FMTP_MPEG4_CTSDELTALENGTH = 0x0100,
  87. SDP_A_FMTP_MPEG4_DTSDELTALENGTH = 0x0200,
  88. SDP_A_FMTP_MPEG4_RANDOMACCESSINDICATION = 0x0400,
  89. SDP_A_FMTP_MPEG4_STREAMSTATEINDICATION = 0x0800,
  90. SDP_A_FMTP_MPEG4_AUXILIARYDATASIZELENGTH= 0x1000,
  91. };
  92. struct sdp_a_fmtp_mpeg4_t
  93. {
  94. int flags; // test with (1<<SDP_A_FMTP_MPEG4_xxx)
  95. // required(p28)
  96. int streamType;
  97. char profile_level_id[7];
  98. char config[512];
  99. int mode; // value: generic/CELP-cbr/CELP-vbr/AAC-lbr/AAC-hbr
  100. // optional general parameters(p30)
  101. int objectType;
  102. int constantSize;
  103. int constantDuration;
  104. int maxDisplacement;
  105. int deinterleaveBufferSize;
  106. // Optional configuration parameters(p31)
  107. int sizeLength;
  108. int indexLength;
  109. int indexDeltaLength;
  110. int CTSDeltaLength;
  111. int DTSDeltaLength;
  112. int randomAccessIndication;
  113. int streamStateIndication;
  114. int auxiliaryDataSizeLength;
  115. };
  116. int sdp_a_fmtp_mpeg4(const char* fmtp, int *format, struct sdp_a_fmtp_mpeg4_t *mpeg4);
  117. struct sdp_a_fmtp_rtx_t
  118. {
  119. int apt;
  120. int rtx_time; // milliseconds
  121. };
  122. int sdp_a_fmtp_rtx(const char* fmtp, int* format, struct sdp_a_fmtp_rtx_t* rtx);
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126. #endif /* !_sdp_a_fmtp_h_ */