audiotest.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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_AUDIOTEST_H__
  20. #define __PJMEDIA_AUDIODEV_AUDIOTEST_H__
  21. /**
  22. * @file audiotest.h
  23. * @brief Audio test utility.
  24. */
  25. #include <pjmedia-audiodev/audiodev.h>
  26. PJ_BEGIN_DECL
  27. /**
  28. * @defgroup s30_audio_test_utility Audio tests utility.
  29. * @ingroup audio_device_api
  30. * @brief Audio test utility.
  31. * @{
  32. */
  33. /**
  34. * Statistic for each direction.
  35. */
  36. typedef struct pjmedia_aud_test_stat
  37. {
  38. /**
  39. * Number of frames processed during the test.
  40. */
  41. unsigned frame_cnt;
  42. /**
  43. * Minimum inter-frame arrival time, in milliseconds
  44. */
  45. unsigned min_interval;
  46. /**
  47. * Maximum inter-frame arrival time, in milliseconds
  48. */
  49. unsigned max_interval;
  50. /**
  51. * Average inter-frame arrival time, in milliseconds
  52. */
  53. unsigned avg_interval;
  54. /**
  55. * Standard deviation of inter-frame arrival time, in milliseconds
  56. */
  57. unsigned dev_interval;
  58. /**
  59. * Maximum number of frame burst
  60. */
  61. unsigned max_burst;
  62. } pjmedia_aud_test_stat;
  63. /**
  64. * Test results.
  65. */
  66. typedef struct pjmedia_aud_test_results
  67. {
  68. /**
  69. * Recording statistic.
  70. */
  71. pjmedia_aud_test_stat rec;
  72. /**
  73. * Playback statistic.
  74. */
  75. pjmedia_aud_test_stat play;
  76. /**
  77. * Clock drifts per second, in samples. Positive number indicates rec
  78. * device is running faster than playback device.
  79. */
  80. pj_int32_t rec_drift_per_sec;
  81. } pjmedia_aud_test_results;
  82. /**
  83. * Perform audio device testing.
  84. */
  85. PJ_DECL(pj_status_t) pjmedia_aud_test(const pjmedia_aud_param *param,
  86. pjmedia_aud_test_results *result);
  87. /**
  88. * @}
  89. */
  90. PJ_END_DECL
  91. #endif /* __PJMEDIA_AUDIODEV_AUDIOTEST_H__ */