rt_MediaSessionMgr.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
  2. *
  3. * This file is part of Open Source Doubango Framework.
  4. *
  5. * DOUBANGO 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 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * DOUBANGO 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 DOUBANGO.
  17. */
  18. #pragma once
  19. class MediaSessionMgr;
  20. class Codec;
  21. struct tmedia_codec_s;
  22. struct tmedia_session_mgr_s;
  23. namespace doubango_rt
  24. {
  25. namespace BackEnd
  26. {
  27. enum class rt_twrap_media_type_t;
  28. enum class rt_tmedia_profile_t;
  29. enum class rt_tmedia_srtp_mode_t;
  30. enum class rt_tmedia_srtp_type_t;
  31. enum class rt_tmedia_profile_t;
  32. enum class rt_tmedia_pref_video_size_t;
  33. public ref class rtCodec sealed
  34. {
  35. internal:
  36. rtCodec(struct tmedia_codec_s* pCodec);
  37. public:
  38. virtual ~rtCodec();
  39. enum class rt_twrap_media_type_t getMediaType();
  40. Platform::String^ getName();
  41. Platform::String^ getDescription();
  42. Platform::String^ getNegFormat();
  43. int getAudioSamplingRate();
  44. int getAudioChannels();
  45. int getAudioPTime();
  46. private:
  47. Codec* m_pCodec;
  48. };
  49. public ref class rtMediaSessionMgr sealed
  50. {
  51. internal:
  52. rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr);
  53. public:
  54. virtual ~rtMediaSessionMgr();
  55. bool sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
  56. int32 sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key);
  57. bool consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
  58. bool consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
  59. bool producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
  60. bool producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
  61. rtCodec^ producerGetCodec(rt_twrap_media_type_t media);
  62. static unsigned int registerAudioPluginFromFile(Platform::String^ path);
  63. uint64 getSessionId(rt_twrap_media_type_t media);
  64. internal: // Must be from SIP service to share same global memory space
  65. static bool defaultsSetProfile(rt_tmedia_profile_t profile);
  66. static rt_tmedia_profile_t defaultsGetProfile();
  67. static bool defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size);
  68. static bool defaultsSetJbMargin(uint32 jb_margin_ms);
  69. static bool defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent);
  70. static bool defaultsSetEchoTail(uint32 echo_tail);
  71. static uint32 defaultsGetEchoTail();
  72. static bool defaultsSetEchoSkew(uint32 echo_skew);
  73. static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
  74. static bool defaultsGetEchoSuppEnabled();
  75. static bool defaultsSetAgcEnabled(bool agc_enabled);
  76. static bool defaultsGetAgcEnabled();
  77. static bool defaultsSetAgcLevel(float agc_level);
  78. static float defaultsGetAgcLevel();
  79. static bool defaultsSetVadEnabled(bool vad_enabled);
  80. static bool defaultsGetGetVadEnabled();
  81. static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
  82. static bool defaultsGetNoiseSuppEnabled();
  83. static bool defaultsSetNoiseSuppLevel(int32 noise_supp_level);
  84. static int32 defaultsGetNoiseSuppLevel();
  85. static bool defaultsSet100relEnabled(bool _100rel_enabled);
  86. static bool defaultsGet100relEnabled();
  87. static bool defaultsSetScreenSize(int32 sx, int32 sy);
  88. static bool defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain);
  89. static bool defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop);
  90. static bool defaultsSetRtpSymetricEnabled(bool enabled);
  91. static bool defaultsSetMediaType(enum class rt_twrap_media_type_t media_type);
  92. static bool defaultsSetVolume(int32 volume);
  93. static int32 defaultsGetVolume();
  94. static bool defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher);
  95. static bool defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode);
  96. static enum class rt_tmedia_srtp_mode_t defaultsGetSRtpMode();
  97. static bool defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type);
  98. static enum class rt_tmedia_srtp_type_t defaultsGetSRtpType();
  99. static bool defaultsSetRtcpEnabled(bool enabled);
  100. static bool defaultsGetRtcpEnabled();
  101. static bool defaultsSetRtcpMuxEnabled(bool enabled);
  102. static bool defaultsGetRtcpMuxEnabled();
  103. static bool defaultsSetIceEnabled(bool ice_enabled);
  104. static bool defaultsSetByPassEncoding(bool enabled);
  105. static bool defaultsGetByPassEncoding();
  106. static bool defaultsSetByPassDecoding(bool enabled);
  107. static bool defaultsGetByPassDecoding();
  108. static bool defaultsSetVideoJbEnabled(bool enabled);
  109. static bool defaultsGetVideoJbEnabled();
  110. static bool defaultsSetRtpBuffSize(unsigned buffSize);
  111. static unsigned defaultsGetRtpBuffSize();
  112. static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
  113. private:
  114. MediaSessionMgr* m_pMediaSessionMgr;
  115. };
  116. }
  117. }