1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*/
#include "rt_MediaSessionMgr.h"
#include "rt_Enums.h"
#include "rt_String.h"
#include "MediaSessionMgr.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
rtCodec::rtCodec(struct tmedia_codec_s* pCodec)
{
m_pCodec = new Codec(pCodec);
}
rtCodec::~rtCodec()
{
rtSafeDelete(m_pCodec);
}
enum class rt_twrap_media_type_t rtCodec::getMediaType()
{
return (rt_twrap_media_type_t)m_pCodec->getMediaType();
}
Platform::String^ rtCodec::getName()
{
return rtString::toString(m_pCodec->getName());
}
Platform::String^ rtCodec::getDescription()
{
return rtString::toString(m_pCodec->getDescription());
}
Platform::String^ rtCodec::getNegFormat()
{
return rtString::toString(m_pCodec->getNegFormat());
}
int rtCodec::getAudioSamplingRate()
{
return m_pCodec->getAudioSamplingRate();
}
int rtCodec::getAudioChannels()
{
return m_pCodec->getAudioChannels();
}
int rtCodec::getAudioPTime()
{
return m_pCodec->getAudioPTime();
}
rtMediaSessionMgr::rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr)
{
m_pMediaSessionMgr = new MediaSessionMgr(pWrappedMgr);
}
rtMediaSessionMgr::~rtMediaSessionMgr()
{
rtSafeDelete(m_pMediaSessionMgr);
}
bool rtMediaSessionMgr::sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
return m_pMediaSessionMgr->sessionSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
int32 rtMediaSessionMgr::sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key)
{
return m_pMediaSessionMgr->sessionGetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data());
}
bool rtMediaSessionMgr::consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
return m_pMediaSessionMgr->consumerSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value)
{
return m_pMediaSessionMgr->consumerSetInt64((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
return m_pMediaSessionMgr->producerSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value)
{
return m_pMediaSessionMgr->producerSetInt64((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
rtCodec^ rtMediaSessionMgr::producerGetCodec(rt_twrap_media_type_t media)
{
Codec* c = m_pMediaSessionMgr->producerGetCodec((twrap_media_type_t)media);
if(c)
{
rtCodec^ codec = ref new rtCodec(const_cast<struct tmedia_codec_s*>(c->getWrappedCodec()));
rtSafeDelete(c);
return codec;
}
return nullptr;
}
unsigned int rtMediaSessionMgr::registerAudioPluginFromFile(Platform::String^ path)
{
return MediaSessionMgr::registerAudioPluginFromFile(rtString::toUtf8(path).data());
}
uint64 rtMediaSessionMgr::getSessionId(rt_twrap_media_type_t media)
{
return m_pMediaSessionMgr->getSessionId((twrap_media_type_t)media);
}
bool rtMediaSessionMgr::defaultsSetProfile(rt_tmedia_profile_t profile)
{
return MediaSessionMgr::defaultsSetProfile((tmedia_profile_t) profile);
}
rt_tmedia_profile_t rtMediaSessionMgr::defaultsGetProfile()
{
return (rt_tmedia_profile_t)MediaSessionMgr::defaultsGetProfile();
}
bool rtMediaSessionMgr::defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size)
{
return MediaSessionMgr::defaultsSetPrefVideoSize((tmedia_pref_video_size_t) pref_video_size);
}
bool rtMediaSessionMgr::defaultsSetJbMargin(uint32 jb_margin_ms)
{
return MediaSessionMgr::defaultsSetJbMargin(jb_margin_ms);
}
bool rtMediaSessionMgr::defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent)
{
return MediaSessionMgr::defaultsSetJbMaxLateRate(jb_late_rate_percent);
}
bool rtMediaSessionMgr::defaultsSetEchoTail(uint32 echo_tail)
{
return MediaSessionMgr::defaultsSetEchoTail(echo_tail);
}
uint32 rtMediaSessionMgr::defaultsGetEchoTail()
{
return MediaSessionMgr::defaultsGetEchoTail();
}
bool rtMediaSessionMgr::defaultsSetEchoSkew(uint32 echo_skew)
{
return MediaSessionMgr::defaultsSetEchoSkew(echo_skew);
}
bool rtMediaSessionMgr::defaultsSetEchoSuppEnabled(bool echo_supp_enabled)
{
return MediaSessionMgr::defaultsSetEchoSuppEnabled(echo_supp_enabled);
}
bool rtMediaSessionMgr::defaultsGetEchoSuppEnabled()
{
return MediaSessionMgr::defaultsGetEchoSuppEnabled();
}
bool rtMediaSessionMgr::defaultsSetAgcEnabled(bool agc_enabled)
{
return MediaSessionMgr::defaultsSetAgcEnabled(agc_enabled);
}
bool rtMediaSessionMgr::defaultsGetAgcEnabled()
{
return MediaSessionMgr::defaultsGetAgcEnabled();
}
bool rtMediaSessionMgr::defaultsSetAgcLevel(float agc_level)
{
return MediaSessionMgr::defaultsSetAgcLevel(agc_level);
}
float rtMediaSessionMgr::defaultsGetAgcLevel()
{
return MediaSessionMgr::defaultsGetAgcLevel();
}
bool rtMediaSessionMgr::defaultsSetVadEnabled(bool vad_enabled)
{
return MediaSessionMgr::defaultsSetVadEnabled(vad_enabled);
}
bool rtMediaSessionMgr::defaultsGetGetVadEnabled()
{
return MediaSessionMgr::defaultsGetGetVadEnabled();
}
bool rtMediaSessionMgr::defaultsSetNoiseSuppEnabled(bool noise_supp_enabled)
{
return MediaSessionMgr::defaultsSetNoiseSuppEnabled(noise_supp_enabled);
}
bool rtMediaSessionMgr::defaultsGetNoiseSuppEnabled()
{
return MediaSessionMgr::defaultsGetNoiseSuppEnabled();
}
bool rtMediaSessionMgr::defaultsSetNoiseSuppLevel(int32 noise_supp_level)
{
return MediaSessionMgr::defaultsSetNoiseSuppLevel(noise_supp_level);
}
int32 rtMediaSessionMgr::defaultsGetNoiseSuppLevel()
{
return MediaSessionMgr::defaultsGetNoiseSuppLevel();
}
bool rtMediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
{
return MediaSessionMgr::defaultsSet100relEnabled(_100rel_enabled);
}
bool rtMediaSessionMgr::defaultsGet100relEnabled()
{
return MediaSessionMgr::defaultsGet100relEnabled();
}
bool rtMediaSessionMgr::defaultsSetScreenSize(int32 sx, int32 sy)
{
return MediaSessionMgr::defaultsSetScreenSize(sx, sy);
}
bool rtMediaSessionMgr::defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain)
{
return MediaSessionMgr::defaultsSetAudioGain(producer_gain, consumer_gain);
}
bool rtMediaSessionMgr::defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop)
{
return MediaSessionMgr::defaultsSetRtpPortRange(range_start, range_stop);
}
bool rtMediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled)
{
return MediaSessionMgr::defaultsSetRtpSymetricEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsSetMediaType(enum class rt_twrap_media_type_t media_type)
{
return MediaSessionMgr::defaultsSetMediaType((twrap_media_type_t) media_type);
}
bool rtMediaSessionMgr::defaultsSetVolume(int32 volume)
{
return MediaSessionMgr::defaultsSetVolume(volume);
}
int32 rtMediaSessionMgr::defaultsGetVolume()
{
return MediaSessionMgr::defaultsGetVolume();
}
bool rtMediaSessionMgr::defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher)
{
return MediaSessionMgr::defaultsSetInviteSessionTimers(timeout, rtString::toUtf8(refresher).data());
}
bool rtMediaSessionMgr::defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode)
{
return MediaSessionMgr::defaultsSetSRtpMode((tmedia_srtp_mode_t) mode);
}
enum class rt_tmedia_srtp_mode_t rtMediaSessionMgr::defaultsGetSRtpMode()
{
return (rt_tmedia_srtp_mode_t)MediaSessionMgr::defaultsGetSRtpMode();
}
bool rtMediaSessionMgr::defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type)
{
return MediaSessionMgr::defaultsSetSRtpType((tmedia_srtp_type_t) srtp_type);
}
enum class rt_tmedia_srtp_type_t rtMediaSessionMgr::defaultsGetSRtpType()
{
return (rt_tmedia_srtp_type_t)MediaSessionMgr::defaultsGetSRtpType();
}
bool rtMediaSessionMgr::defaultsSetRtcpEnabled(bool enabled)
{
return MediaSessionMgr::defaultsSetRtcpEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetRtcpEnabled()
{
return MediaSessionMgr::defaultsGetRtcpEnabled();
}
bool rtMediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled)
{
return MediaSessionMgr::defaultsSetRtcpMuxEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetRtcpMuxEnabled()
{
return MediaSessionMgr::defaultsGetRtcpMuxEnabled();
}
bool rtMediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled)
{
return MediaSessionMgr::defaultsSetIceEnabled(ice_enabled);
}
bool rtMediaSessionMgr::defaultsSetByPassEncoding(bool enabled)
{
return MediaSessionMgr::defaultsSetByPassEncoding(enabled);
}
bool rtMediaSessionMgr::defaultsGetByPassEncoding()
{
return MediaSessionMgr::defaultsGetByPassEncoding();
}
bool rtMediaSessionMgr::defaultsSetByPassDecoding(bool enabled)
{
return MediaSessionMgr::defaultsSetByPassDecoding(enabled);
}
bool rtMediaSessionMgr::defaultsGetByPassDecoding()
{
return MediaSessionMgr::defaultsGetByPassDecoding();
}
bool rtMediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled)
{
return MediaSessionMgr::defaultsSetVideoJbEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetVideoJbEnabled()
{
return MediaSessionMgr::defaultsGetVideoJbEnabled();
}
bool rtMediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize)
{
return MediaSessionMgr::defaultsSetRtpBuffSize(buffSize);
}
unsigned rtMediaSessionMgr::defaultsGetRtpBuffSize()
{
return MediaSessionMgr::defaultsGetRtpBuffSize();
}
bool rtMediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max)
{
return MediaSessionMgr::defaultsSetAvpfTail(tail_min, tail_max);
}
|