ilbc.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
  3. * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifndef __PJMEDIA_CODEC_ILBC_H__
  20. #define __PJMEDIA_CODEC_ILBC_H__
  21. /**
  22. * @file pjmedia-codec/ilbc.h
  23. * @brief iLBC codec.
  24. */
  25. #include <pjmedia-codec/types.h>
  26. /**
  27. * @defgroup PJMED_ILBC iLBC Codec
  28. * @ingroup PJMEDIA_CODEC_CODECS
  29. * @brief Implementation of iLBC Codec
  30. * @{
  31. *
  32. * This section describes functions to initialize and register iLBC codec
  33. * factory to the codec manager. After the codec factory has been registered,
  34. * application can use @ref PJMEDIA_CODEC API to manipulate the codec.
  35. *
  36. * The iLBC codec is developed by Global IP Solutions (GIPS), formerly
  37. * Global IP Sound. The iLBC offers low bitrate and graceful audio quality
  38. * degradation on frame losses.
  39. *
  40. * The iLBC codec supports 16-bit PCM audio signal with sampling rate of
  41. * 8000Hz operating at two modes: 20ms and 30ms frame length modes, resulting
  42. * in bitrates of 15.2kbps for 20ms mode and 13.33kbps for 30ms mode.
  43. *
  44. *
  45. * \section ilbc_codec_setting Codec Settings
  46. *
  47. * \subsection ilbc_general_setting General Settings
  48. *
  49. * General codec settings for this codec such as VAD and PLC can be
  50. * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
  51. * Please see the documentation of #pjmedia_codec_param for more info.
  52. *
  53. * \subsection ilbc_specific_setting Codec Specific Settings
  54. *
  55. * The following settings are applicable for this codec.
  56. *
  57. * \subsubsection ilbc_mode Mode
  58. *
  59. * The default mode should be set upon initialization, see
  60. * #pjmedia_codec_ilbc_init(). After the codec is initialized, the default
  61. * mode can be modified using #pjmedia_codec_mgr_set_default_param().
  62. *
  63. * In #pjmedia_codec_param, iLBC mode can be set by specifying SDP
  64. * format parameter "mode" in the SDP "a=fmtp" attribute for decoding
  65. * direction. Valid values are "20" and "30" (for 20ms and 30ms mode
  66. * respectively).
  67. *
  68. * Here is an example to set up #pjmedia_codec_param to use mode 20ms:
  69. * \code
  70. pjmedia_codec_param param;
  71. ...
  72. // setting iLBC mode in SDP
  73. param.setting.dec_fmtp.cnt = 1;
  74. param.setting.dec_fmtp.param[0].name = pj_str("mode");
  75. param.setting.dec_fmtp.param[0].val = pj_str("20");
  76. ...
  77. \endcode
  78. */
  79. PJ_BEGIN_DECL
  80. /**
  81. * Initialize and register iLBC codec factory to pjmedia endpoint.
  82. *
  83. * @param endpt The pjmedia endpoint.
  84. * @param mode Default decoder mode to be used. Valid values are
  85. * 20 and 30 ms. Note that encoder mode follows the
  86. * setting advertised in the remote's SDP.
  87. *
  88. * @return PJ_SUCCESS on success.
  89. */
  90. PJ_DECL(pj_status_t) pjmedia_codec_ilbc_init( pjmedia_endpt *endpt,
  91. int mode );
  92. /**
  93. * Unregister iLBC codec factory from pjmedia endpoint and deinitialize
  94. * the iLBC codec library.
  95. *
  96. * @return PJ_SUCCESS on success.
  97. */
  98. PJ_DECL(pj_status_t) pjmedia_codec_ilbc_deinit(void);
  99. PJ_END_DECL
  100. /**
  101. * @}
  102. */
  103. #endif /* __PJMEDIA_CODEC_ILBC_H__ */