g722.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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_G722_H__
  20. #define __PJMEDIA_CODEC_G722_H__
  21. /**
  22. * @file pjmedia-codec/g722.h
  23. * @brief G.722 codec.
  24. */
  25. #include <pjmedia-codec/types.h>
  26. /**
  27. * @defgroup PJMED_G722 G.722 Codec
  28. * @ingroup PJMEDIA_CODEC_CODECS
  29. * @brief Implementation of G.722 Codec
  30. * @{
  31. *
  32. * This section describes functions to initialize and register G.722 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 G.722 implementation uses 16-bit PCM with sampling rate 16000Hz and
  37. * 20ms frame length resulting in 64kbps bitrate.
  38. *
  39. * The G.722 codec implementation is provided as part of pjmedia-codec
  40. * library, and does not depend on external G.722 codec implementation.
  41. *
  42. * \section codec_g722_setting Codec Settings
  43. *
  44. * \subsection g722_general_setting General 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. * \subsection g722_specific_setting Codec Specific Settings
  51. *
  52. * Currently none.
  53. */
  54. PJ_BEGIN_DECL
  55. /**
  56. * Initialize and register G.722 codec factory to pjmedia endpoint.
  57. *
  58. * @param endpt The pjmedia endpoint.
  59. *
  60. * @return PJ_SUCCESS on success.
  61. */
  62. PJ_DECL(pj_status_t) pjmedia_codec_g722_init(pjmedia_endpt *endpt);
  63. /**
  64. * Unregister G.722 codec factory from pjmedia endpoint and cleanup
  65. * resources allocated by the factory.
  66. *
  67. * @return PJ_SUCCESS on success.
  68. */
  69. PJ_DECL(pj_status_t) pjmedia_codec_g722_deinit(void);
  70. /**
  71. * Set the G.722 codec encoder and decoder level adjustment.
  72. * If the value is non-zero, then PCM input samples to the encoder will
  73. * be shifted right by this value, and similarly PCM output samples from
  74. * the decoder will be shifted left by this value.
  75. *
  76. * Default value is PJMEDIA_G722_DEFAULT_PCM_SHIFT.
  77. *
  78. * @param val The value
  79. *
  80. * @return PJ_SUCCESS on success.
  81. */
  82. PJ_DECL(pj_status_t) pjmedia_codec_g722_set_pcm_shift(unsigned val);
  83. PJ_END_DECL
  84. /**
  85. * @}
  86. */
  87. #endif /* __PJMEDIA_CODEC_G722_H__ */