tmedia_session.h 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /*
  2. * Copyright (C) 2010-2011 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 tmedia_session.h
  23. * @brief Base session object.
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
  26. *
  27. */
  28. #ifndef TINYMEDIA_SESSION_H
  29. #define TINYMEDIA_SESSION_H
  30. #include "tinymedia_config.h"
  31. #include "tinymedia/tmedia_codec.h"
  32. #include "tinymedia/tmedia_qos.h"
  33. #include "tinymedia/tmedia_params.h"
  34. #include "tinysdp/tsdp_message.h"
  35. #include "tnet_nat.h"
  36. #include "tnet_types.h"
  37. #include "tsk_list.h"
  38. #include "tsk_debug.h"
  39. #include "tsk_safeobj.h"
  40. TMEDIA_BEGIN_DECLS
  41. struct tmedia_session_s;
  42. // rfc5168 (XML Schema for Media Control) commands
  43. typedef enum tmedia_session_rfc5168_cmd_e {
  44. tmedia_session_rfc5168_cmd_picture_fast_update,
  45. }
  46. tmedia_session_rfc5168_cmd_t;
  47. // BFCP (rfc4582) events
  48. typedef enum tmedia_session_bfcp_evt_type_e {
  49. tmedia_session_bfcp_evt_type_err, // Global error
  50. tmedia_session_bfcp_evt_type_flreq_status, // FloorRequestStatus
  51. }
  52. tmedia_session_bfcp_evt_type_t;
  53. typedef struct tmedia_session_bfcp_evt_xs {
  54. tmedia_session_bfcp_evt_type_t type;
  55. const char* reason;
  56. union {
  57. struct {
  58. int code;
  59. } err;
  60. struct {
  61. uint16_t status;
  62. } flreq;
  63. };
  64. } tmedia_session_bfcp_evt_xt;
  65. #define TMEDIA_SESSION(self) ((tmedia_session_t*)(self))
  66. #define TMEDIA_SESSION_AUDIO(self) ((tmedia_session_audio_t*)(self))
  67. #define TMEDIA_SESSION_VIDEO(self) ((tmedia_session_video_t*)(self))
  68. #define TMEDIA_SESSION_MSRP(self) ((tmedia_session_msrp_t*)(self))
  69. typedef int (*tmedia_session_t140_ondata_cb_f)(const void* usrdata, tmedia_t140_data_type_t data_type, const void* data_ptr, unsigned data_size);
  70. typedef int (*tmedia_session_rtcp_onevent_cb_f)(const void* usrdata, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media);
  71. typedef int (*tmedia_session_onerror_cb_f)(const void* usrdata, const struct tmedia_session_s* session, const char* reason, tsk_bool_t is_fatal);
  72. typedef int (*tmedia_session_rfc5168_cb_f)(const void* usrdata, const struct tmedia_session_s* session, const char* reason, enum tmedia_session_rfc5168_cmd_e command);
  73. typedef int (*tmedia_session_bfcp_cb_f)(const void* usrdata, const struct tmedia_session_s* session, const tmedia_session_bfcp_evt_xt* evt);
  74. /**Max number of plugins (session types) we can create */
  75. #define TMED_SESSION_MAX_PLUGINS 0x0F
  76. /** Base objct used for all media sessions */
  77. typedef struct tmedia_session_s {
  78. TSK_DECLARE_OBJECT;
  79. //! unique id. If you want to modifiy this field then you must use @ref tmedia_session_get_unique_id()
  80. uint64_t id;
  81. //! session type
  82. tmedia_type_t type;
  83. //! list of codec ids used as filter on the enabled codecs
  84. tmedia_codec_id_t codecs_allowed;
  85. //! list of codecs managed by this session (enabled)
  86. tmedia_codecs_L_t* codecs;
  87. //! negociated codec
  88. tmedia_codecs_L_t* neg_codecs;
  89. //! whether the ro have been prepared (up to the manager to update the value)
  90. tsk_bool_t ro_changed;
  91. //! whether the session have been initialized (up to the manager to update the value)
  92. tsk_bool_t initialized;
  93. //! whether the session have been prepared (up to the manager to update the value)
  94. tsk_bool_t prepared;
  95. //! whether the session is localy held
  96. tsk_bool_t lo_held;
  97. //! whether the session is remotely held
  98. tsk_bool_t ro_held;
  99. //! QoS
  100. tmedia_qos_tline_t* qos;
  101. //! bandwidth level
  102. tmedia_bandwidth_level_t bl;
  103. //! error callback function: not part of the plugin (likes .t140 or .rtcp) because it's not part of the API
  104. struct {
  105. tmedia_session_onerror_cb_f fun;
  106. const void* usrdata;
  107. } onerror_cb;
  108. //! rfc5168 (XML Schema for Media Control) callback function: not part of the plugin (likes .t140 or .rtcp) because it's not part of the API.
  109. struct {
  110. tmedia_session_rfc5168_cb_f fun;
  111. const void* usrdata;
  112. } rfc5168_cb;
  113. //! BFCP (rfc4582)
  114. struct {
  115. tmedia_session_bfcp_cb_f fun;
  116. const void* usrdata;
  117. } bfcp_cb;
  118. tsk_bool_t bypass_encoding;
  119. tsk_bool_t bypass_decoding;
  120. struct {
  121. char* file_ca;
  122. char* file_pbk;
  123. char* file_pvk;
  124. tsk_bool_t verify;
  125. } dtls;
  126. struct {
  127. float q1; /**< 2.1.Packet loss recovery */
  128. float q2; /**< 2.2.Global packet loss estimation */
  129. float q3; /**< 2.3.Receiver Estimated Maximum Bitrate */
  130. float q4; /**< 2.4.Latency estimation */
  131. float q5; /**< 2.5. Jitter buffer congestion estimation */
  132. float qvag;
  133. unsigned bw_up_est_kbps;
  134. unsigned bw_down_est_kbps;
  135. unsigned video_out_width;
  136. unsigned video_out_height;
  137. unsigned video_in_width;
  138. unsigned video_in_height;
  139. unsigned video_in_avg_fps;
  140. unsigned video_dec_avg_time;
  141. unsigned video_enc_avg_time;
  142. uint64_t last_update_time;
  143. } qos_metrics;
  144. struct {
  145. tsdp_header_M_t* lo;
  146. tsdp_header_M_t* ro;
  147. } M;
  148. //! plugin used to create the session
  149. const struct tmedia_session_plugin_def_s* plugin;
  150. }
  151. tmedia_session_t;
  152. /** Virtual table used to define a session plugin */
  153. typedef struct tmedia_session_plugin_def_s {
  154. //! object definition used to create an instance of the session
  155. const tsk_object_def_t* objdef;
  156. //! the type of the session
  157. tmedia_type_t type;
  158. //! the media name. e.g. "audio", "video", "message", "image" etc.
  159. const char* media;
  160. int (*set) (tmedia_session_t* , const tmedia_param_t*);
  161. int (*get) (tmedia_session_t* , tmedia_param_t*);
  162. int (* prepare) (tmedia_session_t* );
  163. int (* start) (tmedia_session_t* );
  164. int (* pause) (tmedia_session_t* );
  165. int (* stop) (tmedia_session_t* );
  166. struct { /* Special case */
  167. int (* send_dtmf) (tmedia_session_t*, uint8_t );
  168. } audio;
  169. const tsdp_header_M_t* (* get_local_offer) (tmedia_session_t* );
  170. /* return zero if can handle the ro and non-zero otherwise */
  171. int (* set_remote_offer) (tmedia_session_t* , const tsdp_header_M_t* );
  172. struct { /* Special case */
  173. int (* set_ondata_cbfn) (tmedia_session_t*, const void* usrdata, tmedia_session_t140_ondata_cb_f func);
  174. int (* send_data) (tmedia_session_t*, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
  175. } t140;
  176. struct { /* Handles both SIP INFO and RTCP-FB: should be called by end-user only when transcoding is disabled */
  177. int (* set_onevent_cbfn) (tmedia_session_t*, const void* usrdata, tmedia_session_rtcp_onevent_cb_f func);
  178. int (* send_event) (tmedia_session_t*, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
  179. int (* recv_event) (tmedia_session_t*, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
  180. } rtcp;
  181. }
  182. tmedia_session_plugin_def_t;
  183. TINYMEDIA_API uint64_t tmedia_session_get_unique_id();
  184. TINYMEDIA_API int tmedia_session_init(tmedia_session_t* self, tmedia_type_t type);
  185. TINYMEDIA_API int tmedia_session_set(tmedia_session_t* self, ...);
  186. TINYMEDIA_API tsk_bool_t tmedia_session_set_2(tmedia_session_t* self, const tmedia_param_t* param);
  187. TINYMEDIA_API int tmedia_session_get(tmedia_session_t* self, tmedia_param_t* param);
  188. TINYMEDIA_API int tmedia_session_cmp(const tsk_object_t* sess1, const tsk_object_t* sess2);
  189. TINYMEDIA_API int tmedia_session_plugin_register(const tmedia_session_plugin_def_t* plugin);
  190. TINYMEDIA_API const tmedia_session_plugin_def_t* tmedia_session_plugin_find_by_media(const char* media);
  191. TINYMEDIA_API int tmedia_session_plugin_unregister(const tmedia_session_plugin_def_t* plugin);
  192. TINYMEDIA_API tmedia_session_t* tmedia_session_create(tmedia_type_t type);
  193. TINYMEDIA_API tmedia_codecs_L_t* tmedia_session_match_codec(tmedia_session_t* self, const tsdp_header_M_t* M);
  194. TINYMEDIA_API int tmedia_session_set_onrtcp_cbfn(tmedia_session_t* self, const void* usrdata, tmedia_session_rtcp_onevent_cb_f fun);
  195. TINYMEDIA_API int tmedia_session_send_rtcp_event(tmedia_session_t* self, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media);
  196. TINYMEDIA_API int tmedia_session_recv_rtcp_event(tmedia_session_t* self, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media);
  197. TINYMEDIA_API int tmedia_session_set_onerror_cbfn(tmedia_session_t* self, const void* usrdata, tmedia_session_onerror_cb_f fun);
  198. TINYMEDIA_API int tmedia_session_set_rfc5168_cbfn(tmedia_session_t* self, const void* usrdata, tmedia_session_rfc5168_cb_f fun);
  199. TINYMEDIA_API int tmedia_session_set_bfcp_cbfn(tmedia_session_t* self, const void* usrdata, tmedia_session_bfcp_cb_f fun);
  200. TINYMEDIA_API int tmedia_session_deinit(tmedia_session_t* self);
  201. typedef tsk_list_t tmedia_sessions_L_t; /**< List of @ref tmedia_session_t objects */
  202. #define TMEDIA_DECLARE_SESSION tmedia_session_t __session__
  203. /** Audio Session */
  204. typedef struct tmedia_session_audio_s {
  205. TMEDIA_DECLARE_SESSION;
  206. }
  207. tmedia_session_audio_t;
  208. #define tmedia_session_audio_init(self) tmedia_session_init(TMEDIA_SESSION(self), tmedia_audio)
  209. TINYMEDIA_API int tmedia_session_audio_send_dtmf(tmedia_session_audio_t* self, uint8_t event);
  210. #define tmedia_session_audio_deinit(self) tmedia_session_deinit(TMEDIA_SESSION(self))
  211. #define tmedia_session_audio_create() tmedia_session_create(tmedia_audio)
  212. #define TMEDIA_DECLARE_SESSION_AUDIO tmedia_session_audio_t __session_audio__
  213. /** Video Session */
  214. typedef struct tmedia_session_video_s {
  215. TMEDIA_DECLARE_SESSION;
  216. }
  217. tmedia_session_video_t;
  218. #define tmedia_session_video_init(self) tmedia_session_init(TMEDIA_SESSION(self), tmedia_video)
  219. #define tmedia_session_video_deinit(self) tmedia_session_deinit(TMEDIA_SESSION(self))
  220. #define tmedia_session_video_create() tmedia_session_create(tmedia_video)
  221. #define TMEDIA_DECLARE_SESSION_VIDEO tmedia_session_video_t __session_video__
  222. /** MSRP Session */
  223. struct tmedia_session_msrp_s;
  224. struct tmsrp_event_s;
  225. // use "struct tmsrp_event_s" instead of "tmsrp_event_t" to avoid linking aginst tinyMSRP
  226. typedef int (*tmedia_session_msrp_cb_f)(const struct tmsrp_event_s* event);
  227. typedef struct tmedia_session_msrp_s {
  228. TMEDIA_DECLARE_SESSION;
  229. struct {
  230. tmedia_session_msrp_cb_f func;
  231. const void* data;
  232. } callback;
  233. int (* send_file) (struct tmedia_session_msrp_s*, const char* path, va_list *app);
  234. int (* send_message) (struct tmedia_session_msrp_s*, const void* data, tsk_size_t size, const tmedia_params_L_t *params);
  235. }
  236. tmedia_session_msrp_t;
  237. #define tmedia_session_msrp_init(self) tmedia_session_init(TMEDIA_SESSION(self), tmedia_msrp)
  238. #define tmedia_session_msrp_deinit(self) tmedia_session_deinit(TMEDIA_SESSION(self))
  239. #define tmedia_session_msrp_create() tmedia_session_create(tmedia_msrp)
  240. #define TMEDIA_DECLARE_SESSION_MSRP tmedia_session_msrp_t __session_msrp__
  241. /** BFCP Session */
  242. struct tmedia_session_bfcp_s;
  243. struct tbfcp_event_s;
  244. typedef struct tmedia_session_bfcp_s {
  245. TMEDIA_DECLARE_SESSION;
  246. struct {
  247. // use "struct tbfcp_event_s" instead of "tbfcp_event_t" to avoid linking aginst tinyBFCP
  248. int (*fun)(const struct tbfcp_event_s* event);
  249. const void* data;
  250. } callback;
  251. // int (* share_file) (struct tmedia_session_bfcp_s*, const char* path, va_list *app);
  252. // int (* share_screen) (struct tmedia_session_bfcp_s*, const tmedia_params_L_t *params);
  253. }
  254. tmedia_session_bfcp_t;
  255. #define tmedia_session_bfcp_init(self) tmedia_session_init(TMEDIA_SESSION(self), tmedia_bfcp)
  256. #define tmedia_session_bfcp_deinit(self) tmedia_session_deinit(TMEDIA_SESSION(self))
  257. #define tmedia_session_bfcp_create() tmedia_session_create(tmedia_bfcp)
  258. #define TMEDIA_DECLARE_SESSION_BFCP tmedia_session_bfcp_t __session_bfcp__
  259. /** T.140 session */
  260. int tmedia_session_t140_set_ondata_cbfn(tmedia_session_t* self, const void* context, tmedia_session_t140_ondata_cb_f func);
  261. int tmedia_session_t140_send_data(tmedia_session_t* self, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
  262. /** Session manager */
  263. typedef struct tmedia_session_mgr_s {
  264. TSK_DECLARE_OBJECT;
  265. //! whether we are the offerer or not
  266. tsk_bool_t offerer;
  267. //! local IP address or FQDN
  268. char* addr;
  269. tnet_socket_type_t addr_type;
  270. //! public IP address or FQDN
  271. char* public_addr;
  272. tnet_socket_type_t public_addr_type;
  273. //! whether to enable IPv6
  274. tsk_bool_t use_ipv6;
  275. struct {
  276. uint32_t lo_ver;
  277. tsdp_message_t* lo;
  278. int32_t ro_ver;
  279. tsdp_message_t* ro;
  280. } sdp;
  281. tsk_bool_t started;
  282. tsk_bool_t ro_changed;
  283. tsk_bool_t ro_provisional;
  284. tsk_bool_t state_changed;
  285. tsk_bool_t mediaType_changed;
  286. //! session type
  287. tmedia_type_t type;
  288. //! QoS type
  289. struct {
  290. tmedia_qos_stype_t type;
  291. tmedia_qos_strength_t strength;
  292. } qos;
  293. //! bandwidth level
  294. tmedia_bandwidth_level_t bl;
  295. /* NAT Traversal context */
  296. struct tnet_nat_ctx_s* natt_ctx;
  297. struct {
  298. struct tnet_ice_ctx_s *ctx_audio;
  299. struct tnet_ice_ctx_s *ctx_video;
  300. struct tnet_ice_ctx_s *ctx_bfcpvid;
  301. } ice;
  302. /* session error callback */
  303. struct {
  304. tmedia_session_onerror_cb_f fun;
  305. const void* usrdata;
  306. } onerror_cb;
  307. /* rfc5168 callback */
  308. struct {
  309. tmedia_session_rfc5168_cb_f fun;
  310. const void* usrdata;
  311. } rfc5168_cb;
  312. //! List of all sessions
  313. tmedia_sessions_L_t* sessions;
  314. //! User's parameters used to confugure plugins
  315. tmedia_params_L_t* params;
  316. TSK_DECLARE_SAFEOBJ;
  317. }
  318. tmedia_session_mgr_t;
  319. typedef enum tmedia_session_param_type_e {
  320. tmedia_sptype_null = 0,
  321. tmedia_sptype_set,
  322. tmedia_sptype_get
  323. }
  324. tmedia_session_param_type_t;
  325. #define TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, PLUGIN_TYPE_ENUM, VALUE_TYPE_ENUM, KEY_STR, VALUE) \
  326. tmedia_sptype_set, (tmedia_type_t)MEDIA_TYPE_ENUM, (tmedia_param_plugin_type_t)PLUGIN_TYPE_ENUM, (tmedia_param_value_type_t)VALUE_TYPE_ENUM, \
  327. (const char*)KEY_STR, TMEDIA_PARAM_VALUE_TYPE_IS_PTR(VALUE_TYPE_ENUM) ? (void*)VALUE : (void*)&VALUE
  328. #define TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, PLUGIN_TYPE_ENUM, VALUE_TYPE_ENUM, KEY_STR, VALUE_PTR) \
  329. tmedia_sptype_get, (tmedia_type_t)MEDIA_TYPE_ENUM, (tmedia_param_plugin_type_t)PLUGIN_TYPE_ENUM, (tmedia_param_value_type_t)VALUE_TYPE_ENUM, \
  330. (const char*)KEY_STR, (void*)VALUE_PTR
  331. /* Manager */
  332. #define TMEDIA_SESSION_MANAGER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_SET_PARAM(tmedia_none, tmedia_ppt_manager, tmedia_pvt_int32, KEY_STR, VALUE_INT32)
  333. #define TMEDIA_SESSION_MANAGER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_SET_PARAM(tmedia_none, tmedia_ppt_manager, tmedia_pvt_pobject, KEY_STR, VALUE_PTR)
  334. #define TMEDIA_SESSION_MANAGER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_SET_PARAM(tmedia_none, tmedia_ppt_manager, tmedia_pvt_pchar, KEY_STR, VALUE_STR)
  335. #define TMEDIA_SESSION_MANAGER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_SET_PARAM(tmedia_none, tmedia_ppt_manager, tmedia_pvt_int64, KEY_STR, VALUE_INT64)
  336. #define TMEDIA_SESSION_MANAGER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_GET_PARAM(tmedia_none, tmedia_ppt_manager, tmedia_pvt_int32, KEY_STR, VALUE_PINT32)
  337. //#define TMEDIA_SESSION_MANAGER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_GET_PARAM(tmedia_none, tmedia_ppt_manager, tmedia_pvt_pobject, KEY_STR, VALUE_PPTR)
  338. //#define TMEDIA_SESSION_MANAGER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_GET_PARAM(tmedia_none, tmedia_ppt_manager, tmedia_pvt_pchar, KEY_STR, VALUE_PSTR)
  339. //#define TMEDIA_SESSION_MANAGER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_GET_PARAM(tmedia_none, tmedia_ppt_manager, tmedia_pvt_int64, KEY_STR, VALUE_PINT64)
  340. /* ANY Session */
  341. #define TMEDIA_SESSION_SET_INT32(MEDIA_TYPE_ENUM, KEY_STR, VALUE_INT32) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_int32, KEY_STR, VALUE_INT32)
  342. #define TMEDIA_SESSION_SET_POBJECT(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PTR) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_pobject, KEY_STR, VALUE_PTR)
  343. #define TMEDIA_SESSION_SET_STR(MEDIA_TYPE_ENUM, KEY_STR, VALUE_STR) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_pchar, KEY_STR, VALUE_STR)
  344. #define TMEDIA_SESSION_SET_INT64(MEDIA_TYPE_ENUM, KEY_STR, VALUE_INT64) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_int64, KEY_STR, VALUE_INT64)
  345. #define TMEDIA_SESSION_GET_INT32(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PINT32) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_int32, KEY_STR, VALUE_PINT32)
  346. #define TMEDIA_SESSION_GET_POBJECT(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PPOBJECT) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_pobject, KEY_STR, VALUE_PPOBJECT)
  347. //#define TMEDIA_SESSION_GET_PVOID(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PPTR) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_pobject, KEY_STR, VALUE_PPTR)
  348. //#define TMEDIA_SESSION_GET_STR(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PSTR) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_pchar, KEY_STR, VALUE_PSTR)
  349. //#define TMEDIA_SESSION_GET_INT64(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PINT64) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_session, tmedia_pvt_int64, KEY_STR, VALUE_PINT64)
  350. /* AUDIO Session */
  351. #define TMEDIA_SESSION_AUDIO_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_SET_INT32(tmedia_audio, KEY_STR, VALUE_INT32)
  352. #define TMEDIA_SESSION_AUDIO_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_SET_POBJECT(tmedia_audio, KEY_STR, VALUE_PTR)
  353. #define TMEDIA_SESSION_AUDIO_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_SET_STR(tmedia_audio, KEY_STR, VALUE_STR)
  354. #define TMEDIA_SESSION_AUDIO_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_SET_INT64(tmedia_audio, KEY_STR, VALUE_INT64)
  355. #define TMEDIA_SESSION_AUDIO_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_GET_INT32(tmedia_audio, KEY_STR, VALUE_PINT32)
  356. //#define TMEDIA_SESSION_AUDIO_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_GET_PVOID(tmedia_audio, KEY_STR, VALUE_PPTR)
  357. //#define TMEDIA_SESSION_AUDIO_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_GET_STR(tmedia_audio, KEY_STR, VALUE_PSTR)
  358. //#define TMEDIA_SESSION_AUDIO_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_GET_INT64(tmedia_audio, KEY_STR, VALUE_PINT64)
  359. /* VIDEO Session */
  360. #define TMEDIA_SESSION_VIDEO_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_SET_INT32(tmedia_video, KEY_STR, VALUE_INT32)
  361. #define TMEDIA_SESSION_VIDEO_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_SET_POBJECT(tmedia_video, KEY_STR, VALUE_PTR)
  362. #define TMEDIA_SESSION_VIDEO_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_SET_STR(tmedia_video, KEY_STR, VALUE_STR)
  363. #define TMEDIA_SESSION_VIDEO_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_SET_INT64(tmedia_video, KEY_STR, VALUE_INT64)
  364. #define TMEDIA_SESSION_VIDEO_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_GET_INT32(tmedia_video, KEY_STR, VALUE_PINT32)
  365. //#define TMEDIA_SESSION_VIDEO_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_GET_PVOID(tmedia_video, KEY_STR, VALUE_PPTR)
  366. //#define TMEDIA_SESSION_VIDEO_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_GET_STR(tmedia_video, KEY_STR, VALUE_PSTR)
  367. //#define TMEDIA_SESSION_VIDEO_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_GET_INT64(tmedia_video, KEY_STR, VALUE_PINT64)
  368. /* MSRP Session */
  369. #define TMEDIA_SESSION_MSRP_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_SET_INT32(tmedia_msrp, KEY_STR, VALUE_INT32)
  370. #define TMEDIA_SESSION_MSRP_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_SET_POBJECT(tmedia_msrp, KEY_STR, VALUE_PTR)
  371. #define TMEDIA_SESSION_MSRP_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_SET_STR(tmedia_msrp, KEY_STR, VALUE_STR)
  372. #define TMEDIA_SESSION_MSRP_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_SET_INT64(tmedia_msrp, KEY_STR, VALUE_INT64)
  373. #define TMEDIA_SESSION_MSRP_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_GET_INT32(tmedia_msrp, KEY_STR, VALUE_PINT32)
  374. //#define TMEDIA_SESSION_MSRP_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_GET_PVOID(tmedia_msrp, KEY_STR, VALUE_PPTR)
  375. //#define TMEDIA_SESSION_MSRP_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_GET_STR(tmedia_msrp, KEY_STR, VALUE_PSTR)
  376. //#define TMEDIA_SESSION_MSRP_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_GET_INT64(tmedia_msrp, KEY_STR, VALUE_PINT64)
  377. /* BFCP Session */
  378. #define TMEDIA_SESSION_BFCP_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_SET_INT32(tmedia_bfcp, KEY_STR, VALUE_INT32)
  379. #define TMEDIA_SESSION_BFCP_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_SET_POBJECT(tmedia_bfcp, KEY_STR, VALUE_PTR)
  380. #define TMEDIA_SESSION_BFCP_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_SET_STR(tmedia_bfcp, KEY_STR, VALUE_STR)
  381. #define TMEDIA_SESSION_BFCP_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_SET_INT64(tmedia_bfcp, KEY_STR, VALUE_INT64)
  382. #define TMEDIA_SESSION_BFCP_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_GET_INT32(tmedia_bfcp, KEY_STR, VALUE_PINT32)
  383. //#define TMEDIA_SESSION_BFCP_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_GET_PVOID(tmedia_bfcp, KEY_STR, VALUE_PPTR)
  384. //#define TMEDIA_SESSION_BFCP_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_GET_STR(tmedia_bfcp, KEY_STR, VALUE_PSTR)
  385. //#define TMEDIA_SESSION_BFCP_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_GET_INT64(tmedia_bfcp, KEY_STR, VALUE_PINT64)
  386. /* ANY Consumer */
  387. #define TMEDIA_SESSION_CONSUMER_SET_INT32(MEDIA_TYPE_ENUM, KEY_STR, VALUE_INT32) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_consumer, tmedia_pvt_int32, KEY_STR, VALUE_INT32)
  388. #define TMEDIA_SESSION_CONSUMER_SET_POBJECT(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PTR) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_consumer, tmedia_pvt_pobject, KEY_STR, VALUE_PTR)
  389. #define TMEDIA_SESSION_CONSUMER_SET_STR(MEDIA_TYPE_ENUM, KEY_STR, VALUE_STR) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_consumer, tmedia_pvt_pchar, KEY_STR, VALUE_STR)
  390. #define TMEDIA_SESSION_CONSUMER_SET_INT64(MEDIA_TYPE_ENUM, KEY_STR, VALUE_INT64) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_consumer, tmedia_pvt_int64, KEY_STR, VALUE_INT64)
  391. #define TMEDIA_SESSION_CONSUMER_GET_INT32(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PINT32) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_consumer, tmedia_pvt_int32, KEY_STR, VALUE_PINT32)
  392. //#define TMEDIA_SESSION_CONSUMER_GET_PVOID(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PPTR) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_consumer, tmedia_pvt_pobject, KEY_STR, VALUE_PPTR)
  393. //#define TMEDIA_SESSION_CONSUMER_GET_STR(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PSTR) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_consumer, tmedia_pvt_pchar, KEY_STR, VALUE_PSTR)
  394. //#define TMEDIA_SESSION_CONSUMER_GET_INT64(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PINT64) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_consumer, tmedia_pvt_int64, KEY_STR, VALUE_PINT64)
  395. /* AUDIO Consumer */
  396. #define TMEDIA_SESSION_AUDIO_CONSUMER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_CONSUMER_SET_INT32(tmedia_audio, KEY_STR, VALUE_INT32)
  397. #define TMEDIA_SESSION_AUDIO_CONSUMER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_CONSUMER_SET_POBJECT(tmedia_audio, KEY_STR, VALUE_PTR)
  398. #define TMEDIA_SESSION_AUDIO_CONSUMER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_CONSUMER_SET_STR(tmedia_audio, KEY_STR, VALUE_STR)
  399. #define TMEDIA_SESSION_AUDIO_CONSUMER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_CONSUMER_SET_INT64(tmedia_audio, KEY_STR, VALUE_INT64)
  400. #define TMEDIA_SESSION_AUDIO_CONSUMER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_CONSUMER_GET_INT32(tmedia_audio, KEY_STR, VALUE_PINT32)
  401. //#define TMEDIA_SESSION_AUDIO_CONSUMER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_CONSUMER_GET_PVOID(tmedia_audio, KEY_STR, VALUE_PPTR)
  402. //#define TMEDIA_SESSION_AUDIO_CONSUMER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_CONSUMER_GET_STR(tmedia_audio, KEY_STR, VALUE_PSTR)
  403. //#define TMEDIA_SESSION_AUDIO_CONSUMER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_CONSUMER_GET_INT64(tmedia_audio, KEY_STR, VALUE_PINT64)
  404. /* VIDEO Consumer */
  405. #define TMEDIA_SESSION_VIDEO_CONSUMER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_CONSUMER_SET_INT32(tmedia_video, KEY_STR, VALUE_INT32)
  406. #define TMEDIA_SESSION_VIDEO_CONSUMER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_CONSUMER_SET_POBJECT(tmedia_video, KEY_STR, VALUE_PTR)
  407. #define TMEDIA_SESSION_VIDEO_CONSUMER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_CONSUMER_SET_STR(tmedia_video, KEY_STR, VALUE_STR)
  408. #define TMEDIA_SESSION_VIDEO_CONSUMER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_CONSUMER_SET_INT64(tmedia_video, KEY_STR, VALUE_INT64)
  409. #define TMEDIA_SESSION_VIDEO_CONSUMER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_CONSUMER_GET_INT32(tmedia_video, KEY_STR, VALUE_PINT32)
  410. //#define TMEDIA_SESSION_VIDEO_CONSUMER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_CONSUMER_GET_PVOID(tmedia_video, KEY_STR, VALUE_PPTR)
  411. //#define TMEDIA_SESSION_VIDEO_CONSUMER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_CONSUMER_GET_STR(tmedia_video, KEY_STR, VALUE_PSTR)
  412. //#define TMEDIA_SESSION_VIDEO_CONSUMER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_CONSUMER_GET_INT64(tmedia_video, KEY_STR, VALUE_PINT64)
  413. /* MSRP Consumer */
  414. #define TMEDIA_SESSION_MSRP_CONSUMER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_CONSUMER_SET_INT32(tmedia_msrp, KEY_STR, VALUE_INT32)
  415. #define TMEDIA_SESSION_MSRP_CONSUMER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_CONSUMER_SET_POBJECT(tmedia_msrp, KEY_STR, VALUE_PTR)
  416. #define TMEDIA_SESSION_MSRP_CONSUMER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_CONSUMER_SET_STR(tmedia_msrp, KEY_STR, VALUE_STR)
  417. #define TMEDIA_SESSION_MSRP_CONSUMER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_CONSUMER_SET_INT64(tmedia_msrp, KEY_STR, VALUE_INT64)
  418. #define TMEDIA_SESSION_MSRP_CONSUMER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_CONSUMER_GET_INT32(tmedia_msrp, KEY_STR, VALUE_PINT32)
  419. //#define TMEDIA_SESSION_MSRP_CONSUMER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_CONSUMER_GET_PVOID(tmedia_msrp, KEY_STR, VALUE_PPTR)
  420. //#define TMEDIA_SESSION_MSRP_CONSUMER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_CONSUMER_GET_STR(tmedia_msrp, KEY_STR, VALUE_PSTR)
  421. //#define TMEDIA_SESSION_MSRP_CONSUMER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_CONSUMER_GET_INT64(tmedia_msrp, KEY_STR, VALUE_PINT64)
  422. /* BFCP Consumer */
  423. #define TMEDIA_SESSION_BFCP_CONSUMER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_CONSUMER_SET_INT32(tmedia_bfcp, KEY_STR, VALUE_INT32)
  424. #define TMEDIA_SESSION_BFCP_CONSUMER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_CONSUMER_SET_POBJECT(tmedia_bfcp, KEY_STR, VALUE_PTR)
  425. #define TMEDIA_SESSION_BFCP_CONSUMER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_CONSUMER_SET_STR(tmedia_bfcp, KEY_STR, VALUE_STR)
  426. #define TMEDIA_SESSION_BFCP_CONSUMER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_CONSUMER_SET_INT64(tmedia_bfcp, KEY_STR, VALUE_INT64)
  427. #define TMEDIA_SESSION_BFCP_CONSUMER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_CONSUMER_GET_INT32(tmedia_bfcp, KEY_STR, VALUE_PINT32)
  428. //#define TMEDIA_SESSION_BFCP_CONSUMER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_CONSUMER_GET_PVOID(tmedia_bfcp, KEY_STR, VALUE_PPTR)
  429. //#define TMEDIA_SESSION_BFCP_CONSUMER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_CONSUMER_GET_STR(tmedia_bfcp, KEY_STR, VALUE_PSTR)
  430. //#define TMEDIA_SESSION_BFCP_CONSUMER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_CONSUMER_GET_INT64(tmedia_bfcp, KEY_STR, VALUE_PINT64)
  431. /* ANY Producer */
  432. #define TMEDIA_SESSION_PRODUCER_SET_INT32(MEDIA_TYPE_ENUM, KEY_STR, VALUE_INT32) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_int32, KEY_STR, VALUE_INT32)
  433. #define TMEDIA_SESSION_PRODUCER_SET_POBJECT(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PTR) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_pobject, KEY_STR, VALUE_PTR)
  434. #define TMEDIA_SESSION_PRODUCER_SET_STR(MEDIA_TYPE_ENUM, KEY_STR, VALUE_STR) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_pchar, KEY_STR, VALUE_STR)
  435. #define TMEDIA_SESSION_PRODUCER_SET_INT64(MEDIA_TYPE_ENUM, KEY_STR, VALUE_INT64) TMEDIA_SESSION_SET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_int64, KEY_STR, VALUE_INT64)
  436. #define TMEDIA_SESSION_PRODUCER_GET_INT32(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PINT32) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_int32, KEY_STR, VALUE_PINT32)
  437. #define TMEDIA_SESSION_PRODUCER_GET_POBJECT(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PTR) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_pobject, KEY_STR, VALUE_PTR)
  438. //#define TMEDIA_SESSION_PRODUCER_GET_PVOID(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PPTR) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_pobject, KEY_STR, VALUE_PPTR)
  439. //#define TMEDIA_SESSION_PRODUCER_GET_STR(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PSTR) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_pchar, KEY_STR, VALUE_PSTR)
  440. //#define TMEDIA_SESSION_PRODUCER_GET_INT64(MEDIA_TYPE_ENUM, KEY_STR, VALUE_PINT64) TMEDIA_SESSION_GET_PARAM(MEDIA_TYPE_ENUM, tmedia_ppt_producer, tmedia_pvt_int64, KEY_STR, VALUE_PINT64)
  441. /* AUDIO Producer */
  442. #define TMEDIA_SESSION_AUDIO_PRODUCER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_PRODUCER_SET_INT32(tmedia_audio, KEY_STR, VALUE_INT32)
  443. #define TMEDIA_SESSION_AUDIO_PRODUCER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_PRODUCER_SET_POBJECT(tmedia_audio, KEY_STR, VALUE_PTR)
  444. #define TMEDIA_SESSION_AUDIO_PRODUCER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_AUDIO_PRODUCER_SET_STR(tmedia_audio, KEY_STR, VALUE_STR)
  445. #define TMEDIA_SESSION_AUDIO_PRODUCER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_PRODUCER_SET_INT64(tmedia_audio, KEY_STR, VALUE_INT64)
  446. #define TMEDIA_SESSION_AUDIO_PRODUCER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_PRODUCER_GET_INT32(tmedia_audio, KEY_STR, VALUE_PINT32)
  447. //#define TMEDIA_SESSION_AUDIO_PRODUCER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_PRODUCER_GET_PVOID(tmedia_audio, KEY_STR, VALUE_PPTR)
  448. //#define TMEDIA_SESSION_AUDIO_PRODUCER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_AUDIO_PRODUCER_GET_STR(tmedia_audio, KEY_STR, VALUE_PSTR)
  449. //#define TMEDIA_SESSION_AUDIO_PRODUCER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_PRODUCER_GET_INT64(tmedia_audio, KEY_STR, VALUE_PINT64)
  450. /* Video Producer */
  451. #define TMEDIA_SESSION_VIDEO_PRODUCER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_PRODUCER_SET_INT32(tmedia_video, KEY_STR, VALUE_INT32)
  452. #define TMEDIA_SESSION_VIDEO_PRODUCER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_PRODUCER_SET_POBJECT(tmedia_video, KEY_STR, VALUE_PTR)
  453. #define TMEDIA_SESSION_VIDEO_PRODUCER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_AUDIO_PRODUCER_SET_STR(tmedia_video, KEY_STR, VALUE_STR)
  454. #define TMEDIA_SESSION_VIDEO_PRODUCER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_PRODUCER_SET_INT64(tmedia_video, KEY_STR, VALUE_INT64)
  455. #define TMEDIA_SESSION_VIDEO_PRODUCER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_PRODUCER_GET_INT32(tmedia_video, KEY_STR, VALUE_PINT32)
  456. //#define TMEDIA_SESSION_VIDEO_PRODUCER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_PRODUCER_GET_PVOID(tmedia_video, KEY_STR, VALUE_PPTR)
  457. //#define TMEDIA_SESSION_VIDEO_PRODUCER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_AUDIO_PRODUCER_GET_STR(tmedia_video, KEY_STR, VALUE_PSTR)
  458. //#define TMEDIA_SESSION_VIDEO_PRODUCER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_PRODUCER_GET_INT64(tmedia_video, KEY_STR, VALUE_PINT64)
  459. /* MSRP Producer */
  460. #define TMEDIA_SESSION_MSRP_PRODUCER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_PRODUCER_SET_INT32(tmedia_msrp, KEY_STR, VALUE_INT32)
  461. #define TMEDIA_SESSION_MSRP_PRODUCER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_PRODUCER_SET_POBJECT(tmedia_msrp, KEY_STR, VALUE_PTR)
  462. #define TMEDIA_SESSION_MSRP_PRODUCER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_AUDIO_PRODUCER_SET_STR(tmedia_msrp, KEY_STR, VALUE_STR)
  463. #define TMEDIA_SESSION_MSRP_PRODUCER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_PRODUCER_SET_INT64(tmedia_msrp, KEY_STR, VALUE_INT64)
  464. #define TMEDIA_SESSION_MSRP_PRODUCER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_PRODUCER_GET_INT32(tmedia_msrp, KEY_STR, VALUE_PINT32)
  465. //#define TMEDIA_SESSION_MSRP_PRODUCER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_PRODUCER_GET_PVOID(tmedia_msrp, KEY_STR, VALUE_PPTR)
  466. //#define TMEDIA_SESSION_MSRP_PRODUCER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_AUDIO_PRODUCER_GET_STR(tmedia_msrp, KEY_STR, VALUE_PSTR)
  467. //#define TMEDIA_SESSION_MSRP_PRODUCER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_PRODUCER_GET_INT64(tmedia_msrp, KEY_STR, VALUE_PINT64)
  468. /* BFCP Producer */
  469. #define TMEDIA_SESSION_BFCP_PRODUCER_SET_INT32(KEY_STR, VALUE_INT32) TMEDIA_SESSION_PRODUCER_SET_INT32(tmedia_bfcp, KEY_STR, VALUE_INT32)
  470. #define TMEDIA_SESSION_BFCP_PRODUCER_SET_POBJECT(KEY_STR, VALUE_PTR) TMEDIA_SESSION_PRODUCER_SET_POBJECT(tmedia_bfcp, KEY_STR, VALUE_PTR)
  471. #define TMEDIA_SESSION_BFCP_PRODUCER_SET_STR(KEY_STR, VALUE_STR) TMEDIA_SESSION_AUDIO_PRODUCER_SET_STR(tmedia_bfcp, KEY_STR, VALUE_STR)
  472. #define TMEDIA_SESSION_BFCP_PRODUCER_SET_INT64(KEY_STR, VALUE_INT64) TMEDIA_SESSION_PRODUCER_SET_INT64(tmedia_bfcp, KEY_STR, VALUE_INT64)
  473. #define TMEDIA_SESSION_BFCP_PRODUCER_GET_INT32(KEY_STR, VALUE_PINT32) TMEDIA_SESSION_PRODUCER_GET_INT32(tmedia_bfcp, KEY_STR, VALUE_PINT32)
  474. //#define TMEDIA_SESSION_MSRP_PRODUCER_GET_PVOID(KEY_STR, VALUE_PPTR) TMEDIA_SESSION_PRODUCER_GET_PVOID(tmedia_bfcp, KEY_STR, VALUE_PPTR)
  475. //#define TMEDIA_SESSION_MSRP_PRODUCER_GET_STR(KEY_STR, VALUE_PSTR) TMEDIA_SESSION_AUDIO_PRODUCER_GET_STR(tmedia_bfcp, KEY_STR, VALUE_PSTR)
  476. //#define TMEDIA_SESSION_MSRP_PRODUCER_GET_INT64(KEY_STR, VALUE_PINT64) TMEDIA_SESSION_PRODUCER_GET_INT64(tmedia_bfcp, KEY_STR, VALUE_PINT64)
  477. #define TMEDIA_SESSION_SET_NULL() tmedia_sptype_null
  478. #define TMEDIA_SESSION_GET_NULL() tmedia_sptype_null
  479. //#define TMEDIA_SESSION_SET_REMOTE_IP(IP_STR) tmedia_sptype_remote_ip, (const char*) IP_STR
  480. //#define TMEDIA_SESSION_SET_LOCAL_IP(IP_STR, IPv6_BOOL) tmedia_sptype_local_ip, (const char*) IP_STR, (tsk_bool_t)IPv6_BOOL
  481. //#define TMEDIA_SESSION_SET_RTCP(ENABLED_BOOL) tmedia_sptype_set_rtcp, (tsk_bool_t)ENABLED_BOOL
  482. //#define TMEDIA_SESSION_SET_QOS(TYPE_ENUM, STRENGTH_ENUM) tmedia_sptype_qos, (tmedia_qos_stype_t)TYPE_ENUM, (tmedia_qos_strength_t)STRENGTH_ENUM
  483. TINYMEDIA_API tmedia_session_mgr_t* tmedia_session_mgr_create(tmedia_type_t type, const char* addr, tsk_bool_t use_ipv6, tsk_bool_t offerer);
  484. TINYMEDIA_API int tmedia_session_mgr_set_media_type(tmedia_session_mgr_t* self, tmedia_type_t type);
  485. TINYMEDIA_API int tmedia_session_mgr_set_media_type_2(tmedia_session_mgr_t* self, tmedia_type_t type, tsk_bool_t force);
  486. TINYMEDIA_API int tmedia_session_mgr_set_codecs_supported(tmedia_session_mgr_t* self, tmedia_codec_id_t codecs_supported);
  487. TINYMEDIA_API tmedia_session_t* tmedia_session_mgr_find(tmedia_session_mgr_t* self, tmedia_type_t type);
  488. TINYMEDIA_API int tmedia_session_mgr_set_natt_ctx(tmedia_session_mgr_t* self, struct tnet_nat_ctx_s* natt_ctx, const char* public_addr);
  489. TINYMEDIA_API int tmedia_session_mgr_set_ice_ctx(tmedia_session_mgr_t* self, struct tnet_ice_ctx_s* ctx_audio, struct tnet_ice_ctx_s* ctx_video);
  490. TINYMEDIA_API int tmedia_session_mgr_set_ice_ctx_2(tmedia_session_mgr_t* self, tmedia_type_t type, struct tnet_ice_ctx_s* ctx);
  491. TINYMEDIA_API int tmedia_session_mgr_start(tmedia_session_mgr_t* self);
  492. TINYMEDIA_API int tmedia_session_mgr_set(tmedia_session_mgr_t* self, ...);
  493. TINYMEDIA_API int tmedia_session_mgr_set_2(tmedia_session_mgr_t* self, va_list *app);
  494. TINYMEDIA_API int tmedia_session_mgr_set_3(tmedia_session_mgr_t* self, const tmedia_params_L_t* params);
  495. TINYMEDIA_API int tmedia_session_mgr_get(tmedia_session_mgr_t* self, ...);
  496. TINYMEDIA_API int tmedia_session_mgr_stop(tmedia_session_mgr_t* self);
  497. TINYMEDIA_API const tsdp_message_t* tmedia_session_mgr_get_lo(tmedia_session_mgr_t* self);
  498. TINYMEDIA_API int tmedia_session_mgr_set_ro(tmedia_session_mgr_t* self, const tsdp_message_t* sdp, tmedia_ro_type_t ro_type);
  499. TINYMEDIA_API const tsdp_message_t* tmedia_session_mgr_get_ro(tmedia_session_mgr_t* self);
  500. TINYMEDIA_API tsk_bool_t tmedia_session_mgr_is_new_ro(tmedia_session_mgr_t* self, const tsdp_message_t* sdp);
  501. TINYMEDIA_API int tmedia_session_mgr_hold(tmedia_session_mgr_t* self, tmedia_type_t type);
  502. TINYMEDIA_API tsk_bool_t tmedia_session_mgr_is_held(tmedia_session_mgr_t* self, tmedia_type_t type, tsk_bool_t local);
  503. TINYMEDIA_API int tmedia_session_mgr_resume(tmedia_session_mgr_t* self, tmedia_type_t type, tsk_bool_t local);
  504. TINYMEDIA_API int tmedia_session_mgr_add_media(tmedia_session_mgr_t* self, tmedia_type_t type);
  505. TINYMEDIA_API int tmedia_session_mgr_remove_media(tmedia_session_mgr_t* self, tmedia_type_t type);
  506. TINYMEDIA_API int tmedia_session_mgr_set_qos(tmedia_session_mgr_t* self, tmedia_qos_stype_t qos_type, tmedia_qos_strength_t qos_strength);
  507. TINYMEDIA_API tsk_bool_t tmedia_session_mgr_canresume(tmedia_session_mgr_t* self);
  508. TINYMEDIA_API tsk_bool_t tmedia_session_mgr_has_active_session(tmedia_session_mgr_t* self);
  509. TINYMEDIA_API int tmedia_session_mgr_send_dtmf(tmedia_session_mgr_t* self, uint8_t event);
  510. TINYMEDIA_API int tmedia_session_mgr_set_t140_ondata_cbfn(tmedia_session_mgr_t* self, const void* context, tmedia_session_t140_ondata_cb_f fun);
  511. TINYMEDIA_API int tmedia_session_mgr_send_t140_data(tmedia_session_mgr_t* self, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
  512. TINYMEDIA_API int tmedia_session_mgr_set_onrtcp_cbfn(tmedia_session_mgr_t* self, tmedia_type_t media_type, const void* context, tmedia_session_rtcp_onevent_cb_f fun);
  513. TINYMEDIA_API int tmedia_session_mgr_send_rtcp_event(tmedia_session_mgr_t* self, tmedia_type_t media_type, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
  514. TINYMEDIA_API int tmedia_session_mgr_recv_rtcp_event(tmedia_session_mgr_t* self, tmedia_type_t media_type, tmedia_rtcp_event_type_t event_type, uint32_t ssrc_media);
  515. TINYMEDIA_API int tmedia_session_mgr_recv_rtcp_event_2(tmedia_session_mgr_t* self, tmedia_rtcp_event_type_t event_type, uint64_t session_id);
  516. TINYMEDIA_API int tmedia_session_mgr_send_file(tmedia_session_mgr_t* self, const char* path, ...);
  517. TINYMEDIA_API int tmedia_session_mgr_send_message(tmedia_session_mgr_t* self, const void* data, tsk_size_t size, const tmedia_params_L_t *params);
  518. TINYMEDIA_API int tmedia_session_mgr_set_msrp_cb(tmedia_session_mgr_t* self, const void* usrdata, tmedia_session_msrp_cb_f func);
  519. TINYMEDIA_API int tmedia_session_mgr_set_onerror_cbfn(tmedia_session_mgr_t* self, const void* usrdata, tmedia_session_onerror_cb_f fun);
  520. TINYMEDIA_API int tmedia_session_mgr_set_rfc5168_cbfn(tmedia_session_mgr_t* self, const void* usrdata, tmedia_session_rfc5168_cb_f fun);
  521. TINYMEDIA_API int tmedia_session_mgr_set_bfcp_cbfn(tmedia_session_mgr_t* self, const void* usrdata, tmedia_session_bfcp_cb_f fun);
  522. TINYMEDIA_API int tmedia_session_mgr_lo_apply_changes(tmedia_session_mgr_t* self);
  523. TINYMEDIA_GEXTERN const tsk_object_def_t *tmedia_session_mgr_def_t;
  524. TMEDIA_END_DECLS
  525. #endif /* TINYMEDIA_SESSION_H */