tmsrp_sender.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (C) 2009 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou [at) doubango (DOT) 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 tmsrp_sender.h
  23. * @brief MSRP sender.
  24. *
  25. * @author Mamadou Diop <diopmamadou [at) doubango (DOT) org>
  26. *
  27. */
  28. #ifndef TINYMSRP_SENDER_H
  29. #define TINYMSRP_SENDER_H
  30. #include "tinymsrp_config.h"
  31. #include "tinymsrp/session/tmsrp_data.h"
  32. #include "tinymsrp/session/tmsrp_config.h"
  33. #include "tnet_types.h"
  34. #include "tsk_runnable.h"
  35. TMSRP_BEGIN_DECLS
  36. typedef struct tmsrp_sender_s {
  37. TSK_DECLARE_RUNNABLE;
  38. tmsrp_datas_L_t* outgoingList;
  39. tmsrp_config_t* config;
  40. tnet_fd_t fd;
  41. uint64_t chunck_duration;
  42. }
  43. tmsrp_sender_t;
  44. TINYMSRP_API tmsrp_sender_t* tmsrp_sender_create(tmsrp_config_t* config, tnet_fd_t fd);
  45. TINYMSRP_API int tmsrp_sender_set_fd(tmsrp_sender_t* self, tnet_fd_t fd);
  46. TINYMSRP_API int tmsrp_sender_start(tmsrp_sender_t* self);
  47. TINYMSRP_API int tsmrp_sender_send_data(tmsrp_sender_t* self, const void* data, tsk_size_t size, const char* ctype, const char* wctype);
  48. TINYMSRP_API int tsmrp_sender_send_file(tmsrp_sender_t* self, const char* filepath);
  49. TINYMSRP_API int tmsrp_sender_stop(tmsrp_sender_t* self);
  50. TINYMSRP_GEXTERN const tsk_object_def_t *tmsrp_sender_def_t;
  51. TMSRP_END_DECLS
  52. #endif /* TINYMSRP_SENDER_H */