tdav_codec_speex.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango.org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. /**@file tdav_codec_ilbc.h
  23. * @brief Speex codecs
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango.org>
  26. *
  27. */
  28. #ifndef TINYDAV_CODEC_SPEEX_H
  29. #define TINYDAV_CODEC_SPEEX_H
  30. #include "tinydav_config.h"
  31. #if HAVE_LIB_SPEEX
  32. #include "tinymedia/tmedia_codec.h"
  33. #include <speex/speex.h>
  34. TDAV_BEGIN_DECLS
  35. typedef enum tdav_codec_speex_type_e {
  36. tdav_codec_speex_type_nb,
  37. tdav_codec_speex_type_wb,
  38. tdav_codec_speex_type_uwb,
  39. }
  40. tdav_codec_speex_type_t;
  41. /** Speex codec */
  42. typedef struct tdav_codec_speex_s {
  43. TMEDIA_DECLARE_CODEC_AUDIO;
  44. tdav_codec_speex_type_t type;
  45. struct {
  46. void* state;
  47. SpeexBits bits;
  48. tsk_size_t size;
  49. } encoder;
  50. struct {
  51. void* state;
  52. SpeexBits bits;
  53. spx_int16_t* buffer;
  54. tsk_size_t size;
  55. } decoder;
  56. }
  57. tdav_codec_speex_t;
  58. TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_speex_nb_plugin_def_t;
  59. TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_speex_wb_plugin_def_t;
  60. TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_speex_uwb_plugin_def_t;
  61. TDAV_END_DECLS
  62. #endif /* TINYDAV_CODEC_SPEEX_H */
  63. #endif /* TINYDAV_CODEC_SPEEX_H */