bcg729.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright (C) 2017 Teluu Inc. (http://www.teluu.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef __PJMEDIA_CODEC_BCG729_H__
  19. #define __PJMEDIA_CODEC_BCG729_H__
  20. /**
  21. * @file bcg729.h
  22. * @brief BCG729 codec.
  23. */
  24. #include <pjmedia-codec/types.h>
  25. /**
  26. * @defgroup PJMED_BCG729 BCG729 Codec
  27. * @ingroup PJMEDIA_CODEC_CODECS
  28. * @brief Implementation of BCG729 codecs.
  29. * @{
  30. *
  31. * This section describes functions to initialize and register BCG729 codec
  32. * factory to the codec manager. After the codec factory has been registered,
  33. * application can use @ref PJMEDIA_CODEC API to manipulate the codec.
  34. *
  35. * This codec factory contains G.729 codec.
  36. *
  37. * \section pjmedia_codec_bcg729 BCG729
  38. *
  39. * BCG729 is compliant with ITU-T G.729 and Annexes A, B specifications.
  40. *
  41. * BCGG729 supports 16-bit PCM audio signal with sampling rate 8000Hz,
  42. * frame length 10ms, and resulting in bitrate 8000bps.
  43. *
  44. * \subsection bcg729_codec_setting Codec Settings
  45. *
  46. * General codec settings for this codec such as VAD and PLC can be
  47. * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
  48. * Please see the documentation of #pjmedia_codec_param for more info.
  49. *
  50. * Note that G.729 VAD status should be signalled in SDP, see more
  51. * description below.
  52. *
  53. * \subsubsection bcg729_annexb Annex B
  54. *
  55. * The capability of VAD/DTX is specified in Annex B.
  56. *
  57. * By default, Annex B is enabled. This default setting of Annex B can
  58. * be modified using #pjmedia_codec_mgr_set_default_param().
  59. *
  60. * In #pjmedia_codec_param, Annex B is configured via VAD setting and
  61. * format parameter "annexb" in the SDP "a=fmtp" attribute in
  62. * decoding fmtp field. Valid values are "yes" and "no",
  63. * the implementation default is "yes". When this parameter is omitted
  64. * in the SDP, the value will be "yes" (RFC 4856 Section 2.1.9).
  65. *
  66. * Here is an example of modifying default setting of Annex B to
  67. * be disabled using #pjmedia_codec_mgr_set_default_param():
  68. \code
  69. pjmedia_codec_param param;
  70. pjmedia_codec_mgr_get_default_param(.., &param);
  71. ...
  72. // Set VAD
  73. param.setting.vad = 0;
  74. // Set SDP format parameter
  75. param.setting.dec_fmtp.cnt = 1;
  76. param.setting.dec_fmtp.param[0].name = pj_str("annexb");
  77. param.setting.dec_fmtp.param[0].val = pj_str("no");
  78. ...
  79. pjmedia_codec_mgr_set_default_param(.., &param);
  80. \endcode
  81. *
  82. * \note
  83. * The difference of Annex B status in SDP offer/answer may be considered as
  84. * incompatible codec in SDP negotiation.
  85. *
  86. */
  87. PJ_BEGIN_DECL
  88. /**
  89. * Initialize and register BCG729 codec factory to pjmedia endpoint.
  90. *
  91. * @param endpt The pjmedia endpoint.
  92. *
  93. * @return PJ_SUCCESS on success.
  94. */
  95. PJ_DECL(pj_status_t) pjmedia_codec_bcg729_init(pjmedia_endpt *endpt);
  96. /**
  97. * Unregister BCG729 codec factory from pjmedia endpoint and deinitialize
  98. * the BCG729 codec library.
  99. *
  100. * @return PJ_SUCCESS on success.
  101. */
  102. PJ_DECL(pj_status_t) pjmedia_codec_bcg729_deinit(void);
  103. PJ_END_DECL
  104. /**
  105. * @}
  106. */
  107. #endif /* __PJMEDIA_CODEC_BCG729_H__ */