tdav_session_t140.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * This file is part of Open Source Doubango Framework.
  5. *
  6. * DOUBANGO is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * DOUBANGO is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with DOUBANGO.
  18. *
  19. */
  20. /**@file tdav_session_t140.h
  21. * @brief Session for T140 protocol (RFC 4103)
  22. */
  23. #ifndef TINYDAV_SESSION_T140_H
  24. #define TINYDAV_SESSION_T140_H
  25. #include "tinydav_config.h"
  26. #include "tinydav/tdav_session_av.h"
  27. #include "tsk_timer.h"
  28. TDAV_BEGIN_DECLS
  29. #define TDAV_SESSION_T140(self) ((tdav_session_t140_t*)(self))
  30. typedef tsk_list_t tdav_session_t140_blocks_L_t;
  31. typedef struct tdav_session_t140_s {
  32. TDAV_DECLARE_SESSION_AV;
  33. tsk_bool_t started;
  34. tsk_timer_manager_handle_t *h_timer;
  35. struct {
  36. const void* context;
  37. tmedia_session_t140_ondata_cb_f func;
  38. } cb_ondata;
  39. struct {
  40. uint32_t payload_type;
  41. struct tmedia_codec_s* codec;
  42. void* buffer;
  43. tsk_size_t buffer_size;
  44. tsk_size_t buffer_idx;
  45. void* red_buffer;
  46. tsk_size_t red_buffer_size;
  47. tdav_session_t140_blocks_L_t* blocks;
  48. int64_t blocks_count;
  49. struct {
  50. tsk_timer_id_t id;
  51. int64_t timeout;
  52. } timer_buffering;
  53. struct {
  54. tsk_timer_id_t id;
  55. int64_t timeout;
  56. } timer_idle;
  57. } encoder;
  58. struct {
  59. uint32_t payload_type;
  60. struct tmedia_codec_s* codec;
  61. void* buffer;
  62. tsk_size_t buffer_size;
  63. void* consumer_buffer;
  64. tsk_size_t consumer_buffer_size;
  65. tdav_session_t140_blocks_L_t* blocks;
  66. int64_t blocks_count;
  67. int32_t last_seq_num;
  68. struct {
  69. tsk_timer_id_t id;
  70. int64_t timeout;
  71. } timer_pkt_loss;
  72. } decoder;
  73. }
  74. tdav_session_t140_t;
  75. TINYDAV_GEXTERN const tmedia_session_plugin_def_t *tdav_session_t140_plugin_def_t;
  76. TDAV_END_DECLS
  77. #endif /* TINYDAV_SESSION_T140_H */