audiodev.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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_AUDIODEV_AUDIODEV_H__
  20. #define __PJMEDIA_AUDIODEV_AUDIODEV_H__
  21. /**
  22. * @file audiodev.h
  23. * @brief Audio subsystem API.
  24. */
  25. #include <pj/pool.h>
  26. #include <pjmedia/audiodev.h>
  27. PJ_BEGIN_DECL
  28. /**
  29. * @defgroup PJMEDIA_AUDIODEV_SUBSYSTEM_API Audio Subsystem API Reference
  30. * @ingroup audio_subsystem_api
  31. * @brief API Reference
  32. * @{
  33. */
  34. /**
  35. * Initialize the audio subsystem. This will register all supported audio
  36. * device factories to the audio subsystem. This function may be called
  37. * more than once, but each call to this function must have the
  38. * corresponding #pjmedia_aud_subsys_shutdown() call.
  39. *
  40. * @param pf The pool factory.
  41. *
  42. * @return PJ_SUCCESS on successful operation or the appropriate
  43. * error code.
  44. */
  45. PJ_DECL(pj_status_t) pjmedia_aud_subsys_init(pj_pool_factory *pf);
  46. /**
  47. * Get the pool factory registered to the audio subsystem.
  48. *
  49. * @return The pool factory.
  50. */
  51. PJ_DECL(pj_pool_factory*) pjmedia_aud_subsys_get_pool_factory(void);
  52. /**
  53. * Shutdown the audio subsystem. This will destroy all audio device factories
  54. * registered in the audio subsystem. Note that currently opened audio streams
  55. * may or may not be closed, depending on the implementation of the audio
  56. * device factories.
  57. *
  58. * @return PJ_SUCCESS on successful operation or the appropriate
  59. * error code.
  60. */
  61. PJ_DECL(pj_status_t) pjmedia_aud_subsys_shutdown(void);
  62. /**
  63. * Register a supported audio device factory to the audio subsystem. This
  64. * function can only be called after calling #pjmedia_aud_subsys_init().
  65. *
  66. * @param adf The audio device factory.
  67. *
  68. * @return PJ_SUCCESS on successful operation or the appropriate
  69. * error code.
  70. */
  71. PJ_DECL(pj_status_t)
  72. pjmedia_aud_register_factory(pjmedia_aud_dev_factory_create_func_ptr adf);
  73. /**
  74. * Unregister an audio device factory from the audio subsystem. This
  75. * function can only be called after calling #pjmedia_aud_subsys_init().
  76. * Devices from this factory will be unlisted. If a device from this factory
  77. * is currently in use, then the behavior is undefined.
  78. *
  79. * @param adf The audio device factory.
  80. *
  81. * @return PJ_SUCCESS on successful operation or the appropriate
  82. * error code.
  83. */
  84. PJ_DECL(pj_status_t)
  85. pjmedia_aud_unregister_factory(pjmedia_aud_dev_factory_create_func_ptr adf);
  86. /**
  87. * @}
  88. */
  89. PJ_END_DECL
  90. #endif /* __PJMEDIA_AUDIODEV_AUDIODEV_H__ */