summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'bindings')
-rwxr-xr-xbindings/_common/ActionConfig.cxx70
-rwxr-xr-xbindings/_common/ActionConfig.h36
-rwxr-xr-xbindings/_common/AudioResampler.cxx64
-rwxr-xr-xbindings/_common/AudioResampler.h36
-rwxr-xr-xbindings/_common/Common.h89
-rwxr-xr-xbindings/_common/DDebug.cxx151
-rwxr-xr-xbindings/_common/DDebug.h36
-rwxr-xr-xbindings/_common/MediaContent.cxx199
-rwxr-xr-xbindings/_common/MediaContent.h44
-rwxr-xr-xbindings/_common/MediaSessionMgr.cxx634
-rwxr-xr-xbindings/_common/MediaSessionMgr.h287
-rwxr-xr-xbindings/_common/Msrp.cxx360
-rwxr-xr-xbindings/_common/Msrp.h68
-rwxr-xr-xbindings/_common/ProxyConsumer.cxx1003
-rwxr-xr-xbindings/_common/ProxyConsumer.h268
-rwxr-xr-xbindings/_common/ProxyPluginMgr.cxx338
-rwxr-xr-xbindings/_common/ProxyPluginMgr.h107
-rwxr-xr-xbindings/_common/ProxyProducer.cxx734
-rwxr-xr-xbindings/_common/ProxyProducer.h194
-rwxr-xr-xbindings/_common/SMSEncoder.cxx497
-rwxr-xr-xbindings/_common/SMSEncoder.h98
-rwxr-xr-xbindings/_common/SafeObject.cxx14
-rwxr-xr-xbindings/_common/SafeObject.h18
-rwxr-xr-xbindings/_common/SipCallback.cxx6
-rwxr-xr-xbindings/_common/SipCallback.h48
-rwxr-xr-xbindings/_common/SipEvent.cxx128
-rwxr-xr-xbindings/_common/SipEvent.h112
-rwxr-xr-xbindings/_common/SipMessage.cxx422
-rwxr-xr-xbindings/_common/SipMessage.h60
-rwxr-xr-xbindings/_common/SipSession.cxx987
-rwxr-xr-xbindings/_common/SipSession.h368
-rwxr-xr-xbindings/_common/SipStack.cxx741
-rwxr-xr-xbindings/_common/SipStack.h144
-rwxr-xr-xbindings/_common/SipUri.cxx66
-rwxr-xr-xbindings/_common/SipUri.h38
-rwxr-xr-xbindings/_common/Xcap.cxx606
-rwxr-xr-xbindings/_common/Xcap.h144
-rwxr-xr-xbindings/_common/tinyWRAP.i1
-rwxr-xr-xbindings/_common/tinyWRAP_config.h12
-rwxr-xr-xbindings/csharp/MediaSessionMgr.cs16
-rw-r--r--bindings/csharp/QoS.cs121
-rwxr-xr-xbindings/csharp/tinyWRAPPINVOKE.cs57
-rwxr-xr-xbindings/csharp/tinyWRAP_wrap.cxx228
-rwxr-xr-xbindings/java/MediaSessionMgr.java13
-rw-r--r--bindings/java/QoS.java98
-rwxr-xr-xbindings/java/android/MediaSessionMgr.java13
-rw-r--r--bindings/java/android/QoS.java98
-rwxr-xr-xbindings/java/android/tinyWRAPJNI.java19
-rwxr-xr-xbindings/java/android/tinyWRAP_wrap.cxx282
-rwxr-xr-xbindings/java/tinyWRAPJNI.java19
-rwxr-xr-xbindings/java/tinyWRAP_wrap.cxx282
-rwxr-xr-xbindings/perl/tinyWRAP.pm49
-rwxr-xr-xbindings/perl/tinyWRAP_wrap.cxx732
-rwxr-xr-xbindings/python/tinyWRAP.py40
-rwxr-xr-xbindings/python/tinyWRAP_wrap.cxx615
-rwxr-xr-xbindings/ruby/tinyWRAP_wrap.cxx5271
-rwxr-xr-xbindings/ruby/tinyWRAP_wrap.h16
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_ActionConfig.h52
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_Config.h9
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_DDebug.h54
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_Enums.h609
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_MediaContent.h6
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h192
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_Msrp.h149
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SMSEncoder.h6
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipCallback.h82
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipEvent.h378
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipMessage.h86
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipSession.h682
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipStack.h178
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_SipUri.h68
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_String.h24
-rwxr-xr-xbindings/winrt/doubango_rt/include/rt_Xcap.h6
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_ActionConfig.cxx36
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_DDebug.cxx62
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_Enums.cxx6
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_MediaContent.cxx6
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx159
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_Msrp.cxx109
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx6
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipCallback.cxx169
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipEvent.cxx68
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipMessage.cxx106
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipSession.cxx267
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipStack.cxx255
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_SipUri.cxx41
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_String.cxx50
-rwxr-xr-xbindings/winrt/doubango_rt/src/rt_Xcap.cxx6
88 files changed, 12129 insertions, 8995 deletions
diff --git a/bindings/_common/ActionConfig.cxx b/bindings/_common/ActionConfig.cxx
index 0c1f9a4..35628ed 100755
--- a/bindings/_common/ActionConfig.cxx
+++ b/bindings/_common/ActionConfig.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*/
@@ -23,66 +23,66 @@
ActionConfig::ActionConfig()
{
- m_pHandle = tsip_action_create(tsip_atype_config,
- TSIP_ACTION_SET_NULL());
+ m_pHandle = tsip_action_create(tsip_atype_config,
+ TSIP_ACTION_SET_NULL());
}
ActionConfig::~ActionConfig()
{
- TSK_OBJECT_SAFE_FREE(m_pHandle);
+ TSK_OBJECT_SAFE_FREE(m_pHandle);
}
bool ActionConfig::addHeader(const char* name, const char* value)
{
- return (tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_HEADER(name, value),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_HEADER(name, value),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool ActionConfig::addPayload(const void* payload, unsigned len)
{
- return (tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool ActionConfig::setActiveMedia(twrap_media_type_t type)
{
- tmedia_type_t media_type = twrap_get_native_media_type(type);
- return (tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_MEDIA_TYPE(media_type),
- TSIP_ACTION_SET_NULL()) == 0);
+ tmedia_type_t media_type = twrap_get_native_media_type(type);
+ return (tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_MEDIA_TYPE(media_type),
+ TSIP_ACTION_SET_NULL()) == 0);
}
ActionConfig* ActionConfig::setResponseLine(short code, const char* phrase)
{
- int32_t _code = code;
- tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_RESP_LINE(_code, phrase),
- TSIP_ACTION_SET_NULL());
- return this;
+ int32_t _code = code;
+ tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_RESP_LINE(_code, phrase),
+ TSIP_ACTION_SET_NULL());
+ return this;
}
ActionConfig* ActionConfig::setMediaString(twrap_media_type_t type, const char* key, const char* value)
{
- tmedia_type_t media_type = twrap_get_native_media_type(type);
- tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_MEDIA(
- TMEDIA_SESSION_SET_STR(media_type, key, value),
- TMEDIA_SESSION_SET_NULL()),
- TSIP_ACTION_SET_NULL());
+ tmedia_type_t media_type = twrap_get_native_media_type(type);
+ tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_MEDIA(
+ TMEDIA_SESSION_SET_STR(media_type, key, value),
+ TMEDIA_SESSION_SET_NULL()),
+ TSIP_ACTION_SET_NULL());
- return this;
+ return this;
}
ActionConfig* ActionConfig::setMediaInt(twrap_media_type_t type, const char* key, int value)
{
- tmedia_type_t media_type = twrap_get_native_media_type(type);
- tsip_action_set(m_pHandle,
- TSIP_ACTION_SET_MEDIA(
- TMEDIA_SESSION_SET_INT32(media_type, key, value),
- TMEDIA_SESSION_SET_NULL()),
- TSIP_ACTION_SET_NULL());
+ tmedia_type_t media_type = twrap_get_native_media_type(type);
+ tsip_action_set(m_pHandle,
+ TSIP_ACTION_SET_MEDIA(
+ TMEDIA_SESSION_SET_INT32(media_type, key, value),
+ TMEDIA_SESSION_SET_NULL()),
+ TSIP_ACTION_SET_NULL());
- return this;
+ return this;
} \ No newline at end of file
diff --git a/bindings/_common/ActionConfig.h b/bindings/_common/ActionConfig.h
index ab8ad73..2cc43bd 100755
--- a/bindings/_common/ActionConfig.h
+++ b/bindings/_common/ActionConfig.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2010-2011 Mamadou Diop.
-*
+*
* 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.
*/
@@ -26,25 +26,25 @@
class TINYWRAP_API ActionConfig
{
public:
- ActionConfig();
- virtual ~ActionConfig();
-
- bool addHeader(const char* name, const char* value);
- bool addPayload(const void* payload, unsigned len);
- bool setActiveMedia(twrap_media_type_t type);
-
- ActionConfig* setResponseLine(short code, const char* phrase);
- ActionConfig* setMediaString(twrap_media_type_t type, const char* key, const char* value);
- ActionConfig* setMediaInt(twrap_media_type_t type, const char* key, int value);
-
+ ActionConfig();
+ virtual ~ActionConfig();
+
+ bool addHeader(const char* name, const char* value);
+ bool addPayload(const void* payload, unsigned len);
+ bool setActiveMedia(twrap_media_type_t type);
+
+ ActionConfig* setResponseLine(short code, const char* phrase);
+ ActionConfig* setMediaString(twrap_media_type_t type, const char* key, const char* value);
+ ActionConfig* setMediaInt(twrap_media_type_t type, const char* key, int value);
+
private:
- tsip_action_handle_t* m_pHandle;
+ tsip_action_handle_t* m_pHandle;
#if !defined(SWIG)
public:
- const inline tsip_action_handle_t* getHandle()const{
- return m_pHandle;
- }
+ const inline tsip_action_handle_t* getHandle()const {
+ return m_pHandle;
+ }
#endif
};
diff --git a/bindings/_common/AudioResampler.cxx b/bindings/_common/AudioResampler.cxx
index 519376d..850fdc8 100755
--- a/bindings/_common/AudioResampler.cxx
+++ b/bindings/_common/AudioResampler.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -32,42 +32,42 @@
#include "tsk_debug.h"
AudioResampler::AudioResampler(uint32_t nInFreq, uint32_t nOutFreq, uint32_t nFrameDuration, uint32_t nChannels, uint32_t nQuality):
-m_nOutFreq(nOutFreq),
-m_nInFreq(nInFreq),
-m_nFrameDuration(nFrameDuration),
-m_nChannels(nChannels),
-m_nQuality(nQuality)
+ m_nOutFreq(nOutFreq),
+ m_nInFreq(nInFreq),
+ m_nFrameDuration(nFrameDuration),
+ m_nChannels(nChannels),
+ m_nQuality(nQuality)
{
- if ((m_pWrappedResampler = tmedia_resampler_create())) {
- int ret;
- if ((ret = tmedia_resampler_open(m_pWrappedResampler, nInFreq, nOutFreq, nFrameDuration, nChannels, nChannels, m_nQuality, 16))){
- TSK_DEBUG_ERROR("Failed to open audio resampler (%d)", ret);
- TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
- }
- }
- else {
- TSK_DEBUG_ERROR("No audio resampler could be found. Did you forget to call tdav_init()?");
- }
+ if ((m_pWrappedResampler = tmedia_resampler_create())) {
+ int ret;
+ if ((ret = tmedia_resampler_open(m_pWrappedResampler, nInFreq, nOutFreq, nFrameDuration, nChannels, nChannels, m_nQuality, 16))) {
+ TSK_DEBUG_ERROR("Failed to open audio resampler (%d)", ret);
+ TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("No audio resampler could be found. Did you forget to call tdav_init()?");
+ }
}
AudioResampler::~AudioResampler()
{
- TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
+ TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
}
uint32_t AudioResampler::process(const void* pInData, uint32_t nInSizeInBytes, void* pOutData, uint32_t nOutSizeInBytes)
{
- if(!m_pWrappedResampler){
- TSK_DEBUG_ERROR("Embedded resampler is invalid");
- return 0;
- }
- if(nInSizeInBytes < getInputRequiredSizeInShort()/2){
- TSK_DEBUG_ERROR("Input buffer is too short");
- return 0;
- }
- if(nOutSizeInBytes < getOutputRequiredSizeInShort()/2){
- TSK_DEBUG_ERROR("Output buffer is too short");
- return 0;
- }
- return 2*tmedia_resampler_process(m_pWrappedResampler, (uint16_t*)pInData, nInSizeInBytes/2, (uint16_t*)pOutData, nOutSizeInBytes/2);
+ if(!m_pWrappedResampler) {
+ TSK_DEBUG_ERROR("Embedded resampler is invalid");
+ return 0;
+ }
+ if(nInSizeInBytes < getInputRequiredSizeInShort()/2) {
+ TSK_DEBUG_ERROR("Input buffer is too short");
+ return 0;
+ }
+ if(nOutSizeInBytes < getOutputRequiredSizeInShort()/2) {
+ TSK_DEBUG_ERROR("Output buffer is too short");
+ return 0;
+ }
+ return 2*tmedia_resampler_process(m_pWrappedResampler, (uint16_t*)pInData, nInSizeInBytes/2, (uint16_t*)pOutData, nOutSizeInBytes/2);
}
diff --git a/bindings/_common/AudioResampler.h b/bindings/_common/AudioResampler.h
index 5f597fd..87c7995 100755
--- a/bindings/_common/AudioResampler.h
+++ b/bindings/_common/AudioResampler.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -34,22 +34,28 @@
class AudioResampler
{
public:
- AudioResampler(uint32_t nInFreq, uint32_t nOutFreq, uint32_t nFrameDuration, uint32_t nChannels, uint32_t nQuality);
- ~AudioResampler();
+ AudioResampler(uint32_t nInFreq, uint32_t nOutFreq, uint32_t nFrameDuration, uint32_t nChannels, uint32_t nQuality);
+ ~AudioResampler();
public:
- inline bool isValid(){ return (m_pWrappedResampler != tsk_null); }
- inline uint32_t getOutputRequiredSizeInShort(){ return (m_nOutFreq * m_nFrameDuration)/1000; }
- inline uint32_t getInputRequiredSizeInShort(){ return (m_nInFreq * m_nFrameDuration)/1000; }
- uint32_t process(const void* pInData, uint32_t nInSizeInBytes, void* pOutData, uint32_t nOutSizeInBytes);
+ inline bool isValid() {
+ return (m_pWrappedResampler != tsk_null);
+ }
+ inline uint32_t getOutputRequiredSizeInShort() {
+ return (m_nOutFreq * m_nFrameDuration)/1000;
+ }
+ inline uint32_t getInputRequiredSizeInShort() {
+ return (m_nInFreq * m_nFrameDuration)/1000;
+ }
+ uint32_t process(const void* pInData, uint32_t nInSizeInBytes, void* pOutData, uint32_t nOutSizeInBytes);
private:
- struct tmedia_resampler_s* m_pWrappedResampler;
- uint32_t m_nOutFreq;
- uint32_t m_nInFreq;
- uint32_t m_nFrameDuration;
- uint32_t m_nChannels;
- uint32_t m_nQuality;
+ struct tmedia_resampler_s* m_pWrappedResampler;
+ uint32_t m_nOutFreq;
+ uint32_t m_nInFreq;
+ uint32_t m_nFrameDuration;
+ uint32_t m_nChannels;
+ uint32_t m_nQuality;
};
diff --git a/bindings/_common/Common.h b/bindings/_common/Common.h
index ca299c0..eb206b6 100755
--- a/bindings/_common/Common.h
+++ b/bindings/_common/Common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -32,65 +32,62 @@
# define __JNIENV void
#endif
-typedef enum twrap_media_type_e
-{
- // because of Java don't use OR
- twrap_media_none = 0x00,
+typedef enum twrap_media_type_e {
+ // because of Java don't use OR
+ twrap_media_none = 0x00,
- twrap_media_audio = 0x01, // (0x01 << 0)
- twrap_media_video = 0x02, // (0x01 << 1)
- twrap_media_msrp = 0x04, // (0x01 << 2)
- twrap_media_t140 = 0x08, // (0x01 << 3)
- twrap_media_bfcp = 0x10, // (0x01 << 4)
- twrap_media_bfcp_audio = 0x30, // (0x01 << 5) | twrap_media_bfcp;
- twrap_media_bfcp_video = 0x50, // (0x01 << 6) | twrap_media_bfcp;
+ twrap_media_audio = 0x01, // (0x01 << 0)
+ twrap_media_video = 0x02, // (0x01 << 1)
+ twrap_media_msrp = 0x04, // (0x01 << 2)
+ twrap_media_t140 = 0x08, // (0x01 << 3)
+ twrap_media_bfcp = 0x10, // (0x01 << 4)
+ twrap_media_bfcp_audio = 0x30, // (0x01 << 5) | twrap_media_bfcp;
+ twrap_media_bfcp_video = 0x50, // (0x01 << 6) | twrap_media_bfcp;
- twrap_media_audiovideo = 0x03, /* @deprecated */
- twrap_media_audio_video = twrap_media_audiovideo,
+ twrap_media_audiovideo = 0x03, /* @deprecated */
+ twrap_media_audio_video = twrap_media_audiovideo,
}
twrap_media_type_t;
#if !defined(SWIG)
#include "tinymedia/tmedia_common.h"
-struct media_type_bind_s
-{
- twrap_media_type_t twrap;
- tmedia_type_t tnative;
+struct media_type_bind_s {
+ twrap_media_type_t twrap;
+ tmedia_type_t tnative;
};
-static const struct media_type_bind_s __media_type_binds[] =
-{
- { twrap_media_msrp, tmedia_msrp },
- { twrap_media_audio , tmedia_audio },
- { twrap_media_video, tmedia_video },
- { twrap_media_audio_video, (tmedia_type_t)(tmedia_audio | tmedia_video) },
- { twrap_media_t140, tmedia_t140 },
- { twrap_media_bfcp, tmedia_bfcp },
- { twrap_media_bfcp_audio, tmedia_bfcp_audio },
- { twrap_media_bfcp_video, tmedia_bfcp_video },
+static const struct media_type_bind_s __media_type_binds[] = {
+ { twrap_media_msrp, tmedia_msrp },
+ { twrap_media_audio , tmedia_audio },
+ { twrap_media_video, tmedia_video },
+ { twrap_media_audio_video, (tmedia_type_t)(tmedia_audio | tmedia_video) },
+ { twrap_media_t140, tmedia_t140 },
+ { twrap_media_bfcp, tmedia_bfcp },
+ { twrap_media_bfcp_audio, tmedia_bfcp_audio },
+ { twrap_media_bfcp_video, tmedia_bfcp_video },
};
static const tsk_size_t __media_type_binds_count = sizeof(__media_type_binds)/sizeof(__media_type_binds[0]);
static tmedia_type_t twrap_get_native_media_type(twrap_media_type_t type)
{
- tsk_size_t u;
- tmedia_type_t t = tmedia_none;
- for (u = 0; u < __media_type_binds_count; ++u) {
- if ((__media_type_binds[u].twrap & type) == __media_type_binds[u].twrap) {
- t = (tmedia_type_t)(t | __media_type_binds[u].tnative);
- }
- }
- return t;
+ tsk_size_t u;
+ tmedia_type_t t = tmedia_none;
+ for (u = 0; u < __media_type_binds_count; ++u) {
+ if ((__media_type_binds[u].twrap & type) == __media_type_binds[u].twrap) {
+ t = (tmedia_type_t)(t | __media_type_binds[u].tnative);
+ }
+ }
+ return t;
}
static twrap_media_type_t twrap_get_wrapped_media_type(tmedia_type_t type)
{
- twrap_media_type_t t = twrap_media_none;
- tsk_size_t u;
- for (u = 0; u < __media_type_binds_count; ++u) {
- if ((__media_type_binds[u].tnative & type) == __media_type_binds[u].tnative) {
- t = (twrap_media_type_t)(t | __media_type_binds[u].twrap);
- }
- }
- return t;
+ twrap_media_type_t t = twrap_media_none;
+ tsk_size_t u;
+ for (u = 0; u < __media_type_binds_count; ++u) {
+ if ((__media_type_binds[u].tnative & type) == __media_type_binds[u].tnative) {
+ t = (twrap_media_type_t)(t | __media_type_binds[u].twrap);
+ }
+ }
+ return t;
}
#endif
diff --git a/bindings/_common/DDebug.cxx b/bindings/_common/DDebug.cxx
index d00efad..a1b77b3 100755
--- a/bindings/_common/DDebug.cxx
+++ b/bindings/_common/DDebug.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -34,109 +34,112 @@
* Callbacks should not be used with Android (JNI).
*/
-enum cb_type{
- cb_info,
- cb_warn,
- cb_error,
- cb_fatal
+enum cb_type {
+ cb_info,
+ cb_warn,
+ cb_error,
+ cb_fatal
};
int debug_xxx_cb(const void* arg, const char* fmt, enum cb_type type, va_list *app)
{
- int ret = -1;
- if(!arg){
- return -1;
- }
-
- const SipStack* stack = dyn_cast<const SipStack*>((const SipStack*)arg);
-
- if(stack && stack->getDebugCallback()){
- char* message = tsk_null;
- tsk_sprintf_2(&message, fmt, app);
-
- switch(type){
- case cb_info:
- ret=
+ int ret = -1;
+ if(!arg) {
+ return -1;
+ }
+
+ const SipStack* stack = dyn_cast<const SipStack*>((const SipStack*)arg);
+
+ if(stack && stack->getDebugCallback()) {
+ char* message = tsk_null;
+ tsk_sprintf_2(&message, fmt, app);
+
+ switch(type) {
+ case cb_info:
+ ret=
#if ANDROID
- __android_log_write(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, message);
+ __android_log_write(ANDROID_LOG_INFO, ANDROID_DEBUG_TAG, message);
#else
- stack->getDebugCallback()-> OnDebugInfo(message);
+ stack->getDebugCallback()-> OnDebugInfo(message);
#endif
- break;
- case cb_warn:
- ret=
+ break;
+ case cb_warn:
+ ret=
#if ANDROID
- __android_log_write(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, message);
+ __android_log_write(ANDROID_LOG_WARN, ANDROID_DEBUG_TAG, message);
#else
- stack->getDebugCallback()-> OnDebugWarn(message);
+ stack->getDebugCallback()-> OnDebugWarn(message);
#endif
- break;
- case cb_error:
- ret=
+ break;
+ case cb_error:
+ ret=
#if ANDROID
- __android_log_write(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, message);
+ __android_log_write(ANDROID_LOG_ERROR, ANDROID_DEBUG_TAG, message);
#else
- stack->getDebugCallback()-> OnDebugError(message);
+ stack->getDebugCallback()-> OnDebugError(message);
#endif
- break;
- case cb_fatal:
- ret=
+ break;
+ case cb_fatal:
+ ret=
#if ANDROID
- __android_log_write(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, message);
+ __android_log_write(ANDROID_LOG_FATAL, ANDROID_DEBUG_TAG, message);
#else
- stack->getDebugCallback()-> OnDebugFatal(message);
+ stack->getDebugCallback()-> OnDebugFatal(message);
#endif
- break;
- }
-
- TSK_FREE(message);
- }
+ break;
+ }
- return ret;
+ TSK_FREE(message);
+ }
+
+ return ret;
}
int DDebugCallback::debug_info_cb(const void* arg, const char* fmt, ...)
{
- va_list ap;
- int ret;
-
- va_start(ap, fmt);
- ret = debug_xxx_cb(arg, fmt, cb_info, &ap);
- va_end(ap);
-
- return ret;
+ va_list ap;
+ int ret;
+
+ va_start(ap, fmt);
+ ret = debug_xxx_cb(arg, fmt, cb_info, &ap);
+ va_end(ap);
+
+ return ret;
}
-int DDebugCallback::debug_warn_cb(const void* arg, const char* fmt, ...){
- va_list ap;
- int ret;
+int DDebugCallback::debug_warn_cb(const void* arg, const char* fmt, ...)
+{
+ va_list ap;
+ int ret;
- va_start(ap, fmt);
- ret = debug_xxx_cb(arg, fmt, cb_warn, &ap);
- va_end(ap);
+ va_start(ap, fmt);
+ ret = debug_xxx_cb(arg, fmt, cb_warn, &ap);
+ va_end(ap);
- return ret;
+ return ret;
}
-int DDebugCallback::debug_error_cb(const void* arg, const char* fmt, ...){
- va_list ap;
- int ret;
+int DDebugCallback::debug_error_cb(const void* arg, const char* fmt, ...)
+{
+ va_list ap;
+ int ret;
- va_start(ap, fmt);
- ret = debug_xxx_cb(arg, fmt, cb_error, &ap);
- va_end(ap);
+ va_start(ap, fmt);
+ ret = debug_xxx_cb(arg, fmt, cb_error, &ap);
+ va_end(ap);
- return ret;
+ return ret;
}
-int DDebugCallback::debug_fatal_cb(const void* arg, const char* fmt, ...){
- va_list ap;
- int ret;
+int DDebugCallback::debug_fatal_cb(const void* arg, const char* fmt, ...)
+{
+ va_list ap;
+ int ret;
- va_start(ap, fmt);
- ret = debug_xxx_cb(arg, fmt, cb_fatal, &ap);
- va_end(ap);
+ va_start(ap, fmt);
+ ret = debug_xxx_cb(arg, fmt, cb_fatal, &ap);
+ va_end(ap);
- return ret;
+ return ret;
}
diff --git a/bindings/_common/DDebug.h b/bindings/_common/DDebug.h
index 94f2f5f..67b6340 100755
--- a/bindings/_common/DDebug.h
+++ b/bindings/_common/DDebug.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -25,25 +25,33 @@
class DDebugCallback
{
public:
- DDebugCallback() { }
- virtual ~DDebugCallback() {}
+ DDebugCallback() { }
+ virtual ~DDebugCallback() {}
- virtual int OnDebugInfo(const char* message) { return -1; }
- virtual int OnDebugWarn(const char* message) { return -1; }
- virtual int OnDebugError(const char* message) { return -1; }
- virtual int OnDebugFatal(const char* message) { return -1; }
+ virtual int OnDebugInfo(const char* message) {
+ return -1;
+ }
+ virtual int OnDebugWarn(const char* message) {
+ return -1;
+ }
+ virtual int OnDebugError(const char* message) {
+ return -1;
+ }
+ virtual int OnDebugFatal(const char* message) {
+ return -1;
+ }
#if !defined(SWIG)
public:
- static int debug_info_cb(const void* arg, const char* fmt, ...);
- static int debug_warn_cb(const void* arg, const char* fmt, ...);
- static int debug_error_cb(const void* arg, const char* fmt, ...);
- static int debug_fatal_cb(const void* arg, const char* fmt, ...);
+ static int debug_info_cb(const void* arg, const char* fmt, ...);
+ static int debug_warn_cb(const void* arg, const char* fmt, ...);
+ static int debug_error_cb(const void* arg, const char* fmt, ...);
+ static int debug_fatal_cb(const void* arg, const char* fmt, ...);
#endif
private:
-
+
};
#endif /* TINYWRAP_SIP_DEBUG_H */
diff --git a/bindings/_common/MediaContent.cxx b/bindings/_common/MediaContent.cxx
index 1929898..b039bd2 100755
--- a/bindings/_common/MediaContent.cxx
+++ b/bindings/_common/MediaContent.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -24,91 +24,91 @@
MediaContent::MediaContent(tmedia_content_t* pContent)
-: m_pData(tsk_null)
+ : m_pData(tsk_null)
{
- m_pContent = (tmedia_content_t*)tsk_object_ref(pContent);
+ m_pContent = (tmedia_content_t*)tsk_object_ref(pContent);
}
MediaContent::~MediaContent()
{
- TSK_OBJECT_SAFE_FREE(m_pContent);
- TSK_OBJECT_SAFE_FREE(m_pData);
+ TSK_OBJECT_SAFE_FREE(m_pContent);
+ TSK_OBJECT_SAFE_FREE(m_pData);
}
const char* MediaContent::getType()
{
- if(m_pContent){
- return m_pContent->type;
- }
- return tsk_null;
+ if(m_pContent) {
+ return m_pContent->type;
+ }
+ return tsk_null;
}
unsigned MediaContent::getDataLength()
{
- if(!m_pContent){
- TSK_DEBUG_ERROR("Invalid internal object");
- return 0;
- }
+ if(!m_pContent) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return 0;
+ }
- if(!m_pData){
- m_pData = tmedia_content_get_data(m_pContent);
- }
+ if(!m_pData) {
+ m_pData = tmedia_content_get_data(m_pContent);
+ }
- return (m_pData ? m_pData->size : 0);
+ return (m_pData ? m_pData->size : 0);
}
unsigned MediaContent::getData(void* pOutput, unsigned nMaxsize)
{
- unsigned nRetsize = 0;
-
- if(!m_pContent){
- TSK_DEBUG_ERROR("Invalid internal object");
- return 0;
- }
-
- if(!m_pData){
- m_pData = tmedia_content_get_data(m_pContent);
- }
-
- if(pOutput && nMaxsize && m_pData){
- nRetsize = (m_pData->size > nMaxsize) ? nMaxsize : m_pData->size;
- memcpy(pOutput, m_pData->data, nRetsize);
- }
-
- return nRetsize;
+ unsigned nRetsize = 0;
+
+ if(!m_pContent) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return 0;
+ }
+
+ if(!m_pData) {
+ m_pData = tmedia_content_get_data(m_pContent);
+ }
+
+ if(pOutput && nMaxsize && m_pData) {
+ nRetsize = (m_pData->size > nMaxsize) ? nMaxsize : m_pData->size;
+ memcpy(pOutput, m_pData->data, nRetsize);
+ }
+
+ return nRetsize;
}
MediaContent* MediaContent::parse(const void* pData, unsigned nSize, const char* pType)
{
- MediaContent* pMediaContent = tsk_null;
-
- tmedia_content_t* pContent = tmedia_content_parse(pData, (tsk_size_t)nSize, pType);
- if(pContent){
- if(TMEDIA_CONTENT_IS_CPIM(pContent)){
- pMediaContent = new MediaContentCPIM(pContent);
- }
- else if(TMEDIA_CONTENT_IS_DUMMY(pContent)){
- // Todo
- }
- TSK_OBJECT_SAFE_FREE(pContent);
- }
-
- return pMediaContent;
+ MediaContent* pMediaContent = tsk_null;
+
+ tmedia_content_t* pContent = tmedia_content_parse(pData, (tsk_size_t)nSize, pType);
+ if(pContent) {
+ if(TMEDIA_CONTENT_IS_CPIM(pContent)) {
+ pMediaContent = new MediaContentCPIM(pContent);
+ }
+ else if(TMEDIA_CONTENT_IS_DUMMY(pContent)) {
+ // Todo
+ }
+ TSK_OBJECT_SAFE_FREE(pContent);
+ }
+
+ return pMediaContent;
}
MediaContentCPIM* MediaContent::parse(const void* pData, unsigned nSize)
{
- MediaContent* pMediaContent;
- if((pMediaContent = MediaContent::parse(pData, nSize, TMEDIA_CONTENT_CPIM_TYPE))){
- return dyn_cast<MediaContentCPIM*>(pMediaContent);
- }
- return tsk_null;
+ MediaContent* pMediaContent;
+ if((pMediaContent = MediaContent::parse(pData, nSize, TMEDIA_CONTENT_CPIM_TYPE))) {
+ return dyn_cast<MediaContentCPIM*>(pMediaContent);
+ }
+ return tsk_null;
}
/* ============ message/CPIM ================= */
MediaContentCPIM::MediaContentCPIM(tmedia_content_t* pContent)
-: MediaContent(pContent)
+ : MediaContent(pContent)
{
}
@@ -118,61 +118,62 @@ MediaContentCPIM::~MediaContentCPIM()
unsigned MediaContentCPIM::getPayloadLength()
{
- if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)){
- TSK_DEBUG_ERROR("Invalid internal object");
- return 0;
- }
+ if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return 0;
+ }
- return (TMEDIA_CONTENT_CPIM(m_pContent)->e ? TMEDIA_CONTENT_CPIM(m_pContent)->e->size : 0);
+ return (TMEDIA_CONTENT_CPIM(m_pContent)->e ? TMEDIA_CONTENT_CPIM(m_pContent)->e->size : 0);
}
unsigned MediaContentCPIM::getPayload(void* pOutput, unsigned nMaxsize)
{
- unsigned nRetsize = 0;
+ unsigned nRetsize = 0;
- if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)){
- TSK_DEBUG_ERROR("Invalid internal object");
- return 0;
- }
+ if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return 0;
+ }
- if(pOutput && nMaxsize && TMEDIA_CONTENT_CPIM(m_pContent)->e){
- nRetsize = (TMEDIA_CONTENT_CPIM(m_pContent)->e->size > nMaxsize) ? nMaxsize : TMEDIA_CONTENT_CPIM(m_pContent)->e->size;
- memcpy(pOutput, TMEDIA_CONTENT_CPIM(m_pContent)->e->data, nRetsize);
- }
+ if(pOutput && nMaxsize && TMEDIA_CONTENT_CPIM(m_pContent)->e) {
+ nRetsize = (TMEDIA_CONTENT_CPIM(m_pContent)->e->size > nMaxsize) ? nMaxsize : TMEDIA_CONTENT_CPIM(m_pContent)->e->size;
+ memcpy(pOutput, TMEDIA_CONTENT_CPIM(m_pContent)->e->data, nRetsize);
+ }
- return nRetsize;
+ return nRetsize;
}
-const void* MediaContentCPIM::getPayloadPtr(){
- if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)){
- TSK_DEBUG_ERROR("Invalid internal object");
- return tsk_null;
- }
-
- return TMEDIA_CONTENT_CPIM(m_pContent)->e ? TMEDIA_CONTENT_CPIM(m_pContent)->e->data : tsk_null;
+const void* MediaContentCPIM::getPayloadPtr()
+{
+ if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return tsk_null;
+ }
+
+ return TMEDIA_CONTENT_CPIM(m_pContent)->e ? TMEDIA_CONTENT_CPIM(m_pContent)->e->data : tsk_null;
}
const char* MediaContentCPIM::getHeaderValue(const char* name)
{
- const tmedia_content_cpim_t* cpim;
- const tsk_list_item_t* item;
-
- if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)){
- TSK_DEBUG_ERROR("Invalid internal object");
- return tsk_null;
- }
-
- cpim = TMEDIA_CONTENT_CPIM(m_pContent);
- tsk_list_foreach(item, cpim->h_headers){
- if(tsk_striequals(name, TMEDIA_CONTENT_HEADER(item->data)->name)){
- return TMEDIA_CONTENT_HEADER(item->data)->value;
- }
- }
- tsk_list_foreach(item, cpim->m_headers){
- if(tsk_striequals(name, TMEDIA_CONTENT_HEADER(item->data)->name)){
- return TMEDIA_CONTENT_HEADER(item->data)->value;
- }
- }
-
- return tsk_null;
+ const tmedia_content_cpim_t* cpim;
+ const tsk_list_item_t* item;
+
+ if(!m_pContent || !TMEDIA_CONTENT_IS_CPIM(m_pContent)) {
+ TSK_DEBUG_ERROR("Invalid internal object");
+ return tsk_null;
+ }
+
+ cpim = TMEDIA_CONTENT_CPIM(m_pContent);
+ tsk_list_foreach(item, cpim->h_headers) {
+ if(tsk_striequals(name, TMEDIA_CONTENT_HEADER(item->data)->name)) {
+ return TMEDIA_CONTENT_HEADER(item->data)->value;
+ }
+ }
+ tsk_list_foreach(item, cpim->m_headers) {
+ if(tsk_striequals(name, TMEDIA_CONTENT_HEADER(item->data)->name)) {
+ return TMEDIA_CONTENT_HEADER(item->data)->value;
+ }
+ }
+
+ return tsk_null;
} \ No newline at end of file
diff --git a/bindings/_common/MediaContent.h b/bindings/_common/MediaContent.h
index 36bf929..204b8ec 100755
--- a/bindings/_common/MediaContent.h
+++ b/bindings/_common/MediaContent.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -31,27 +31,27 @@ class MediaContent
{
public:
#if !defined(SWIG)
- MediaContent(tmedia_content_t* content);
+ MediaContent(tmedia_content_t* content);
#endif
- virtual ~MediaContent();
+ virtual ~MediaContent();
public:
- const char* getType();
- virtual unsigned getDataLength();
- virtual unsigned getData(void* pOutput, unsigned nMaxsize);
-
- // SWIG %newobject()
- static MediaContent* parse(const void* pData, unsigned nSize, const char* pType);
- static MediaContentCPIM* parse(const void* pData, unsigned nSize);
+ const char* getType();
+ virtual unsigned getDataLength();
+ virtual unsigned getData(void* pOutput, unsigned nMaxsize);
+
+ // SWIG %newobject()
+ static MediaContent* parse(const void* pData, unsigned nSize, const char* pType);
+ static MediaContentCPIM* parse(const void* pData, unsigned nSize);
- virtual unsigned getPayloadLength() = 0;
- virtual unsigned getPayload(void* pOutput, unsigned nMaxsize) = 0;
+ virtual unsigned getPayloadLength() = 0;
+ virtual unsigned getPayload(void* pOutput, unsigned nMaxsize) = 0;
protected:
- tmedia_content_t* m_pContent;
+ tmedia_content_t* m_pContent;
private:
- tsk_buffer_t* m_pData;
+ tsk_buffer_t* m_pData;
};
@@ -60,17 +60,17 @@ class MediaContentCPIM : public MediaContent
{
public:
#if !defined(SWIG)
- MediaContentCPIM(tmedia_content_t* pContent);
+ MediaContentCPIM(tmedia_content_t* pContent);
#endif
- virtual ~MediaContentCPIM();
+ virtual ~MediaContentCPIM();
public:
- virtual unsigned getPayloadLength();
- virtual unsigned getPayload(void* pOutput, unsigned nMaxsize);
+ virtual unsigned getPayloadLength();
+ virtual unsigned getPayload(void* pOutput, unsigned nMaxsize);
#if !defined(SWIG)
- const void* getPayloadPtr();
+ const void* getPayloadPtr();
#endif
- const char* getHeaderValue(const char* pName);
+ const char* getHeaderValue(const char* pName);
};
#endif /*TINYWRAP_MEDIA_CONTENT_H*/
diff --git a/bindings/_common/MediaSessionMgr.cxx b/bindings/_common/MediaSessionMgr.cxx
index 5561e3c..6bfb333 100755
--- a/bindings/_common/MediaSessionMgr.cxx
+++ b/bindings/_common/MediaSessionMgr.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -22,77 +22,107 @@
#include "MediaSessionMgr.h"
//
+// QoS
+//
+QoS::QoS(float qavg, float q1 /*= -1.f*/, float q2 /*= -1.f*/, float q3 /*= -1.f*/, float q4 /*= -1.f*/, float q5 /*= -1.f*/)
+ : m_Qqvg(qavg)
+ , m_VideoInWidth(0)
+ , m_VideoOutWidth(0)
+ , m_VideoInHeight(0)
+ , m_VideoOutHeight(0)
+ , m_BandwidthDownKbps(0)
+ , m_BandwidthUpKbps(0)
+ , m_VideoInAvgFps(0)
+ , m_VideoDecAvgTime(0)
+ , m_VideoEncAvgTime(0)
+{
+ m_Qn[0] = q1;
+ m_Qn[1] = q2;
+ m_Qn[2] = q3;
+ m_Qn[3] = q4;
+ m_Qn[4] = q5;
+}
+
+QoS::~QoS()
+{
+}
+
+//
// Codec
//
Codec::Codec(const struct tmedia_codec_s* pWrappedCodec)
{
- m_pWrappedCodec = (struct tmedia_codec_s*)tsk_object_ref(TSK_OBJECT(pWrappedCodec));
+ m_pWrappedCodec = (struct tmedia_codec_s*)tsk_object_ref(TSK_OBJECT(pWrappedCodec));
}
Codec::~Codec()
{
- TSK_OBJECT_SAFE_FREE(m_pWrappedCodec);
+ TSK_OBJECT_SAFE_FREE(m_pWrappedCodec);
}
twrap_media_type_t Codec::getMediaType()
{
- if(m_pWrappedCodec){
- switch(m_pWrappedCodec->type){
- case tmedia_audio: return twrap_media_audio;
- case tmedia_video: return twrap_media_video;
- case tmedia_msrp: return twrap_media_msrp;
- default: break;
- }
- }
- return twrap_media_none;
+ if(m_pWrappedCodec) {
+ switch(m_pWrappedCodec->type) {
+ case tmedia_audio:
+ return twrap_media_audio;
+ case tmedia_video:
+ return twrap_media_video;
+ case tmedia_msrp:
+ return twrap_media_msrp;
+ default:
+ break;
+ }
+ }
+ return twrap_media_none;
}
const char* Codec::getName()
{
- if(m_pWrappedCodec){
- return m_pWrappedCodec->name;
- }
- return tsk_null;
+ if(m_pWrappedCodec) {
+ return m_pWrappedCodec->name;
+ }
+ return tsk_null;
}
const char* Codec::getDescription()
{
- if(m_pWrappedCodec){
- return m_pWrappedCodec->desc;
- }
- return tsk_null;
+ if(m_pWrappedCodec) {
+ return m_pWrappedCodec->desc;
+ }
+ return tsk_null;
}
const char* Codec::getNegFormat()
{
- if(m_pWrappedCodec){
- return m_pWrappedCodec->neg_format ? m_pWrappedCodec->neg_format : m_pWrappedCodec->format;
- }
- return tsk_null;
+ if(m_pWrappedCodec) {
+ return m_pWrappedCodec->neg_format ? m_pWrappedCodec->neg_format : m_pWrappedCodec->format;
+ }
+ return tsk_null;
}
int Codec::getAudioSamplingRate()
{
- if(m_pWrappedCodec && m_pWrappedCodec->plugin){
- return m_pWrappedCodec->plugin->rate;
- }
- return 0;
+ if(m_pWrappedCodec && m_pWrappedCodec->plugin) {
+ return m_pWrappedCodec->plugin->rate;
+ }
+ return 0;
}
int Codec::getAudioChannels()
{
- if(m_pWrappedCodec && (m_pWrappedCodec->type & tmedia_audio) && m_pWrappedCodec->plugin){
- return m_pWrappedCodec->plugin->audio.channels;
- }
- return 0;
+ if(m_pWrappedCodec && (m_pWrappedCodec->type & tmedia_audio) && m_pWrappedCodec->plugin) {
+ return m_pWrappedCodec->plugin->audio.channels;
+ }
+ return 0;
}
int Codec::getAudioPTime()
{
- if(m_pWrappedCodec && (m_pWrappedCodec->type & tmedia_audio) && m_pWrappedCodec->plugin){
- return m_pWrappedCodec->plugin->audio.ptime;
- }
- return 0;
+ if(m_pWrappedCodec && (m_pWrappedCodec->type & tmedia_audio) && m_pWrappedCodec->plugin) {
+ return m_pWrappedCodec->plugin->audio.ptime;
+ }
+ return 0;
}
//
@@ -100,78 +130,107 @@ int Codec::getAudioPTime()
//
MediaSessionMgr::MediaSessionMgr(tmedia_session_mgr_t* pWrappedMgr)
{
- m_pWrappedMgr = (tmedia_session_mgr_t*)tsk_object_ref(pWrappedMgr);
+ m_pWrappedMgr = (tmedia_session_mgr_t*)tsk_object_ref(pWrappedMgr);
}
MediaSessionMgr::~MediaSessionMgr()
{
- TSK_OBJECT_SAFE_FREE(m_pWrappedMgr);
+ TSK_OBJECT_SAFE_FREE(m_pWrappedMgr);
}
bool MediaSessionMgr::sessionSetInt32(twrap_media_type_t media, const char* key, int32_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_SET_INT32(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_SET_INT32(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
int32_t MediaSessionMgr::sessionGetInt32(twrap_media_type_t media, const char* key)
{
- int32_t value = 0;
- tmedia_type_t _media = twrap_get_native_media_type(media);
- (tmedia_session_mgr_get(m_pWrappedMgr,
- TMEDIA_SESSION_GET_INT32(_media, key, &value),
- TMEDIA_SESSION_GET_NULL()));
- return value;
+ int32_t value = 0;
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ (tmedia_session_mgr_get(m_pWrappedMgr,
+ TMEDIA_SESSION_GET_INT32(_media, key, &value),
+ TMEDIA_SESSION_GET_NULL()));
+ return value;
+}
+
+QoS* MediaSessionMgr::sessionGetQoS(twrap_media_type_t media)
+{
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
+ if (session) {
+ QoS* pQoS = new QoS(
+ session->qos_metrics.qvag,
+ session->qos_metrics.q1,
+ session->qos_metrics.q2,
+ session->qos_metrics.q3,
+ session->qos_metrics.q4,
+ session->qos_metrics.q5);
+ if (pQoS && ((_media & tmedia_video) || (_media & tmedia_bfcp_video))) {
+ pQoS->m_VideoInWidth = session->qos_metrics.video_in_width;
+ pQoS->m_VideoInHeight = session->qos_metrics.video_in_height;
+ pQoS->m_VideoOutWidth = session->qos_metrics.video_out_width;
+ pQoS->m_VideoOutHeight = session->qos_metrics.video_out_height;
+ pQoS->m_BandwidthDownKbps = session->qos_metrics.bw_down_est_kbps;
+ pQoS->m_BandwidthUpKbps = session->qos_metrics.bw_up_est_kbps;
+ pQoS->m_VideoInAvgFps = session->qos_metrics.video_in_avg_fps;
+ pQoS->m_VideoDecAvgTime = session->qos_metrics.video_dec_avg_time;
+ pQoS->m_VideoEncAvgTime = session->qos_metrics.video_enc_avg_time;
+ }
+ TSK_OBJECT_SAFE_FREE(session);
+ return pQoS;
+ }
+ return NULL;
}
bool MediaSessionMgr::consumerSetInt32(twrap_media_type_t media, const char* key, int32_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_CONSUMER_SET_INT32(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_CONSUMER_SET_INT32(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
bool MediaSessionMgr::consumerSetInt64(twrap_media_type_t media, const char* key, int64_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_CONSUMER_SET_INT64(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_CONSUMER_SET_INT64(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
bool MediaSessionMgr::producerSetInt32(twrap_media_type_t media, const char* key, int32_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_PRODUCER_SET_INT32(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_PRODUCER_SET_INT32(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
bool MediaSessionMgr::producerSetInt64(twrap_media_type_t media, const char* key, int64_t value)
{
- tmedia_type_t _media = twrap_get_native_media_type(media);
- return (tmedia_session_mgr_set(m_pWrappedMgr,
- TMEDIA_SESSION_PRODUCER_SET_INT64(_media, key, value),
- TMEDIA_SESSION_SET_NULL()) == 0);
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ return (tmedia_session_mgr_set(m_pWrappedMgr,
+ TMEDIA_SESSION_PRODUCER_SET_INT64(_media, key, value),
+ TMEDIA_SESSION_SET_NULL()) == 0);
}
Codec* MediaSessionMgr::producerGetCodec(twrap_media_type_t media)
{
- tmedia_codec_t* _codec = tsk_null;
- tmedia_type_t _media = twrap_get_native_media_type(media);
- (tmedia_session_mgr_get(m_pWrappedMgr,
- TMEDIA_SESSION_PRODUCER_GET_POBJECT(_media, "codec", &_codec),
- TMEDIA_SESSION_GET_NULL()));
+ tmedia_codec_t* _codec = tsk_null;
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ (tmedia_session_mgr_get(m_pWrappedMgr,
+ TMEDIA_SESSION_PRODUCER_GET_POBJECT(_media, "codec", &_codec),
+ TMEDIA_SESSION_GET_NULL()));
- if(_codec){
- Codec* pCodec = new Codec(_codec);
- TSK_OBJECT_SAFE_FREE(_codec);
- return pCodec;
- }
- return tsk_null;
+ if(_codec) {
+ Codec* pCodec = new Codec(_codec);
+ TSK_OBJECT_SAFE_FREE(_codec);
+ return pCodec;
+ }
+ return NULL;
}
#include "tinydav/audio/tdav_session_audio.h"
@@ -181,379 +240,426 @@ Codec* MediaSessionMgr::producerGetCodec(twrap_media_type_t media)
const ProxyPlugin* MediaSessionMgr::findProxyPlugin(twrap_media_type_t media, bool consumer)const
{
- const ProxyPlugin* plugin = tsk_null;
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
-
- if(media != twrap_media_audio && media != twrap_media_video){
- TSK_DEBUG_ERROR("Invalid media type");
- return tsk_null;
- }
-
- if(manager && m_pWrappedMgr){
- tmedia_type_t _media = twrap_get_native_media_type(media);
- tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
- if(session){
- if(session->plugin == tdav_session_audio_plugin_def_t){
- if(consumer){
- plugin = manager->findPlugin(TDAV_SESSION_AV(session)->consumer);
- }
- else{
- plugin = manager->findPlugin(TDAV_SESSION_AV(session)->producer);
- }
- }
- else if(session->plugin == tdav_session_video_plugin_def_t){
- if(consumer){
- plugin = manager->findPlugin(TDAV_SESSION_AV(session)->consumer);
- }
- else{
- plugin = manager->findPlugin(TDAV_SESSION_AV(session)->producer);
- }
- }
- else{
- TSK_DEBUG_ERROR("Unknown session with media type = %d", _media);
- }
- tsk_object_unref(session);
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid state");
- }
-
- return plugin;
+ const ProxyPlugin* plugin = tsk_null;
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+
+ if(media != twrap_media_audio && media != twrap_media_video) {
+ TSK_DEBUG_ERROR("Invalid media type");
+ return tsk_null;
+ }
+
+ if(manager && m_pWrappedMgr) {
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
+ if(session) {
+ if(session->plugin == tdav_session_audio_plugin_def_t) {
+ if(consumer) {
+ plugin = manager->findPlugin(TDAV_SESSION_AV(session)->consumer);
+ }
+ else {
+ plugin = manager->findPlugin(TDAV_SESSION_AV(session)->producer);
+ }
+ }
+ else if(session->plugin == tdav_session_video_plugin_def_t) {
+ if(consumer) {
+ plugin = manager->findPlugin(TDAV_SESSION_AV(session)->consumer);
+ }
+ else {
+ plugin = manager->findPlugin(TDAV_SESSION_AV(session)->producer);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Unknown session with media type = %d", _media);
+ }
+ tsk_object_unref(session);
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid state");
+ }
+
+ return plugin;
}
// FIXME: create generic function to register any kind and number of plugin from a file
unsigned int MediaSessionMgr::registerAudioPluginFromFile(const char* path)
{
- static struct tsk_plugin_s* __plugin = tsk_null;
- if(__plugin){
- TSK_DEBUG_ERROR("Audio plugin already registered");
- return 0;
- }
- if((__plugin = tsk_plugin_create(path))){
- unsigned int count = 0;
- tsk_plugin_def_ptr_const_t plugin_def_ptr_const;
- if((plugin_def_ptr_const = tsk_plugin_get_def(__plugin, tsk_plugin_def_type_consumer, tsk_plugin_def_media_type_audio))){
- if(tmedia_consumer_plugin_register((const tmedia_consumer_plugin_def_t*)plugin_def_ptr_const) == 0){
- ++count;
- }
- }
- if((plugin_def_ptr_const = tsk_plugin_get_def(__plugin, tsk_plugin_def_type_producer, tsk_plugin_def_media_type_audio))){
- if(tmedia_producer_plugin_register((const tmedia_producer_plugin_def_t*)plugin_def_ptr_const) == 0){
- ++count;
- }
- }
- return count;
- }
- TSK_DEBUG_ERROR("Failed to create plugin with path=%s", path);
- return 0;
+ static struct tsk_plugin_s* __plugin = tsk_null;
+ if(__plugin) {
+ TSK_DEBUG_ERROR("Audio plugin already registered");
+ return 0;
+ }
+ if((__plugin = tsk_plugin_create(path))) {
+ unsigned int count = 0;
+ tsk_plugin_def_ptr_const_t plugin_def_ptr_const;
+ if((plugin_def_ptr_const = tsk_plugin_get_def(__plugin, tsk_plugin_def_type_consumer, tsk_plugin_def_media_type_audio))) {
+ if(tmedia_consumer_plugin_register((const tmedia_consumer_plugin_def_t*)plugin_def_ptr_const) == 0) {
+ ++count;
+ }
+ }
+ if((plugin_def_ptr_const = tsk_plugin_get_def(__plugin, tsk_plugin_def_type_producer, tsk_plugin_def_media_type_audio))) {
+ if(tmedia_producer_plugin_register((const tmedia_producer_plugin_def_t*)plugin_def_ptr_const) == 0) {
+ ++count;
+ }
+ }
+ return count;
+ }
+ TSK_DEBUG_ERROR("Failed to create plugin with path=%s", path);
+ return 0;
}
uint64_t MediaSessionMgr::getSessionId(twrap_media_type_t media)const
{
- //const ProxyPlugin* plugin = tsk_null;
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- uint64_t id = 0;
+ //const ProxyPlugin* plugin = tsk_null;
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ uint64_t id = 0;
- if (media != twrap_media_audio && media != twrap_media_video) {
- TSK_DEBUG_ERROR("Invalid media type");
- return 0;
- }
+ if (media != twrap_media_audio && media != twrap_media_video) {
+ TSK_DEBUG_ERROR("Invalid media type");
+ return 0;
+ }
- if (manager && m_pWrappedMgr) {
- tmedia_type_t _media = twrap_get_native_media_type(media);
- tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
- if (session) {
- id = session->id;
- }
- tsk_object_unref(session);
- }
- else {
- TSK_DEBUG_ERROR("Invalid state");
- }
+ if (manager && m_pWrappedMgr) {
+ tmedia_type_t _media = twrap_get_native_media_type(media);
+ tmedia_session_t* session = tmedia_session_mgr_find(m_pWrappedMgr, _media);
+ if (session) {
+ id = session->id;
+ }
+ tsk_object_unref(session);
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid state");
+ }
- return id;
+ return id;
}
bool MediaSessionMgr::defaultsSetProfile(tmedia_profile_t profile)
{
- return (tmedia_defaults_set_profile(profile) == 0);
+ return (tmedia_defaults_set_profile(profile) == 0);
}
tmedia_profile_t MediaSessionMgr::defaultsGetProfile()
{
- return tmedia_defaults_get_profile();
+ return tmedia_defaults_get_profile();
}
bool MediaSessionMgr::defaultsSetBandwidthLevel(tmedia_bandwidth_level_t bl) // @deprecated
{
- return tmedia_defaults_set_bl(bl) == 0;
+ return tmedia_defaults_set_bl(bl) == 0;
}
tmedia_bandwidth_level_t MediaSessionMgr::defaultsGetBandwidthLevel() // @deprecated
{
- return tmedia_defaults_get_bl();
+ return tmedia_defaults_get_bl();
}
bool MediaSessionMgr::defaultsSetCongestionCtrlEnabled(bool enabled)
{
- return tmedia_defaults_set_congestion_ctrl_enabled(enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_congestion_ctrl_enabled(enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsSetVideoMotionRank(int32_t video_motion_rank)
{
- return (tmedia_defaults_set_video_motion_rank(video_motion_rank) == 0);
+ return (tmedia_defaults_set_video_motion_rank(video_motion_rank) == 0);
}
bool MediaSessionMgr::defaultsSetVideoFps(int32_t video_fps)
{
- return (tmedia_defaults_set_video_fps(video_fps) == 0);
+ return (tmedia_defaults_set_video_fps(video_fps) == 0);
}
bool MediaSessionMgr::defaultsSetBandwidthVideoUploadMax(int32_t bw_video_up_max_kbps)
{
- return (tmedia_defaults_set_bandwidth_video_upload_max(bw_video_up_max_kbps) == 0);
+ return (tmedia_defaults_set_bandwidth_video_upload_max(bw_video_up_max_kbps) == 0);
}
bool MediaSessionMgr::defaultsSetBandwidthVideoDownloadMax(int32_t bw_video_down_max_kbps)
{
- return (tmedia_defaults_set_bandwidth_video_download_max(bw_video_down_max_kbps) == 0);
+ return (tmedia_defaults_set_bandwidth_video_download_max(bw_video_down_max_kbps) == 0);
}
bool MediaSessionMgr::defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_video_size)
{
- return tmedia_defaults_set_pref_video_size(pref_video_size) == 0;
+ return tmedia_defaults_set_pref_video_size(pref_video_size) == 0;
+}
+
+bool MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max)
+{
+ return tmedia_defaults_set_pref_video_size_range(min, max) == 0;
+}
+
+bool MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled)
+{
+ return tmedia_defaults_set_adapt_video_size_range_enabled(enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsSetJbMargin(uint32_t jb_margin_ms)
{
- return tmedia_defaults_set_jb_margin(jb_margin_ms) == 0;
+ return tmedia_defaults_set_jb_margin(jb_margin_ms) == 0;
}
bool MediaSessionMgr::defaultsSetJbMaxLateRate(uint32_t jb_late_rate_percent)
{
- return tmedia_defaults_set_jb_max_late_rate(jb_late_rate_percent) == 0;
+ return tmedia_defaults_set_jb_max_late_rate(jb_late_rate_percent) == 0;
}
bool MediaSessionMgr::defaultsSetEchoTail(uint32_t echo_tail)
{
- return tmedia_defaults_set_echo_tail(echo_tail) == 0;
+ return tmedia_defaults_set_echo_tail(echo_tail) == 0;
}
uint32_t MediaSessionMgr::defaultsGetEchoTail()
{
- return tmedia_defaults_get_echo_tail();
+ return tmedia_defaults_get_echo_tail();
}
bool MediaSessionMgr::defaultsSetEchoSkew(uint32_t echo_skew)
{
- return tmedia_defaults_set_echo_skew(echo_skew) == 0;
+ return tmedia_defaults_set_echo_skew(echo_skew) == 0;
}
bool MediaSessionMgr::defaultsSetEchoSuppEnabled(bool echo_supp_enabled)
{
- return tmedia_defaults_set_echo_supp_enabled(echo_supp_enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_echo_supp_enabled(echo_supp_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetEchoSuppEnabled()
{
- return tmedia_defaults_get_echo_supp_enabled() ? true : false;
+ return tmedia_defaults_get_echo_supp_enabled() ? true : false;
}
bool MediaSessionMgr::defaultsSetAgcEnabled(bool agc_enabled)
{
- return tmedia_defaults_set_agc_enabled(agc_enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_agc_enabled(agc_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetAgcEnabled()
{
- return tmedia_defaults_get_agc_enabled() ? true : false;
+ return tmedia_defaults_get_agc_enabled() ? true : false;
}
bool MediaSessionMgr::defaultsSetAgcLevel(float agc_level)
{
- return tmedia_defaults_set_agc_level(agc_level) == 0;
+ return tmedia_defaults_set_agc_level(agc_level) == 0;
}
float MediaSessionMgr::defaultsGetAgcLevel()
{
- return tmedia_defaults_get_agc_level();
+ return tmedia_defaults_get_agc_level();
}
bool MediaSessionMgr::defaultsSetVadEnabled(bool vad_enabled)
{
- return tmedia_defaults_set_vad_enabled(vad_enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_vad_enabled(vad_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetGetVadEnabled()
{
- return tmedia_defaults_get_vad_enabled() ? true : false;
+ return tmedia_defaults_get_vad_enabled() ? true : false;
}
bool MediaSessionMgr::defaultsSetNoiseSuppEnabled(bool noise_supp_enabled)
{
- return tmedia_defaults_set_noise_supp_enabled(noise_supp_enabled ? tsk_true : tsk_false) == 0;
+ return tmedia_defaults_set_noise_supp_enabled(noise_supp_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetNoiseSuppEnabled()
{
- return tmedia_defaults_get_noise_supp_enabled() ? true : false;
+ return tmedia_defaults_get_noise_supp_enabled() ? true : false;
}
bool MediaSessionMgr::defaultsSetNoiseSuppLevel(int32_t noise_supp_level)
{
- return tmedia_defaults_set_noise_supp_level(noise_supp_level) == 0;
+ return tmedia_defaults_set_noise_supp_level(noise_supp_level) == 0;
}
int32_t MediaSessionMgr::defaultsGetNoiseSuppLevel()
{
- return tmedia_defaults_get_noise_supp_level();
+ return tmedia_defaults_get_noise_supp_level();
}
-bool MediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled){
- return tmedia_defaults_set_100rel_enabled(_100rel_enabled ? tsk_true : tsk_false) == 0;
+bool MediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
+{
+ return tmedia_defaults_set_100rel_enabled(_100rel_enabled ? tsk_true : tsk_false) == 0;
}
-bool MediaSessionMgr::defaultsGet100relEnabled(){
- return tmedia_defaults_get_100rel_enabled() == 0;
+bool MediaSessionMgr::defaultsGet100relEnabled()
+{
+ return tmedia_defaults_get_100rel_enabled() == 0;
}
-bool MediaSessionMgr::defaultsSetScreenSize(int32_t sx, int32_t sy){
- return tmedia_defaults_set_screen_size(sx, sy) == 0;
+bool MediaSessionMgr::defaultsSetScreenSize(int32_t sx, int32_t sy)
+{
+ return tmedia_defaults_set_screen_size(sx, sy) == 0;
}
-bool MediaSessionMgr::defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain){
- return tmedia_defaults_set_audio_gain(producer_gain, consumer_gain) == 0;
+bool MediaSessionMgr::defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain)
+{
+ return tmedia_defaults_set_audio_gain(producer_gain, consumer_gain) == 0;
}
-bool MediaSessionMgr::defaultsSetAudioPtime(int32_t ptime){
- return tmedia_defaults_set_audio_ptime(ptime) == 0;
+bool MediaSessionMgr::defaultsSetAudioPtime(int32_t ptime)
+{
+ return tmedia_defaults_set_audio_ptime(ptime) == 0;
}
-bool MediaSessionMgr::defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record){
- return tmedia_defaults_set_audio_channels(channel_playback, channel_record) == 0;
+bool MediaSessionMgr::defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record)
+{
+ return tmedia_defaults_set_audio_channels(channel_playback, channel_record) == 0;
}
-bool MediaSessionMgr::defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop){
- return tmedia_defaults_set_rtp_port_range(range_start, range_stop) == 0;
+bool MediaSessionMgr::defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop)
+{
+ return tmedia_defaults_set_rtp_port_range(range_start, range_stop) == 0;
}
-bool MediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled){
- return tmedia_defaults_set_rtp_symetric_enabled(enabled ? tsk_true : tsk_false) == 0;
+bool MediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled)
+{
+ return tmedia_defaults_set_rtp_symetric_enabled(enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsSetMediaType(twrap_media_type_t media_type)
{
- return (tmedia_defaults_set_media_type(twrap_get_native_media_type(media_type)) == 0);
+ return (tmedia_defaults_set_media_type(twrap_get_native_media_type(media_type)) == 0);
}
bool MediaSessionMgr::defaultsSetVolume(int32_t volume)
{
- return (tmedia_defaults_set_volume(volume) == 0);
+ return (tmedia_defaults_set_volume(volume) == 0);
}
int32_t MediaSessionMgr::defaultsGetVolume()
{
- return tmedia_defaults_get_volume();
+ return tmedia_defaults_get_volume();
}
bool MediaSessionMgr::defaultsSetInviteSessionTimers(int32_t timeout, const char* refresher)
{
- int ret = tmedia_defaults_set_inv_session_expires(timeout);
- ret &= tmedia_defaults_set_inv_session_refresher(refresher);
- return (ret == 0);
+ int ret = tmedia_defaults_set_inv_session_expires(timeout);
+ ret &= tmedia_defaults_set_inv_session_refresher(refresher);
+ return (ret == 0);
}
-bool MediaSessionMgr::defaultsSetSRtpMode(tmedia_srtp_mode_t mode){
- return (tmedia_defaults_set_srtp_mode(mode) == 0);
+bool MediaSessionMgr::defaultsSetSRtpMode(tmedia_srtp_mode_t mode)
+{
+ return (tmedia_defaults_set_srtp_mode(mode) == 0);
}
-tmedia_srtp_mode_t MediaSessionMgr::defaultsGetSRtpMode(){
- return tmedia_defaults_get_srtp_mode();
+tmedia_srtp_mode_t MediaSessionMgr::defaultsGetSRtpMode()
+{
+ return tmedia_defaults_get_srtp_mode();
}
-bool MediaSessionMgr::defaultsSetSRtpType(tmedia_srtp_type_t srtp_type){
- return (tmedia_defaults_set_srtp_type(srtp_type) == 0);
+bool MediaSessionMgr::defaultsSetSRtpType(tmedia_srtp_type_t srtp_type)
+{
+ return (tmedia_defaults_set_srtp_type(srtp_type) == 0);
}
-tmedia_srtp_type_t MediaSessionMgr::defaultsGetSRtpType(){
- return tmedia_defaults_get_srtp_type();
+tmedia_srtp_type_t MediaSessionMgr::defaultsGetSRtpType()
+{
+ return tmedia_defaults_get_srtp_type();
}
-bool MediaSessionMgr::defaultsSetRtcpEnabled(bool enabled){
- return (tmedia_defaults_set_rtcp_enabled(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetRtcpEnabled(bool enabled)
+{
+ return (tmedia_defaults_set_rtcp_enabled(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetRtcpEnabled(){
- return (tmedia_defaults_get_rtcp_enabled() == tsk_true);
+bool MediaSessionMgr::defaultsGetRtcpEnabled()
+{
+ return (tmedia_defaults_get_rtcp_enabled() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled){
- return (tmedia_defaults_set_rtcpmux_enabled(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled)
+{
+ return (tmedia_defaults_set_rtcpmux_enabled(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetRtcpMuxEnabled(){
- return (tmedia_defaults_get_rtcpmux_enabled() == tsk_true);
+bool MediaSessionMgr::defaultsGetRtcpMuxEnabled()
+{
+ return (tmedia_defaults_get_rtcpmux_enabled() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetStunEnabled(bool stun_enabled){
- return (tmedia_defaults_set_stun_enabled(stun_enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetStunEnabled(bool stun_enabled)
+{
+ return (tmedia_defaults_set_stun_enabled(stun_enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsSetIceStunEnabled(bool icestun_enabled){
- return (tmedia_defaults_set_icestun_enabled(icestun_enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetIceStunEnabled(bool icestun_enabled)
+{
+ return (tmedia_defaults_set_icestun_enabled(icestun_enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsSetIceTurnEnabled(bool iceturn_enabled){
- return (tmedia_defaults_set_iceturn_enabled(iceturn_enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetIceTurnEnabled(bool iceturn_enabled)
+{
+ return (tmedia_defaults_set_iceturn_enabled(iceturn_enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsSetStunServer(const char* server_ip, uint16_t server_port){
- return (tmedia_defaults_set_stun_server(server_ip, server_port) == 0);
+bool MediaSessionMgr::defaultsSetStunServer(const char* server_ip, uint16_t server_port)
+{
+ return (tmedia_defaults_set_stun_server(server_ip, server_port) == 0);
}
-bool MediaSessionMgr::defaultsSetStunCred(const char* username, const char* password){
- return (tmedia_defaults_set_stun_cred(username, password) == 0);
+bool MediaSessionMgr::defaultsSetStunCred(const char* username, const char* password)
+{
+ return (tmedia_defaults_set_stun_cred(username, password) == 0);
}
-bool MediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled){
- return (tmedia_defaults_set_ice_enabled(ice_enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled)
+{
+ return (tmedia_defaults_set_ice_enabled(ice_enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsSetByPassEncoding(bool enabled){
- return (tmedia_defaults_set_bypass_encoding(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetByPassEncoding(bool enabled)
+{
+ return (tmedia_defaults_set_bypass_encoding(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetByPassEncoding(){
- return (tmedia_defaults_get_bypass_encoding() == tsk_true);
+bool MediaSessionMgr::defaultsGetByPassEncoding()
+{
+ return (tmedia_defaults_get_bypass_encoding() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetByPassDecoding(bool enabled){
- return (tmedia_defaults_set_bypass_decoding(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetByPassDecoding(bool enabled)
+{
+ return (tmedia_defaults_set_bypass_decoding(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetByPassDecoding(){
- return (tmedia_defaults_get_bypass_decoding() == tsk_true);
+bool MediaSessionMgr::defaultsGetByPassDecoding()
+{
+ return (tmedia_defaults_get_bypass_decoding() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled){
- return (tmedia_defaults_set_videojb_enabled(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled)
+{
+ return (tmedia_defaults_set_videojb_enabled(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetVideoJbEnabled(){
- return (tmedia_defaults_get_videojb_enabled() == tsk_true);
+bool MediaSessionMgr::defaultsGetVideoJbEnabled()
+{
+ return (tmedia_defaults_get_videojb_enabled() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetVideoZeroArtifactsEnabled(bool enabled){
- return (tmedia_defaults_set_video_zeroartifacts_enabled(enabled ? tsk_true : tsk_false) == 0);
+bool MediaSessionMgr::defaultsSetVideoZeroArtifactsEnabled(bool enabled)
+{
+ return (tmedia_defaults_set_video_zeroartifacts_enabled(enabled ? tsk_true : tsk_false) == 0);
}
-bool MediaSessionMgr::defaultsGetVideoZeroArtifactsEnabled(){
- return (tmedia_defaults_get_video_zeroartifacts_enabled() == tsk_true);
+bool MediaSessionMgr::defaultsGetVideoZeroArtifactsEnabled()
+{
+ return (tmedia_defaults_get_video_zeroartifacts_enabled() == tsk_true);
}
-bool MediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize){
- return (tmedia_defaults_set_rtpbuff_size(buffSize) == 0);
+bool MediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize)
+{
+ return (tmedia_defaults_set_rtpbuff_size(buffSize) == 0);
}
-unsigned MediaSessionMgr::defaultsGetRtpBuffSize(){
- return tmedia_defaults_get_rtpbuff_size();
+unsigned MediaSessionMgr::defaultsGetRtpBuffSize()
+{
+ return tmedia_defaults_get_rtpbuff_size();
}
-bool MediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max){
- return (tmedia_defaults_set_avpf_tail(tail_min, tail_max) == 0);
+bool MediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max)
+{
+ return (tmedia_defaults_set_avpf_tail(tail_min, tail_max) == 0);
}
-bool MediaSessionMgr::defaultsSetAvpfMode(enum tmedia_mode_e mode){
- return (tmedia_defaults_set_avpf_mode(mode) == 0);
+bool MediaSessionMgr::defaultsSetAvpfMode(enum tmedia_mode_e mode)
+{
+ return (tmedia_defaults_set_avpf_mode(mode) == 0);
}
-bool MediaSessionMgr::defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate){
- return (tmedia_defaults_set_opus_maxcapturerate(opus_maxcapturerate) == 0);
+bool MediaSessionMgr::defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate)
+{
+ return (tmedia_defaults_set_opus_maxcapturerate(opus_maxcapturerate) == 0);
}
-bool MediaSessionMgr::defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate){
- return (tmedia_defaults_set_opus_maxplaybackrate(opus_maxplaybackrate) == 0);
+bool MediaSessionMgr::defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate)
+{
+ return (tmedia_defaults_set_opus_maxplaybackrate(opus_maxplaybackrate) == 0);
}
-bool MediaSessionMgr::defaultsSetMaxFds(int32_t max_fds) {
- return (tmedia_defaults_set_max_fds(max_fds) == 0);
+bool MediaSessionMgr::defaultsSetMaxFds(int32_t max_fds)
+{
+ return (tmedia_defaults_set_max_fds(max_fds) == 0);
} \ No newline at end of file
diff --git a/bindings/_common/MediaSessionMgr.h b/bindings/_common/MediaSessionMgr.h
index 5c28769..c4f52be 100755
--- a/bindings/_common/MediaSessionMgr.h
+++ b/bindings/_common/MediaSessionMgr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -28,142 +28,219 @@
#include "Common.h"
class ProxyPlugin;
+class MediaSessionMgr;
+
+class TINYWRAP_API QoS
+{
+ friend class MediaSessionMgr;
+public:
+#if !defined(SWIG)
+ QoS(float qavg, float q1 = -1.f, float q2 = -1.f, float q3 = -1.f, float q4 = -1.f, float q5 = -1.f);
+#endif
+ virtual ~QoS();
+ float getQavg() {
+ return m_Qqvg;
+ }
+ float getQ1() {
+ return m_Qn[0];
+ }
+ float getQ2() {
+ return m_Qn[1];
+ }
+ float getQ3() {
+ return m_Qn[2];
+ }
+ float getQ4() {
+ return m_Qn[3];
+ }
+ float getQ5() {
+ return m_Qn[4];
+ }
+ unsigned getVideoInWidth() {
+ return m_VideoInWidth;
+ }
+ unsigned getVideoOutWidth() {
+ return m_VideoOutWidth;
+ }
+ unsigned getVideoInHeight() {
+ return m_VideoInHeight;
+ }
+ unsigned getVideoOutHeight() {
+ return m_VideoOutHeight;
+ }
+ unsigned getBandwidthDownKbps() {
+ return m_BandwidthDownKbps;
+ }
+ unsigned getBandwidthUpKbps() {
+ return m_BandwidthUpKbps;
+ }
+ unsigned getVideoInAvgFps() {
+ return m_VideoInAvgFps;
+ }
+ unsigned getVideoDecAvgTime() { // In millis
+ return m_VideoDecAvgTime;
+ }
+ unsigned getVideoEncAvgTime() { // In millis
+ return m_VideoEncAvgTime;
+ }
+private:
+ float m_Qqvg;
+ float m_Qn[5];
+ unsigned m_VideoInWidth;
+ unsigned m_VideoOutWidth;
+ unsigned m_VideoInHeight;
+ unsigned m_VideoOutHeight;
+ unsigned m_BandwidthDownKbps;
+ unsigned m_BandwidthUpKbps;
+ unsigned m_VideoInAvgFps;
+ unsigned m_VideoDecAvgTime;
+ unsigned m_VideoEncAvgTime;
+};
class TINYWRAP_API Codec
{
public:
#if !defined(SWIG)
- Codec(const struct tmedia_codec_s* pWrappedCodec);
+ Codec(const struct tmedia_codec_s* pWrappedCodec);
#endif
- virtual ~Codec();
+ virtual ~Codec();
public:
#if !defined(SWIG)
- const struct tmedia_codec_s* getWrappedCodec(){ return m_pWrappedCodec; }
- inline bool isOpened(){ return (m_pWrappedCodec && (m_pWrappedCodec->opened == tsk_true)); }
+ const struct tmedia_codec_s* getWrappedCodec() {
+ return m_pWrappedCodec;
+ }
+ inline bool isOpened() {
+ return (m_pWrappedCodec && (m_pWrappedCodec->opened == tsk_true));
+ }
#endif
- twrap_media_type_t getMediaType();
- const char* getName();
- const char* getDescription();
- const char* getNegFormat();
- int getAudioSamplingRate();
- int getAudioChannels();
- int getAudioPTime();
+ twrap_media_type_t getMediaType();
+ const char* getName();
+ const char* getDescription();
+ const char* getNegFormat();
+ int getAudioSamplingRate();
+ int getAudioChannels();
+ int getAudioPTime();
private:
- struct tmedia_codec_s* m_pWrappedCodec;
+ struct tmedia_codec_s* m_pWrappedCodec;
};
class TINYWRAP_API MediaSessionMgr
{
public:
#if !defined(SWIG)
- MediaSessionMgr(tmedia_session_mgr_t* pWrappedMgr);
+ MediaSessionMgr(tmedia_session_mgr_t* pWrappedMgr);
#endif
- virtual ~MediaSessionMgr();
+ virtual ~MediaSessionMgr();
public:
- bool sessionSetInt32(twrap_media_type_t media, const char* key, int32_t value);
- int32_t sessionGetInt32(twrap_media_type_t media, const char* key);
+ bool sessionSetInt32(twrap_media_type_t media, const char* key, int32_t value);
+ int32_t sessionGetInt32(twrap_media_type_t media, const char* key);
+ QoS* sessionGetQoS(twrap_media_type_t media);
- bool consumerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
- bool consumerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
+ bool consumerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
+ bool consumerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
- bool producerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
- bool producerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
- Codec* producerGetCodec(twrap_media_type_t media);
+ bool producerSetInt32(twrap_media_type_t media, const char* key, int32_t value);
+ bool producerSetInt64(twrap_media_type_t media, const char* key, int64_t value);
+ Codec* producerGetCodec(twrap_media_type_t media);
#if !defined(SWIG)
- const ProxyPlugin* findProxyPlugin(twrap_media_type_t media, bool consumer)const;
+ const ProxyPlugin* findProxyPlugin(twrap_media_type_t media, bool consumer)const;
#endif
- const ProxyPlugin* findProxyPluginConsumer(twrap_media_type_t media)const{
- return this->findProxyPlugin(media, true);
- }
- const ProxyPlugin* findProxyPluginProducer(twrap_media_type_t media)const{
- return this->findProxyPlugin(media, false);
- }
+ const ProxyPlugin* findProxyPluginConsumer(twrap_media_type_t media)const {
+ return this->findProxyPlugin(media, true);
+ }
+ const ProxyPlugin* findProxyPluginProducer(twrap_media_type_t media)const {
+ return this->findProxyPlugin(media, false);
+ }
- static unsigned int registerAudioPluginFromFile(const char* path);
+ static unsigned int registerAudioPluginFromFile(const char* path);
- uint64_t getSessionId(twrap_media_type_t media)const;
+ uint64_t getSessionId(twrap_media_type_t media)const;
#if !defined(SWIG)
- inline const tmedia_session_mgr_t* getWrappedMgr()const { return m_pWrappedMgr; }
+ inline const tmedia_session_mgr_t* getWrappedMgr()const {
+ return m_pWrappedMgr;
+ }
#endif
-
- // Defaults
- static bool defaultsSetProfile(tmedia_profile_t profile);
- static tmedia_profile_t defaultsGetProfile();
- static bool defaultsSetBandwidthLevel(tmedia_bandwidth_level_t bl); // @deprecated
- static tmedia_bandwidth_level_t defaultsGetBandwidthLevel(); // @deprecated
- static bool defaultsSetCongestionCtrlEnabled(bool enabled);
- static bool defaultsSetVideoMotionRank(int32_t video_motion_rank);
- static bool defaultsSetVideoFps(int32_t video_fps);
- static bool defaultsSetBandwidthVideoUploadMax(int32_t bw_video_up_max_kbps);
- static bool defaultsSetBandwidthVideoDownloadMax(int32_t bw_video_down_max_kbps);
- static bool defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_video_size);
- static bool defaultsSetJbMargin(uint32_t jb_margin_ms);
- static bool defaultsSetJbMaxLateRate(uint32_t jb_late_rate_percent);
- static bool defaultsSetEchoTail(uint32_t echo_tail);
- static uint32_t defaultsGetEchoTail();
- static bool defaultsSetEchoSkew(uint32_t echo_skew);
- static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
- static bool defaultsGetEchoSuppEnabled();
- static bool defaultsSetAgcEnabled(bool agc_enabled);
- static bool defaultsGetAgcEnabled();
- static bool defaultsSetAgcLevel(float agc_level);
- static float defaultsGetAgcLevel();
- static bool defaultsSetVadEnabled(bool vad_enabled);
- static bool defaultsGetGetVadEnabled();
- static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
- static bool defaultsGetNoiseSuppEnabled();
- static bool defaultsSetNoiseSuppLevel(int32_t noise_supp_level);
- static int32_t defaultsGetNoiseSuppLevel();
- static bool defaultsSet100relEnabled(bool _100rel_enabled);
- static bool defaultsGet100relEnabled();
- static bool defaultsSetScreenSize(int32_t sx, int32_t sy);
- static bool defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain);
- static bool defaultsSetAudioPtime(int32_t ptime);
- static bool defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record);
- static bool defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop);
- static bool defaultsSetRtpSymetricEnabled(bool enabled);
- static bool defaultsSetMediaType(twrap_media_type_t media_type);
- static bool defaultsSetVolume(int32_t volume);
- static int32_t defaultsGetVolume();
- static bool defaultsSetInviteSessionTimers(int32_t timeout, const char* refresher);
- static bool defaultsSetSRtpMode(tmedia_srtp_mode_t mode);
- static tmedia_srtp_mode_t defaultsGetSRtpMode();
- static bool defaultsSetSRtpType(tmedia_srtp_type_t srtp_type);
- static tmedia_srtp_type_t defaultsGetSRtpType();
- static bool defaultsSetRtcpEnabled(bool enabled);
- static bool defaultsGetRtcpEnabled();
- static bool defaultsSetRtcpMuxEnabled(bool enabled);
- static bool defaultsGetRtcpMuxEnabled();
- static bool defaultsSetStunEnabled(bool stun_enabled);
- static bool defaultsSetIceStunEnabled(bool icestun_enabled);
- static bool defaultsSetIceTurnEnabled(bool iceturn_enabled);
- static bool defaultsSetStunServer(const char* server_ip, uint16_t server_port);
- static bool defaultsSetStunCred(const char* username, const char* password);
- static bool defaultsSetIceEnabled(bool ice_enabled);
- static bool defaultsSetByPassEncoding(bool enabled);
- static bool defaultsGetByPassEncoding();
- static bool defaultsSetByPassDecoding(bool enabled);
- static bool defaultsGetByPassDecoding();
- static bool defaultsSetVideoJbEnabled(bool enabled);
- static bool defaultsGetVideoJbEnabled();
- static bool defaultsSetVideoZeroArtifactsEnabled(bool enabled);
- static bool defaultsGetVideoZeroArtifactsEnabled();
- static bool defaultsSetRtpBuffSize(unsigned buffSize);
- static unsigned defaultsGetRtpBuffSize();
- static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
- static bool defaultsSetAvpfMode(enum tmedia_mode_e mode);
- static bool defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate);
- static bool defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate);
- static bool defaultsSetMaxFds(int32_t max_fds);
+
+ // Defaults
+ static bool defaultsSetProfile(tmedia_profile_t profile);
+ static tmedia_profile_t defaultsGetProfile();
+ static bool defaultsSetBandwidthLevel(tmedia_bandwidth_level_t bl); // @deprecated
+ static tmedia_bandwidth_level_t defaultsGetBandwidthLevel(); // @deprecated
+ static bool defaultsSetCongestionCtrlEnabled(bool enabled);
+ static bool defaultsSetVideoMotionRank(int32_t video_motion_rank);
+ static bool defaultsSetVideoFps(int32_t video_fps);
+ static bool defaultsSetBandwidthVideoUploadMax(int32_t bw_video_up_max_kbps);
+ static bool defaultsSetBandwidthVideoDownloadMax(int32_t bw_video_down_max_kbps);
+ static bool defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_video_size);
+ static bool defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max);
+ static bool defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled);
+ static bool defaultsSetJbMargin(uint32_t jb_margin_ms);
+ static bool defaultsSetJbMaxLateRate(uint32_t jb_late_rate_percent);
+ static bool defaultsSetEchoTail(uint32_t echo_tail);
+ static uint32_t defaultsGetEchoTail();
+ static bool defaultsSetEchoSkew(uint32_t echo_skew);
+ static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
+ static bool defaultsGetEchoSuppEnabled();
+ static bool defaultsSetAgcEnabled(bool agc_enabled);
+ static bool defaultsGetAgcEnabled();
+ static bool defaultsSetAgcLevel(float agc_level);
+ static float defaultsGetAgcLevel();
+ static bool defaultsSetVadEnabled(bool vad_enabled);
+ static bool defaultsGetGetVadEnabled();
+ static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
+ static bool defaultsGetNoiseSuppEnabled();
+ static bool defaultsSetNoiseSuppLevel(int32_t noise_supp_level);
+ static int32_t defaultsGetNoiseSuppLevel();
+ static bool defaultsSet100relEnabled(bool _100rel_enabled);
+ static bool defaultsGet100relEnabled();
+ static bool defaultsSetScreenSize(int32_t sx, int32_t sy);
+ static bool defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain);
+ static bool defaultsSetAudioPtime(int32_t ptime);
+ static bool defaultsSetAudioChannels(int32_t channel_playback, int32_t channel_record);
+ static bool defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop);
+ static bool defaultsSetRtpSymetricEnabled(bool enabled);
+ static bool defaultsSetMediaType(twrap_media_type_t media_type);
+ static bool defaultsSetVolume(int32_t volume);
+ static int32_t defaultsGetVolume();
+ static bool defaultsSetInviteSessionTimers(int32_t timeout, const char* refresher);
+ static bool defaultsSetSRtpMode(tmedia_srtp_mode_t mode);
+ static tmedia_srtp_mode_t defaultsGetSRtpMode();
+ static bool defaultsSetSRtpType(tmedia_srtp_type_t srtp_type);
+ static tmedia_srtp_type_t defaultsGetSRtpType();
+ static bool defaultsSetRtcpEnabled(bool enabled);
+ static bool defaultsGetRtcpEnabled();
+ static bool defaultsSetRtcpMuxEnabled(bool enabled);
+ static bool defaultsGetRtcpMuxEnabled();
+ static bool defaultsSetStunEnabled(bool stun_enabled);
+ static bool defaultsSetIceStunEnabled(bool icestun_enabled);
+ static bool defaultsSetIceTurnEnabled(bool iceturn_enabled);
+ static bool defaultsSetStunServer(const char* server_ip, uint16_t server_port);
+ static bool defaultsSetStunCred(const char* username, const char* password);
+ static bool defaultsSetIceEnabled(bool ice_enabled);
+ static bool defaultsSetByPassEncoding(bool enabled);
+ static bool defaultsGetByPassEncoding();
+ static bool defaultsSetByPassDecoding(bool enabled);
+ static bool defaultsGetByPassDecoding();
+ static bool defaultsSetVideoJbEnabled(bool enabled);
+ static bool defaultsGetVideoJbEnabled();
+ static bool defaultsSetVideoZeroArtifactsEnabled(bool enabled);
+ static bool defaultsGetVideoZeroArtifactsEnabled();
+ static bool defaultsSetRtpBuffSize(unsigned buffSize);
+ static unsigned defaultsGetRtpBuffSize();
+ static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
+ static bool defaultsSetAvpfMode(enum tmedia_mode_e mode);
+ static bool defaultsSetOpusMaxCaptureRate(uint32_t opus_maxcapturerate);
+ static bool defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackrate);
+ static bool defaultsSetMaxFds(int32_t max_fds);
private:
- tmedia_session_mgr_t* m_pWrappedMgr;
+ tmedia_session_mgr_t* m_pWrappedMgr;
};
#endif /* TINYWRAP_MEDIA_SESSIONMGR_H */
diff --git a/bindings/_common/Msrp.cxx b/bindings/_common/Msrp.cxx
index a1d0992..edb25d3 100755
--- a/bindings/_common/Msrp.cxx
+++ b/bindings/_common/Msrp.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -26,192 +26,224 @@
/* ======================== MsrpMessage ========================*/
MsrpMessage::MsrpMessage()
-:m_pMessage(tsk_null)
+ :m_pMessage(tsk_null)
{
}
MsrpMessage::MsrpMessage(tmsrp_message_t *_message)
{
- m_pMessage = (tmsrp_message_t *)tsk_object_ref(_message);
+ m_pMessage = (tmsrp_message_t *)tsk_object_ref(_message);
}
MsrpMessage::~MsrpMessage()
{
- TSK_OBJECT_SAFE_FREE(m_pMessage);
+ TSK_OBJECT_SAFE_FREE(m_pMessage);
}
bool MsrpMessage::isRequest()
{
- return (m_pMessage->type == tmsrp_request);
+ return (m_pMessage->type == tmsrp_request);
}
short MsrpMessage::getCode()
{
- return TMSRP_RESPONSE_CODE(m_pMessage);
+ return TMSRP_RESPONSE_CODE(m_pMessage);
}
const char* MsrpMessage::getPhrase()
{
- return TMSRP_RESPONSE_PHRASE(m_pMessage);
+ return TMSRP_RESPONSE_PHRASE(m_pMessage);
}
tmsrp_request_type_t MsrpMessage::getRequestType()
{
- if(TMSRP_MESSAGE_IS_REQUEST(m_pMessage)){
- return m_pMessage->line.request.type;
- }
- return tmsrp_NONE;
+ if(TMSRP_MESSAGE_IS_REQUEST(m_pMessage)) {
+ return m_pMessage->line.request.type;
+ }
+ return tmsrp_NONE;
}
void MsrpMessage::getByteRange(int64_t* start, int64_t* end, int64_t* total)
{
- if(m_pMessage->ByteRange){
- *start = m_pMessage->ByteRange->start;
- *end = m_pMessage->ByteRange->end;
- *total = m_pMessage->ByteRange->total;
- }
- else{
- *start = *end = *total = -1;
- }
+ if(m_pMessage->ByteRange) {
+ *start = m_pMessage->ByteRange->start;
+ *end = m_pMessage->ByteRange->end;
+ *total = m_pMessage->ByteRange->total;
+ }
+ else {
+ *start = *end = *total = -1;
+ }
}
bool MsrpMessage::isLastChunck()
{
- if(TMSRP_MESSAGE_IS_REQUEST(m_pMessage)){
- return (m_pMessage->end_line.cflag == '$');
- }
- else{
- if(m_pMessage->ByteRange){
- return (m_pMessage->ByteRange->end >= m_pMessage->ByteRange->total);
- }
- }
- return false;
+ if(TMSRP_MESSAGE_IS_REQUEST(m_pMessage)) {
+ return (m_pMessage->end_line.cflag == '$');
+ }
+ else {
+ if(m_pMessage->ByteRange) {
+ return (m_pMessage->ByteRange->end >= m_pMessage->ByteRange->total);
+ }
+ }
+ return false;
}
bool MsrpMessage::isSuccessReport()
{
- if(TMSRP_REQUEST_IS_REPORT(m_pMessage)){
- if(m_pMessage->Status){
- return m_pMessage->Status->code >= 200 && m_pMessage->Status->code <= 299;
- }
- }
- return false;
+ if(TMSRP_REQUEST_IS_REPORT(m_pMessage)) {
+ if(m_pMessage->Status) {
+ return m_pMessage->Status->code >= 200 && m_pMessage->Status->code <= 299;
+ }
+ }
+ return false;
}
bool MsrpMessage::isFirstChunck()
{
- return (m_pMessage && m_pMessage->ByteRange->start == 1);
+ return (m_pMessage && m_pMessage->ByteRange->start == 1);
}
char* MsrpMessage::getMsrpHeaderValue(const char* name)
{
- const tmsrp_header_t* header = this->getMsrpHeader(name, 0);
- if(header){
- return tmsrp_header_tostring(header);
- }
- return tsk_null;
+ const tmsrp_header_t* header = this->getMsrpHeader(name, 0);
+ if(header) {
+ return tmsrp_header_tostring(header);
+ }
+ return tsk_null;
}
char* MsrpMessage::getMsrpHeaderParamValue(const char* name, const char* param)
{
- return tsk_null;
+ return tsk_null;
}
unsigned MsrpMessage::getMsrpContentLength()
{
- if(m_pMessage &&
- m_pMessage->Content &&
- m_pMessage->Content->data &&
- m_pMessage->Content->size){
- return m_pMessage->Content->size;
- }
- return 0;
+ if(m_pMessage &&
+ m_pMessage->Content &&
+ m_pMessage->Content->data &&
+ m_pMessage->Content->size) {
+ return m_pMessage->Content->size;
+ }
+ return 0;
}
unsigned MsrpMessage::getMsrpContent(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
- if(!output ||
- !m_pMessage ||
- !m_pMessage->Content ||
- !m_pMessage->Content->data ||
- !m_pMessage->Content->size){
- return 0;
- }
-
-
- retsize = (m_pMessage->Content->size > maxsize) ? maxsize : m_pMessage->Content->size;
- memcpy(output, m_pMessage->Content->data, retsize);
- return retsize;
+ unsigned retsize = 0;
+ if(!output ||
+ !m_pMessage ||
+ !m_pMessage->Content ||
+ !m_pMessage->Content->data ||
+ !m_pMessage->Content->size) {
+ return 0;
+ }
+
+
+ retsize = (m_pMessage->Content->size > maxsize) ? maxsize : m_pMessage->Content->size;
+ memcpy(output, m_pMessage->Content->data, retsize);
+ return retsize;
}
const tmsrp_header_t* MsrpMessage::getMsrpHeader(const char* name, unsigned index /*= 0*/)
{
- tsk_size_t pos = 0;
- const tmsrp_header_t* hdr = tsk_null;
- const tsk_list_item_t *item;
-
- /* From tmsrp_message_get_headerAt() */
- if(!m_pMessage || !name){
- return tsk_null;
- }
-
- if(tsk_striequals(name, "To-Path")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->To;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "From-Path")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->From;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Message-ID")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->MessageID;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Byte-Range")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->ByteRange;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Failure-Report")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->FailureReport;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Success-Report")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->SuccessReport;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Status")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->Status;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "Content-Type")){
- if(index == 0){
- hdr = (const tmsrp_header_t*)m_pMessage->ContentType;
- goto bail;
- }else pos++; }
-
-
- /* All other headers */
- tsk_list_foreach(item, m_pMessage->headers){
- if(tsk_striequals(tmsrp_header_get_nameex(TMSRP_HEADER(item->data)), name)){
- if(pos++ >= index){
- hdr = (const tmsrp_header_t*)item->data;
- break;
- }
- }
- }
-
+ tsk_size_t pos = 0;
+ const tmsrp_header_t* hdr = tsk_null;
+ const tsk_list_item_t *item;
+
+ /* From tmsrp_message_get_headerAt() */
+ if(!m_pMessage || !name) {
+ return tsk_null;
+ }
+
+ if(tsk_striequals(name, "To-Path")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->To;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "From-Path")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->From;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Message-ID")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->MessageID;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Byte-Range")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->ByteRange;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Failure-Report")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->FailureReport;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Success-Report")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->SuccessReport;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Status")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->Status;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "Content-Type")) {
+ if(index == 0) {
+ hdr = (const tmsrp_header_t*)m_pMessage->ContentType;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+
+
+ /* All other headers */
+ tsk_list_foreach(item, m_pMessage->headers) {
+ if(tsk_striequals(tmsrp_header_get_nameex(TMSRP_HEADER(item->data)), name)) {
+ if(pos++ >= index) {
+ hdr = (const tmsrp_header_t*)item->data;
+ break;
+ }
+ }
+ }
+
bail:
- return hdr;
-
+ return hdr;
+
}
@@ -219,41 +251,41 @@ bail:
/* ======================== MsrpEvent ========================*/
MsrpEvent::MsrpEvent(const tmsrp_event_t *_msrpevent)
{
- this->_event = _msrpevent;
- if(this->_event && this->_event->message){
- m_pMessage = new MsrpMessage((tmsrp_message_t *)this->_event->message);
- }
- else{
- m_pMessage = tsk_null;
- }
+ this->_event = _msrpevent;
+ if(this->_event && this->_event->message) {
+ m_pMessage = new MsrpMessage((tmsrp_message_t *)this->_event->message);
+ }
+ else {
+ m_pMessage = tsk_null;
+ }
}
MsrpEvent::~MsrpEvent()
{
- if(m_pMessage){
- delete m_pMessage;
- }
+ if(m_pMessage) {
+ delete m_pMessage;
+ }
}
tmsrp_event_type_t MsrpEvent::getType()
{
- if(this->_event){
- return this->_event->type;
- }
- return tmsrp_event_type_none;
+ if(this->_event) {
+ return this->_event->type;
+ }
+ return tmsrp_event_type_none;
}
const MsrpSession* MsrpEvent::getSipSession()
{
- if(this->_event && this->_event->callback_data){
- return dyn_cast<const MsrpSession*>((const MsrpSession*)this->_event->callback_data);
- }
- return tsk_null;
+ if(this->_event && this->_event->callback_data) {
+ return dyn_cast<const MsrpSession*>((const MsrpSession*)this->_event->callback_data);
+ }
+ return tsk_null;
}
const MsrpMessage* MsrpEvent::getMessage() const
{
- return m_pMessage;
+ return m_pMessage;
}
@@ -261,23 +293,23 @@ const MsrpMessage* MsrpEvent::getMessage() const
int twrap_msrp_cb(const tmsrp_event_t* _event)
{
- const MsrpSession* session = (const MsrpSession*)_event->callback_data;
- MsrpCallback* callback;
- int ret = -1;
-
- if(session){
- if((callback = session->getCallback())){
- MsrpEvent* e = new MsrpEvent(_event);
- ret = callback->OnEvent(e);
- delete e;
- }
- else{
- return 0;
- }
- }
- else{
- TSK_DEBUG_ERROR("Invalid parameter");
- }
-
- return ret;
+ const MsrpSession* session = (const MsrpSession*)_event->callback_data;
+ MsrpCallback* callback;
+ int ret = -1;
+
+ if(session) {
+ if((callback = session->getCallback())) {
+ MsrpEvent* e = new MsrpEvent(_event);
+ ret = callback->OnEvent(e);
+ delete e;
+ }
+ else {
+ return 0;
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ }
+
+ return ret;
} \ No newline at end of file
diff --git a/bindings/_common/Msrp.h b/bindings/_common/Msrp.h
index 9013abb..330860b 100755
--- a/bindings/_common/Msrp.h
+++ b/bindings/_common/Msrp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -31,62 +31,66 @@ class MsrpSession;
class TINYWRAP_API MsrpMessage
{
public:
- MsrpMessage();
+ MsrpMessage();
#if !defined(SWIG)
- MsrpMessage(tmsrp_message_t *message);
+ MsrpMessage(tmsrp_message_t *message);
#endif
- virtual ~MsrpMessage();
+ virtual ~MsrpMessage();
- bool isRequest();
- short getCode();
- const char* getPhrase();
- tmsrp_request_type_t getRequestType();
+ bool isRequest();
+ short getCode();
+ const char* getPhrase();
+ tmsrp_request_type_t getRequestType();
#if defined(SWIG)
- void getByteRange(int64_t* OUTPUT, int64_t* OUTPUT, int64_t* OUTPUT);
+ void getByteRange(int64_t* OUTPUT, int64_t* OUTPUT, int64_t* OUTPUT);
#else
- void getByteRange(int64_t* start, int64_t* end, int64_t* total);
+ void getByteRange(int64_t* start, int64_t* end, int64_t* total);
#endif
- bool isLastChunck();
- bool isFirstChunck();
- bool isSuccessReport();
- char* getMsrpHeaderValue(const char* name);
- char* getMsrpHeaderParamValue(const char* name, const char* param);
- unsigned getMsrpContentLength();
- unsigned getMsrpContent(void* output, unsigned maxsize);
+ bool isLastChunck();
+ bool isFirstChunck();
+ bool isSuccessReport();
+ char* getMsrpHeaderValue(const char* name);
+ char* getMsrpHeaderParamValue(const char* name, const char* param);
+ unsigned getMsrpContentLength();
+ unsigned getMsrpContent(void* output, unsigned maxsize);
#if !defined(SWIG)
- const tmsrp_message_t* getWrappedMsrpMessage() { return m_pMessage; }
+ const tmsrp_message_t* getWrappedMsrpMessage() {
+ return m_pMessage;
+ }
#endif
private:
- const tmsrp_header_t* getMsrpHeader(const char* name, unsigned index = 0);
+ const tmsrp_header_t* getMsrpHeader(const char* name, unsigned index = 0);
private:
- tmsrp_message_t *m_pMessage;
+ tmsrp_message_t *m_pMessage;
};
class TINYWRAP_API MsrpEvent
{
public:
#if !defined(SWIG)
- MsrpEvent(const tmsrp_event_t *_event);
+ MsrpEvent(const tmsrp_event_t *_event);
#endif
- virtual ~MsrpEvent();
+ virtual ~MsrpEvent();
- tmsrp_event_type_t getType();
- const MsrpSession* getSipSession();
- const MsrpMessage* getMessage() const;
+ tmsrp_event_type_t getType();
+ const MsrpSession* getSipSession();
+ const MsrpMessage* getMessage() const;
protected:
- const tmsrp_event_t *_event;
- MsrpMessage* m_pMessage;
+ const tmsrp_event_t *_event;
+ MsrpMessage* m_pMessage;
};
class TINYWRAP_API MsrpCallback
{
public:
- MsrpCallback() { }
- virtual ~MsrpCallback() {}
- virtual int OnEvent(const MsrpEvent* e) { return -1; }
+ MsrpCallback() { }
+ virtual ~MsrpCallback() {}
+ virtual int OnEvent(const MsrpEvent* e) {
+ return -1;
+ }
};
diff --git a/bindings/_common/ProxyConsumer.cxx b/bindings/_common/ProxyConsumer.cxx
index 2150654..9aa4b2f 100755
--- a/bindings/_common/ProxyConsumer.cxx
+++ b/bindings/_common/ProxyConsumer.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -40,120 +40,119 @@
/* ============ Audio Consumer Interface ================= */
-typedef struct twrap_consumer_proxy_audio_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct twrap_consumer_proxy_audio_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- uint64_t id;
- tsk_bool_t started;
- const ProxyAudioConsumer* pcConsumer; // thread-safe and will be destroyed at the time as the "struct"
+ uint64_t id;
+ tsk_bool_t started;
+ const ProxyAudioConsumer* pcConsumer; // thread-safe and will be destroyed at the time as the "struct"
}
twrap_consumer_proxy_audio_t;
#define TWRAP_CONSUMER_PROXY_AUDIO(self) ((twrap_consumer_proxy_audio_t*)(self))
int twrap_consumer_proxy_audio_set(tmedia_consumer_t* _self, const tmedia_param_t* param)
{
- twrap_consumer_proxy_audio_t* self = (twrap_consumer_proxy_audio_t*)_self;
- if(param->plugin_type == tmedia_ppt_consumer){
- // specific proxy consumer
- }
- return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
+ twrap_consumer_proxy_audio_t* self = (twrap_consumer_proxy_audio_t*)_self;
+ if(param->plugin_type == tmedia_ppt_consumer) {
+ // specific proxy consumer
+ }
+ return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
}
int twrap_consumer_proxy_audio_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- twrap_consumer_proxy_audio_t* audio = TWRAP_CONSUMER_PROXY_AUDIO(self);
- ProxyPluginMgr* manager = NULL;
- int ret = -1;
- if(codec && (manager = ProxyPluginMgr::getInstance())){
- if((audio->pcConsumer = manager->findAudioConsumer(audio->id)) && audio->pcConsumer->getCallback()){
- self->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
- self->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
- self->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
-
- ret = audio->pcConsumer->getCallback()->prepare((int)self->audio.ptime, self->audio.in.rate, self->audio.in.channels);
- if(ret == 0 && !audio->pcConsumer->getCallback()->isPivotSettings()){
- // say consumer can output these params
- // Out "rate" and "channels" must be defined regardless previous values (already the case in other back-ends) to avoid issues on reINVITE with rate change (e.g. Opus -> PCMA).
- /*if(!self->audio.out.rate)*/ self->audio.out.rate = self->audio.in.rate;
- /*if(!self->audio.out.channels)*/ self->audio.out.channels = self->audio.in.channels;
- }
- }
- }
- else {
- TSK_DEBUG_ERROR("Invalid parameter/state: codec=%d, manager=%s", codec, manager ? "no-null" : "null");
- }
-
- return ret;
+ twrap_consumer_proxy_audio_t* audio = TWRAP_CONSUMER_PROXY_AUDIO(self);
+ ProxyPluginMgr* manager = NULL;
+ int ret = -1;
+ if(codec && (manager = ProxyPluginMgr::getInstance())) {
+ if((audio->pcConsumer = manager->findAudioConsumer(audio->id)) && audio->pcConsumer->getCallback()) {
+ self->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_DECODING(codec);
+ self->audio.in.channels = TMEDIA_CODEC_CHANNELS_AUDIO_DECODING(codec);
+ self->audio.in.rate = TMEDIA_CODEC_RATE_DECODING(codec);
+
+ ret = audio->pcConsumer->getCallback()->prepare((int)self->audio.ptime, self->audio.in.rate, self->audio.in.channels);
+ if(ret == 0 && !audio->pcConsumer->getCallback()->isPivotSettings()) {
+ // say consumer can output these params
+ // Out "rate" and "channels" must be defined regardless previous values (already the case in other back-ends) to avoid issues on reINVITE with rate change (e.g. Opus -> PCMA).
+ /*if(!self->audio.out.rate)*/ self->audio.out.rate = self->audio.in.rate;
+ /*if(!self->audio.out.channels)*/ self->audio.out.channels = self->audio.in.channels;
+ }
+ }
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid parameter/state: codec=%d, manager=%s", codec, manager ? "no-null" : "null");
+ }
+
+ return ret;
}
int twrap_consumer_proxy_audio_start(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioConsumer* audioConsumer;
- if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()){
- ret = audioConsumer->getCallback()->start();
- }
- }
-
- TWRAP_CONSUMER_PROXY_AUDIO(self)->started = (ret == 0);
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioConsumer* audioConsumer;
+ if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()) {
+ ret = audioConsumer->getCallback()->start();
+ }
+ }
+
+ TWRAP_CONSUMER_PROXY_AUDIO(self)->started = (ret == 0);
+ return ret;
}
int twrap_consumer_proxy_audio_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- twrap_consumer_proxy_audio_t* audio = TWRAP_CONSUMER_PROXY_AUDIO(self);
-
- if(!audio->pcConsumer){
- ProxyPluginMgr* manager;
- if((manager = ProxyPluginMgr::getInstance())){
- audio->pcConsumer = manager->findAudioConsumer(audio->id);
- }
- }
-
- ProxyAudioConsumerCallback* callback;
- int ret = -1;
- if(audio->pcConsumer && (callback = audio->pcConsumer->getCallback())){
- if(callback->putInJitterBuffer()){
- ret = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), buffer, size, proto_hdr);
- }
- else{
- ret = callback->consume(buffer, size, proto_hdr);
- }
- }
-
- return ret;
+ twrap_consumer_proxy_audio_t* audio = TWRAP_CONSUMER_PROXY_AUDIO(self);
+
+ if(!audio->pcConsumer) {
+ ProxyPluginMgr* manager;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ audio->pcConsumer = manager->findAudioConsumer(audio->id);
+ }
+ }
+
+ ProxyAudioConsumerCallback* callback;
+ int ret = -1;
+ if(audio->pcConsumer && (callback = audio->pcConsumer->getCallback())) {
+ if(callback->putInJitterBuffer()) {
+ ret = tdav_consumer_audio_put(TDAV_CONSUMER_AUDIO(self), buffer, size, proto_hdr);
+ }
+ else {
+ ret = callback->consume(buffer, size, proto_hdr);
+ }
+ }
+
+ return ret;
}
int twrap_consumer_proxy_audio_pause(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioConsumer* audioConsumer;
- if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()){
- ret = audioConsumer->getCallback()->pause();
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioConsumer* audioConsumer;
+ if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()) {
+ ret = audioConsumer->getCallback()->pause();
+ }
+ }
+
+ return ret;
}
int twrap_consumer_proxy_audio_stop(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioConsumer* audioConsumer;
- if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()){
- ret = audioConsumer->getCallback()->stop();
- }
- }
-
- TWRAP_CONSUMER_PROXY_AUDIO(self)->started = (ret == 0) ? tsk_false : tsk_true;
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioConsumer* audioConsumer;
+ if((audioConsumer = manager->findAudioConsumer(TWRAP_CONSUMER_PROXY_AUDIO(self)->id)) && audioConsumer->getCallback()) {
+ ret = audioConsumer->getCallback()->stop();
+ }
+ }
+
+ TWRAP_CONSUMER_PROXY_AUDIO(self)->started = (ret == 0) ? tsk_false : tsk_true;
+ return ret;
}
@@ -163,70 +162,68 @@ int twrap_consumer_proxy_audio_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* twrap_consumer_proxy_audio_ctor(tsk_object_t * self, va_list * app)
{
- twrap_consumer_proxy_audio_t *consumer = (twrap_consumer_proxy_audio_t *)self;
- if(consumer){
- /* init base */
- tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
- /* init self */
-
- /* Add the plugin to the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- ProxyPlugin* proxyConsumer = new ProxyAudioConsumer(consumer);
- uint64_t id = proxyConsumer->getId();
- manager->addPlugin(&proxyConsumer);
- manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_audio_consumer);
- }
- }
- return self;
+ twrap_consumer_proxy_audio_t *consumer = (twrap_consumer_proxy_audio_t *)self;
+ if(consumer) {
+ /* init base */
+ tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(consumer));
+ /* init self */
+
+ /* Add the plugin to the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ ProxyPlugin* proxyConsumer = new ProxyAudioConsumer(consumer);
+ uint64_t id = proxyConsumer->getId();
+ manager->addPlugin(&proxyConsumer);
+ manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_audio_consumer);
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* twrap_consumer_proxy_audio_dtor(tsk_object_t * self)
-{
- twrap_consumer_proxy_audio_t *consumer = (twrap_consumer_proxy_audio_t *)self;
- if(consumer){
- /* stop */
- if(consumer->started){
- twrap_consumer_proxy_audio_stop(TMEDIA_CONSUMER(consumer));
- }
+{
+ twrap_consumer_proxy_audio_t *consumer = (twrap_consumer_proxy_audio_t *)self;
+ if(consumer) {
+ /* stop */
+ if(consumer->started) {
+ twrap_consumer_proxy_audio_stop(TMEDIA_CONSUMER(consumer));
+ }
- /* deinit base */
- tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
- /* deinit self */
+ /* deinit base */
+ tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(consumer));
+ /* deinit self */
- /* Remove plugin from the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- manager->getCallback()->OnPluginDestroyed(consumer->id, twrap_proxy_plugin_audio_consumer);
- manager->removePlugin(consumer->id);
- }
- }
+ /* Remove plugin from the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ manager->getCallback()->OnPluginDestroyed(consumer->id, twrap_proxy_plugin_audio_consumer);
+ manager->removePlugin(consumer->id);
+ }
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t twrap_consumer_proxy_audio_def_s =
-{
- sizeof(twrap_consumer_proxy_audio_t),
- twrap_consumer_proxy_audio_ctor,
- twrap_consumer_proxy_audio_dtor,
- tdav_consumer_audio_cmp,
+static const tsk_object_def_t twrap_consumer_proxy_audio_def_s = {
+ sizeof(twrap_consumer_proxy_audio_t),
+ twrap_consumer_proxy_audio_ctor,
+ twrap_consumer_proxy_audio_dtor,
+ tdav_consumer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_audio_plugin_def_s =
-{
- &twrap_consumer_proxy_audio_def_s,
-
- tmedia_audio,
- "Audio Proxy Consumer",
-
- twrap_consumer_proxy_audio_set,
- twrap_consumer_proxy_audio_prepare,
- twrap_consumer_proxy_audio_start,
- twrap_consumer_proxy_audio_consume,
- twrap_consumer_proxy_audio_pause,
- twrap_consumer_proxy_audio_stop
+static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_audio_plugin_def_s = {
+ &twrap_consumer_proxy_audio_def_s,
+
+ tmedia_audio,
+ "Audio Proxy Consumer",
+
+ twrap_consumer_proxy_audio_set,
+ twrap_consumer_proxy_audio_prepare,
+ twrap_consumer_proxy_audio_start,
+ twrap_consumer_proxy_audio_consume,
+ twrap_consumer_proxy_audio_pause,
+ twrap_consumer_proxy_audio_stop
};
/*TINYWRAP_GEXTERN*/ const tmedia_consumer_plugin_def_t *twrap_consumer_proxy_audio_plugin_def_t = &twrap_consumer_proxy_audio_plugin_def_s;
@@ -235,144 +232,144 @@ static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_audio_plugin_def_
/* ============ ProxyAudioConsumer Class ================= */
ProxyAudioConsumer::ProxyAudioConsumer(twrap_consumer_proxy_audio_t* pConsumer)
-:ProxyPlugin(twrap_proxy_plugin_audio_consumer),
-m_pWrappedPlugin(pConsumer),
-m_pCallback(tsk_null)
+ :ProxyPlugin(twrap_proxy_plugin_audio_consumer),
+ m_pWrappedPlugin(pConsumer),
+ m_pCallback(tsk_null)
{
- memset(&m_PullBuffer, 0, sizeof(m_PullBuffer));
- memset(&m_Resampler, 0, sizeof(m_Resampler));
+ memset(&m_PullBuffer, 0, sizeof(m_PullBuffer));
+ memset(&m_Resampler, 0, sizeof(m_Resampler));
- if(m_pWrappedPlugin){
- m_pWrappedPlugin->id = this->getId();
- }
+ if(m_pWrappedPlugin) {
+ m_pWrappedPlugin->id = this->getId();
+ }
}
ProxyAudioConsumer::~ProxyAudioConsumer()
{
- TSK_FREE(m_Resampler.pInBufferPtr);
- m_Resampler.nInBufferSizeInByte = 0;
- if(m_Resampler.pResampler){
- delete m_Resampler.pResampler, m_Resampler.pResampler = tsk_null;
- }
+ TSK_FREE(m_Resampler.pInBufferPtr);
+ m_Resampler.nInBufferSizeInByte = 0;
+ if(m_Resampler.pResampler) {
+ delete m_Resampler.pResampler, m_Resampler.pResampler = tsk_null;
+ }
}
// Use this function to request resampling when your sound card can't honor negotaited record parameters
bool ProxyAudioConsumer::setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels)
{
- if(m_pWrappedPlugin){
- TSK_DEBUG_INFO("ProxyAudioConsumer::setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, nChannels);
- TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.ptime = nPtime;
- TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.out.rate = nRate;
- TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.out.channels = nChannels;
- return true;
- }
- else{
- TSK_DEBUG_ERROR("Invalid state");
- return false;
- }
+ if(m_pWrappedPlugin) {
+ TSK_DEBUG_INFO("ProxyAudioConsumer::setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, nChannels);
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.ptime = nPtime;
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.out.rate = nRate;
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.out.channels = nChannels;
+ return true;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid state");
+ return false;
+ }
}
bool ProxyAudioConsumer::queryForResampler(uint16_t nInFreq, uint16_t nOutFreq, uint16_t nFrameDuration, uint16_t nChannels, uint16_t nResamplerQuality)
{
- TSK_DEBUG_INFO("queryForResampler(%hu,%hu,%hu,%hu,%hu)", nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
- if(nResamplerQuality > 10){
- TSK_DEBUG_WARN("%d is invalid value for quality", nResamplerQuality);
- }
- m_Resampler.pResampler = new AudioResampler(nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
- if(!m_Resampler.pResampler){
- TSK_DEBUG_ERROR("Failed to create new 'AudioResampler' object");
- return false;
- }
- bool bOK = m_Resampler.pResampler->isValid();
- if(!bOK){
- goto bail;
- }
- m_Resampler.nInBufferSizeInByte = m_Resampler.pResampler->getInputRequiredSizeInShort() * 2;
- m_Resampler.pInBufferPtr = tsk_calloc(m_Resampler.nInBufferSizeInByte, 1);
- bOK = (m_Resampler.pInBufferPtr != tsk_null);
+ TSK_DEBUG_INFO("queryForResampler(%hu,%hu,%hu,%hu,%hu)", nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
+ if(nResamplerQuality > 10) {
+ TSK_DEBUG_WARN("%d is invalid value for quality", nResamplerQuality);
+ }
+ m_Resampler.pResampler = new AudioResampler(nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
+ if(!m_Resampler.pResampler) {
+ TSK_DEBUG_ERROR("Failed to create new 'AudioResampler' object");
+ return false;
+ }
+ bool bOK = m_Resampler.pResampler->isValid();
+ if(!bOK) {
+ goto bail;
+ }
+ m_Resampler.nInBufferSizeInByte = m_Resampler.pResampler->getInputRequiredSizeInShort() * 2;
+ m_Resampler.pInBufferPtr = tsk_calloc(m_Resampler.nInBufferSizeInByte, 1);
+ bOK = (m_Resampler.pInBufferPtr != tsk_null);
bail:
- if(!bOK){
- if(m_Resampler.pResampler){
- delete m_Resampler.pResampler, m_Resampler.pResampler = tsk_null;
- }
- TSK_FREE(m_Resampler.pInBufferPtr);
- m_Resampler.nInBufferSizeInByte = 0;
- }
- return bOK;
+ if(!bOK) {
+ if(m_Resampler.pResampler) {
+ delete m_Resampler.pResampler, m_Resampler.pResampler = tsk_null;
+ }
+ TSK_FREE(m_Resampler.pInBufferPtr);
+ m_Resampler.nInBufferSizeInByte = 0;
+ }
+ return bOK;
}
bool ProxyAudioConsumer::setPullBuffer(const void* pPullBufferPtr, unsigned nPullBufferSize)
{
- m_PullBuffer.pPullBufferPtr = pPullBufferPtr;
- m_PullBuffer.nPullBufferSize = nPullBufferSize;
- return true;
+ m_PullBuffer.pPullBufferPtr = pPullBufferPtr;
+ m_PullBuffer.nPullBufferSize = nPullBufferSize;
+ return true;
}
unsigned ProxyAudioConsumer::pull(void* _pOutput/*=tsk_null*/, unsigned _nSize/*=0*/)
{
- if((m_pWrappedPlugin = (twrap_consumer_proxy_audio_t*)tsk_object_ref(m_pWrappedPlugin))){
- void* pOutput;
- unsigned nSize;
- if(_pOutput && _nSize){
- pOutput = _pOutput, nSize = _nSize;
- }
- else{
- pOutput = (void*)m_PullBuffer.pPullBufferPtr, nSize = m_PullBuffer.nPullBufferSize;
- }
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_audio_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ void* pOutput;
+ unsigned nSize;
+ if(_pOutput && _nSize) {
+ pOutput = _pOutput, nSize = _nSize;
+ }
+ else {
+ pOutput = (void*)m_PullBuffer.pPullBufferPtr, nSize = m_PullBuffer.nPullBufferSize;
+ }
- tsk_size_t nRetSize = 0;
+ tsk_size_t nRetSize = 0;
- if(m_Resampler.pResampler && m_Resampler.pInBufferPtr){
- nRetSize = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin), m_Resampler.pInBufferPtr, m_Resampler.nInBufferSizeInByte);
- if(nRetSize){
- nRetSize = m_Resampler.pResampler->process(m_Resampler.pInBufferPtr, nRetSize, pOutput, nSize);
- }
- }
- else{
- nRetSize = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin), pOutput, nSize);
- }
+ if(m_Resampler.pResampler && m_Resampler.pInBufferPtr) {
+ nRetSize = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin), m_Resampler.pInBufferPtr, m_Resampler.nInBufferSizeInByte);
+ if(nRetSize) {
+ nRetSize = m_Resampler.pResampler->process(m_Resampler.pInBufferPtr, nRetSize, pOutput, nSize);
+ }
+ }
+ else {
+ nRetSize = tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin), pOutput, nSize);
+ }
- tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin));
+ tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin));
- m_pWrappedPlugin = (twrap_consumer_proxy_audio_t*)tsk_object_unref(m_pWrappedPlugin);
- return nRetSize;
- }
- return 0;
+ m_pWrappedPlugin = (twrap_consumer_proxy_audio_t*)tsk_object_unref(m_pWrappedPlugin);
+ return nRetSize;
+ }
+ return 0;
}
bool ProxyAudioConsumer::setGain(unsigned nGain)
{
- if(m_pWrappedPlugin){
- // see also: MediaSessionMgr.consumerSetInt32(org.doubango.tinyWRAP.twrap_media_type_t.twrap_media_audio, "gain", nGain);
- TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.gain = TSK_MIN(nGain,14);
- return true;
- }
- return false;
+ if(m_pWrappedPlugin) {
+ // see also: MediaSessionMgr.consumerSetInt32(org.doubango.tinyWRAP.twrap_media_type_t.twrap_media_audio, "gain", nGain);
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.gain = TSK_MIN(nGain,14);
+ return true;
+ }
+ return false;
}
unsigned ProxyAudioConsumer::getGain()
{
- if(m_pWrappedPlugin){
- return TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.gain;
- }
- return 0;
+ if(m_pWrappedPlugin) {
+ return TMEDIA_CONSUMER(m_pWrappedPlugin)->audio.gain;
+ }
+ return 0;
}
bool ProxyAudioConsumer::reset()
{
- if(m_pWrappedPlugin){
- return (tdav_consumer_audio_reset(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin)) == 0);
- }
- return false;
+ if(m_pWrappedPlugin) {
+ return (tdav_consumer_audio_reset(TDAV_CONSUMER_AUDIO(m_pWrappedPlugin)) == 0);
+ }
+ return false;
}
bool ProxyAudioConsumer::registerPlugin()
{
- /* HACK: Unregister all other audio plugins */
- tmedia_consumer_plugin_unregister_by_type(tmedia_audio);
- /* Register our proxy plugin */
- return (tmedia_consumer_plugin_register(twrap_consumer_proxy_audio_plugin_def_t) == 0);
+ /* HACK: Unregister all other audio plugins */
+ tmedia_consumer_plugin_unregister_by_type(tmedia_audio);
+ /* Register our proxy plugin */
+ return (tmedia_consumer_plugin_register(twrap_consumer_proxy_audio_plugin_def_t) == 0);
}
@@ -408,135 +405,134 @@ bool ProxyAudioConsumer::registerPlugin()
/* ============ Video Consumer Interface ================= */
-typedef struct twrap_consumer_proxy_video_s
-{
- TDAV_DECLARE_CONSUMER_VIDEO;
+typedef struct twrap_consumer_proxy_video_s {
+ TDAV_DECLARE_CONSUMER_VIDEO;
- uint64_t id;
- tsk_bool_t started;
- const ProxyVideoConsumer* pcConsumer; // thread-safe and will be destroyed at the time as the "struct"
+ uint64_t id;
+ tsk_bool_t started;
+ const ProxyVideoConsumer* pcConsumer; // thread-safe and will be destroyed at the time as the "struct"
}
twrap_consumer_proxy_video_t;
#define TWRAP_CONSUMER_PROXY_VIDEO(self) ((twrap_consumer_proxy_video_t*)(self))
int twrap_consumer_proxy_video_set(tmedia_consumer_t* self, const tmedia_param_t* params)
{
- return 0;
+ return 0;
}
int twrap_consumer_proxy_video_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
- ProxyPluginMgr* manager;
- twrap_consumer_proxy_video_t* video = TWRAP_CONSUMER_PROXY_VIDEO(self);
- int ret = -1;
- if(codec && (manager = ProxyPluginMgr::getInstance())){
- if((video->pcConsumer = manager->findVideoConsumer(video->id)) && video->pcConsumer->getCallback()){
- self->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
- // in
- self->video.in.chroma = tmedia_chroma_yuv420p;
- self->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
- self->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
- // display (out)
- self->video.display.chroma = video->pcConsumer->getChroma();
- self->video.display.auto_resize = video->pcConsumer->getAutoResizeDisplay();
- if(!self->video.display.width){
- self->video.display.width = self->video.in.width;
- }
- if(!self->video.display.height){
- self->video.display.height = self->video.in.height;
- }
- ret = video->pcConsumer->getCallback()->prepare(TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->in.fps);
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ twrap_consumer_proxy_video_t* video = TWRAP_CONSUMER_PROXY_VIDEO(self);
+ int ret = -1;
+ if(codec && (manager = ProxyPluginMgr::getInstance())) {
+ if((video->pcConsumer = manager->findVideoConsumer(video->id)) && video->pcConsumer->getCallback()) {
+ self->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
+ // in
+ self->video.in.chroma = tmedia_chroma_yuv420p;
+ self->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
+ self->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
+ // display (out)
+ self->video.display.chroma = video->pcConsumer->getChroma();
+ self->video.display.auto_resize = video->pcConsumer->getAutoResizeDisplay();
+ if(!self->video.display.width) {
+ self->video.display.width = self->video.in.width;
+ }
+ if(!self->video.display.height) {
+ self->video.display.height = self->video.in.height;
+ }
+ ret = video->pcConsumer->getCallback()->prepare(TMEDIA_CODEC_VIDEO(codec)->in.width, TMEDIA_CODEC_VIDEO(codec)->in.height, TMEDIA_CODEC_VIDEO(codec)->in.fps);
+ }
+ }
+
+ return ret;
}
int twrap_consumer_proxy_video_start(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoConsumer* videoConsumer;
- if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()){
- ret = videoConsumer->getCallback()->start();
- }
- }
-
- TWRAP_CONSUMER_PROXY_VIDEO(self)->started = (ret == 0);
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoConsumer* videoConsumer;
+ if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()) {
+ ret = videoConsumer->getCallback()->start();
+ }
+ }
+
+ TWRAP_CONSUMER_PROXY_VIDEO(self)->started = (ret == 0);
+ return ret;
}
int twrap_consumer_proxy_video_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
- if(!self || !buffer || !size){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
-
- twrap_consumer_proxy_video_t* video = TWRAP_CONSUMER_PROXY_VIDEO(self);
-
- if(!video->pcConsumer){
- ProxyPluginMgr* manager;
- if((manager = ProxyPluginMgr::getInstance())){
- video->pcConsumer = manager->findVideoConsumer(video->id);
- }
- }
-
- int ret = -1;
- ProxyVideoConsumerCallback* callback;
-
- if(video->pcConsumer && (callback = video->pcConsumer->getCallback())){
- if(tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(self))){
- ret = tdav_consumer_video_put(TDAV_CONSUMER_VIDEO(self), buffer, size, proto_hdr);
- }
- else{
- if(video->pcConsumer->hasConsumeBuffer()){
- unsigned nCopiedSize = video->pcConsumer->copyBuffer(buffer, size);
- ret = callback->bufferCopied(nCopiedSize, size);
- }
- else{
- ProxyVideoFrame* frame = new ProxyVideoFrame(buffer, size, const_cast<ProxyVideoConsumer*>(video->pcConsumer)->getDecodedWidth(), const_cast<ProxyVideoConsumer*>(video->pcConsumer)->getDecodedHeight(), proto_hdr);
- ret = callback->consume(frame);
- delete frame, frame = tsk_null;
- }
- }
- }
- else if(!video->pcConsumer){
- TSK_DEBUG_ERROR("Cannot find consumer with id=%lld", TWRAP_CONSUMER_PROXY_VIDEO(self)->id);
- }
-
-
- return ret;
+ if(!self || !buffer || !size) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+
+ twrap_consumer_proxy_video_t* video = TWRAP_CONSUMER_PROXY_VIDEO(self);
+
+ if(!video->pcConsumer) {
+ ProxyPluginMgr* manager;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ video->pcConsumer = manager->findVideoConsumer(video->id);
+ }
+ }
+
+ int ret = -1;
+ ProxyVideoConsumerCallback* callback;
+
+ if(video->pcConsumer && (callback = video->pcConsumer->getCallback())) {
+ if(tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(self))) {
+ ret = tdav_consumer_video_put(TDAV_CONSUMER_VIDEO(self), buffer, size, proto_hdr);
+ }
+ else {
+ if(video->pcConsumer->hasConsumeBuffer()) {
+ unsigned nCopiedSize = video->pcConsumer->copyBuffer(buffer, size);
+ ret = callback->bufferCopied(nCopiedSize, size);
+ }
+ else {
+ ProxyVideoFrame* frame = new ProxyVideoFrame(buffer, size, const_cast<ProxyVideoConsumer*>(video->pcConsumer)->getDecodedWidth(), const_cast<ProxyVideoConsumer*>(video->pcConsumer)->getDecodedHeight(), proto_hdr);
+ ret = callback->consume(frame);
+ delete frame, frame = tsk_null;
+ }
+ }
+ }
+ else if(!video->pcConsumer) {
+ TSK_DEBUG_ERROR("Cannot find consumer with id=%lld", TWRAP_CONSUMER_PROXY_VIDEO(self)->id);
+ }
+
+
+ return ret;
}
int twrap_consumer_proxy_video_pause(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoConsumer* videoConsumer;
- if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()){
- ret = videoConsumer->getCallback()->pause();
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoConsumer* videoConsumer;
+ if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()) {
+ ret = videoConsumer->getCallback()->pause();
+ }
+ }
+
+ return ret;
}
int twrap_consumer_proxy_video_stop(tmedia_consumer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoConsumer* videoConsumer;
- if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()){
- ret = videoConsumer->getCallback()->stop();
- }
- }
-
- TWRAP_CONSUMER_PROXY_VIDEO(self)->started = (ret == 0) ? tsk_false : tsk_true;
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoConsumer* videoConsumer;
+ if((videoConsumer = manager->findVideoConsumer(TWRAP_CONSUMER_PROXY_VIDEO(self)->id)) && videoConsumer->getCallback()) {
+ ret = videoConsumer->getCallback()->stop();
+ }
+ }
+
+ TWRAP_CONSUMER_PROXY_VIDEO(self)->started = (ret == 0) ? tsk_false : tsk_true;
+ return ret;
}
@@ -546,70 +542,68 @@ int twrap_consumer_proxy_video_stop(tmedia_consumer_t* self)
/* constructor */
static tsk_object_t* twrap_consumer_proxy_video_ctor(tsk_object_t * self, va_list * app)
{
- twrap_consumer_proxy_video_t *consumer = (twrap_consumer_proxy_video_t *)self;
- if(consumer){
- /* init base */
- tdav_consumer_video_init(TDAV_CONSUMER_VIDEO(consumer));
- /* init self */
-
- /* Add the plugin to the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- ProxyPlugin* proxyConsumer = new ProxyVideoConsumer(ProxyVideoConsumer::getDefaultChroma(), consumer);
- uint64_t id = proxyConsumer->getId();
- manager->addPlugin(&proxyConsumer);
- manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_video_consumer);
- }
- }
- return self;
+ twrap_consumer_proxy_video_t *consumer = (twrap_consumer_proxy_video_t *)self;
+ if(consumer) {
+ /* init base */
+ tdav_consumer_video_init(TDAV_CONSUMER_VIDEO(consumer));
+ /* init self */
+
+ /* Add the plugin to the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ ProxyPlugin* proxyConsumer = new ProxyVideoConsumer(ProxyVideoConsumer::getDefaultChroma(), consumer);
+ uint64_t id = proxyConsumer->getId();
+ manager->addPlugin(&proxyConsumer);
+ manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_video_consumer);
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* twrap_consumer_proxy_video_dtor(tsk_object_t * self)
-{
- twrap_consumer_proxy_video_t *consumer = (twrap_consumer_proxy_video_t *)self;
- if(consumer){
+{
+ twrap_consumer_proxy_video_t *consumer = (twrap_consumer_proxy_video_t *)self;
+ if(consumer) {
- /* stop */
- if(consumer->started){
- twrap_consumer_proxy_video_stop(TMEDIA_CONSUMER(consumer));
- }
+ /* stop */
+ if(consumer->started) {
+ twrap_consumer_proxy_video_stop(TMEDIA_CONSUMER(consumer));
+ }
- /* deinit base */
- tdav_consumer_video_deinit(TDAV_CONSUMER_VIDEO(consumer));
- /* deinit self */
+ /* deinit base */
+ tdav_consumer_video_deinit(TDAV_CONSUMER_VIDEO(consumer));
+ /* deinit self */
- /* Remove plugin from the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- manager->getCallback()->OnPluginDestroyed(consumer->id, twrap_proxy_plugin_video_consumer);
- manager->removePlugin(consumer->id);
- }
- }
+ /* Remove plugin from the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ manager->getCallback()->OnPluginDestroyed(consumer->id, twrap_proxy_plugin_video_consumer);
+ manager->removePlugin(consumer->id);
+ }
+ }
- return self;
+ return self;
}
/* object definition */
-static const tsk_object_def_t twrap_consumer_proxy_video_def_s =
-{
- sizeof(twrap_consumer_proxy_video_t),
- twrap_consumer_proxy_video_ctor,
- twrap_consumer_proxy_video_dtor,
- tsk_null,
+static const tsk_object_def_t twrap_consumer_proxy_video_def_s = {
+ sizeof(twrap_consumer_proxy_video_t),
+ twrap_consumer_proxy_video_ctor,
+ twrap_consumer_proxy_video_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_video_plugin_def_s =
-{
- &twrap_consumer_proxy_video_def_s,
-
- tmedia_video,
- "Video Proxy Consumer",
-
- twrap_consumer_proxy_video_set,
- twrap_consumer_proxy_video_prepare,
- twrap_consumer_proxy_video_start,
- twrap_consumer_proxy_video_consume,
- twrap_consumer_proxy_video_pause,
- twrap_consumer_proxy_video_stop
+static const tmedia_consumer_plugin_def_t twrap_consumer_proxy_video_plugin_def_s = {
+ &twrap_consumer_proxy_video_def_s,
+
+ tmedia_video,
+ "Video Proxy Consumer",
+
+ twrap_consumer_proxy_video_set,
+ twrap_consumer_proxy_video_prepare,
+ twrap_consumer_proxy_video_start,
+ twrap_consumer_proxy_video_consume,
+ twrap_consumer_proxy_video_pause,
+ twrap_consumer_proxy_video_stop
};
/*TINYWRAP_GEXTERN*/ const tmedia_consumer_plugin_def_t *twrap_consumer_proxy_video_plugin_def_t = &twrap_consumer_proxy_video_plugin_def_s;
@@ -621,15 +615,15 @@ tmedia_chroma_t ProxyVideoConsumer::s_eDefaultChroma = tmedia_chroma_rgb565le;
bool ProxyVideoConsumer::s_bAutoResizeDisplay = false;
ProxyVideoConsumer::ProxyVideoConsumer(tmedia_chroma_t eChroma, struct twrap_consumer_proxy_video_s* pConsumer)
-: m_eChroma(eChroma),
-m_bAutoResizeDisplay(ProxyVideoConsumer::getDefaultAutoResizeDisplay()),
-m_pWrappedPlugin(pConsumer),
-m_pCallback(tsk_null),
-ProxyPlugin(twrap_proxy_plugin_video_consumer)
+ : m_eChroma(eChroma),
+ m_bAutoResizeDisplay(ProxyVideoConsumer::getDefaultAutoResizeDisplay()),
+ m_pWrappedPlugin(pConsumer),
+ m_pCallback(tsk_null),
+ ProxyPlugin(twrap_proxy_plugin_video_consumer)
{
- m_pWrappedPlugin->id = this->getId();
- m_ConsumeBuffer.pConsumeBufferPtr = tsk_null;
- m_ConsumeBuffer.nConsumeBufferSize = 0;
+ m_pWrappedPlugin->id = this->getId();
+ m_ConsumeBuffer.pConsumeBufferPtr = tsk_null;
+ m_ConsumeBuffer.nConsumeBufferSize = 0;
}
ProxyVideoConsumer::~ProxyVideoConsumer()
@@ -638,161 +632,162 @@ ProxyVideoConsumer::~ProxyVideoConsumer()
bool ProxyVideoConsumer::setDisplaySize(unsigned nWidth, unsigned nHeight)
{
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.width = nWidth;
- TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.height = nHeight;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- return true;
- }
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- return false;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.width = nWidth;
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.height = nHeight;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ return true;
+ }
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ return false;
}
unsigned ProxyVideoConsumer::getDisplayWidth()
{
- unsigned displayWidth = 0;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- displayWidth = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.width;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- }
- return displayWidth;
+ unsigned displayWidth = 0;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ displayWidth = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.width;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ }
+ return displayWidth;
}
unsigned ProxyVideoConsumer::getDisplayHeight()
{
- unsigned displayHeight = 0;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- displayHeight = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.height;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- }
- return displayHeight;
+ unsigned displayHeight = 0;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ displayHeight = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.height;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ }
+ return displayHeight;
}
unsigned ProxyVideoConsumer::getDecodedWidth()
{
- unsigned width = 0;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- width = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.in.width;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- }
- return width;
+ unsigned width = 0;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ width = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.in.width;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ }
+ return width;
}
unsigned ProxyVideoConsumer::getDecodedHeight()
{
- unsigned height = 0;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- height = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.in.height;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- }
- return height;
+ unsigned height = 0;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ height = TMEDIA_CONSUMER(m_pWrappedPlugin)->video.in.height;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ }
+ return height;
}
tmedia_chroma_t ProxyVideoConsumer::getChroma()const
{
- return m_eChroma;
+ return m_eChroma;
}
-bool ProxyVideoConsumer::setAutoResizeDisplay(bool bAutoResizeDisplay){
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.auto_resize = bAutoResizeDisplay ? tsk_true : tsk_false;
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- m_bAutoResizeDisplay = bAutoResizeDisplay;
- return true;
- }
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- return false;
+bool ProxyVideoConsumer::setAutoResizeDisplay(bool bAutoResizeDisplay)
+{
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ TMEDIA_CONSUMER(m_pWrappedPlugin)->video.display.auto_resize = bAutoResizeDisplay ? tsk_true : tsk_false;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ m_bAutoResizeDisplay = bAutoResizeDisplay;
+ return true;
+ }
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ return false;
}
bool ProxyVideoConsumer::getAutoResizeDisplay()const
{
- return m_bAutoResizeDisplay;
+ return m_bAutoResizeDisplay;
}
bool ProxyVideoConsumer::setConsumeBuffer(const void* pConsumeBufferPtr, unsigned nConsumeBufferSize)
{
- m_ConsumeBuffer.pConsumeBufferPtr = pConsumeBufferPtr;
- m_ConsumeBuffer.nConsumeBufferSize = nConsumeBufferSize;
- return true;
+ m_ConsumeBuffer.pConsumeBufferPtr = pConsumeBufferPtr;
+ m_ConsumeBuffer.nConsumeBufferSize = nConsumeBufferSize;
+ return true;
}
unsigned ProxyVideoConsumer::copyBuffer(const void* pBuffer, unsigned nSize)const
{
- unsigned nRetsize = 0;
- if(pBuffer && nSize && m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize){
- nRetsize = (nSize > m_ConsumeBuffer.nConsumeBufferSize) ? m_ConsumeBuffer.nConsumeBufferSize : nSize;
- memcpy((void*)m_ConsumeBuffer.pConsumeBufferPtr, pBuffer, nRetsize);
- }
- return nRetsize;
+ unsigned nRetsize = 0;
+ if(pBuffer && nSize && m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize) {
+ nRetsize = (nSize > m_ConsumeBuffer.nConsumeBufferSize) ? m_ConsumeBuffer.nConsumeBufferSize : nSize;
+ memcpy((void*)m_ConsumeBuffer.pConsumeBufferPtr, pBuffer, nRetsize);
+ }
+ return nRetsize;
}
unsigned ProxyVideoConsumer::pull(void* pOutput, unsigned nSize)
{
- if(pOutput && nSize && (m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- tsk_size_t nRetSize = 0;
+ if(pOutput && nSize && (m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ tsk_size_t nRetSize = 0;
+
+ if(!tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin))) {
+ TSK_DEBUG_ERROR("This consumer doesn't hold any jitter buffer.\n\nTo pull a buffer you must register a callback ('class ProxyVideoConsumerCallback') and listen for either 'consume' or 'bufferCopied' functions");
+ goto done;
+ }
- if(!tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin))){
- TSK_DEBUG_ERROR("This consumer doesn't hold any jitter buffer.\n\nTo pull a buffer you must register a callback ('class ProxyVideoConsumerCallback') and listen for either 'consume' or 'bufferCopied' functions");
- goto done;
- }
-
- nRetSize = tdav_consumer_video_get(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin), pOutput, nSize);
+ nRetSize = tdav_consumer_video_get(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin), pOutput, nSize);
- tdav_consumer_video_tick(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin));
+ tdav_consumer_video_tick(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin));
done:
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- return nRetSize;
- }
- return 0;
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ return nRetSize;
+ }
+ return 0;
}
bool ProxyVideoConsumer::reset()
{
- bool ret = false;
- if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))){
- if(tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin))){
- ret = (tdav_consumer_video_reset(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin)) == 0);
- }
- else{
- TSK_DEBUG_ERROR("This consumer doesn't hold any jitter buffer");
- }
- m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
- }
+ bool ret = false;
+ if((m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_ref(m_pWrappedPlugin))) {
+ if(tdav_consumer_video_has_jb(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin))) {
+ ret = (tdav_consumer_video_reset(TDAV_CONSUMER_VIDEO(m_pWrappedPlugin)) == 0);
+ }
+ else {
+ TSK_DEBUG_ERROR("This consumer doesn't hold any jitter buffer");
+ }
+ m_pWrappedPlugin = (twrap_consumer_proxy_video_t*)tsk_object_unref(m_pWrappedPlugin);
+ }
- TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
- return ret;
+ TSK_DEBUG_ERROR("This consumer doesn't wrap any plugin");
+ return ret;
}
bool ProxyVideoConsumer::registerPlugin()
{
- /* HACK: Unregister all other video plugins */
- tmedia_consumer_plugin_unregister_by_type(tmedia_video);
- /* Register our proxy plugin */
- return (tmedia_consumer_plugin_register(twrap_consumer_proxy_video_plugin_def_t) == 0);
+ /* HACK: Unregister all other video plugins */
+ tmedia_consumer_plugin_unregister_by_type(tmedia_video);
+ /* Register our proxy plugin */
+ return (tmedia_consumer_plugin_register(twrap_consumer_proxy_video_plugin_def_t) == 0);
}
ProxyVideoFrame::ProxyVideoFrame(const void* pBufferPtr, unsigned nSize, unsigned nFrameWidth, unsigned nFrameHeight, const tsk_object_t* pProtoHdr)
{
- m_pBufferPtr = pBufferPtr;
- m_nBufferSize = nSize;
- m_nFrameWidth = nFrameWidth;
- m_nFrameHeight = nFrameHeight;
- m_pProtoHdr = pProtoHdr;
+ m_pBufferPtr = pBufferPtr;
+ m_nBufferSize = nSize;
+ m_nFrameWidth = nFrameWidth;
+ m_nFrameHeight = nFrameHeight;
+ m_pProtoHdr = pProtoHdr;
}
ProxyVideoFrame::~ProxyVideoFrame()
@@ -801,15 +796,15 @@ ProxyVideoFrame::~ProxyVideoFrame()
unsigned ProxyVideoFrame::getSize()
{
- return m_nBufferSize;
+ return m_nBufferSize;
}
unsigned ProxyVideoFrame::getContent(void* pOutput, unsigned nMaxsize)
{
- unsigned nRetsize = 0;
- if(pOutput && nMaxsize && m_pBufferPtr){
- nRetsize = (m_nBufferSize > nMaxsize) ? nMaxsize : m_nBufferSize;
- memcpy(pOutput, m_pBufferPtr, nRetsize);
- }
- return nRetsize;
+ unsigned nRetsize = 0;
+ if(pOutput && nMaxsize && m_pBufferPtr) {
+ nRetsize = (m_nBufferSize > nMaxsize) ? nMaxsize : m_nBufferSize;
+ memcpy(pOutput, m_pBufferPtr, nRetsize);
+ }
+ return nRetsize;
}
diff --git a/bindings/_common/ProxyConsumer.h b/bindings/_common/ProxyConsumer.h
index 138d3e5..76258b6 100755
--- a/bindings/_common/ProxyConsumer.h
+++ b/bindings/_common/ProxyConsumer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -41,20 +41,34 @@ class AudioResampler;
class ProxyAudioConsumerCallback
{
public:
- ProxyAudioConsumerCallback() { }
- virtual ~ProxyAudioConsumerCallback(){ }
+ ProxyAudioConsumerCallback() { }
+ virtual ~ProxyAudioConsumerCallback() { }
- virtual int prepare(int ptime, int rate, int channels) { return -1; }
- virtual int start() { return -1; }
- virtual int pause() { return -1; }
- virtual int stop() { return -1; }
+ virtual int prepare(int ptime, int rate, int channels) {
+ return -1;
+ }
+ virtual int start() {
+ return -1;
+ }
+ virtual int pause() {
+ return -1;
+ }
+ virtual int stop() {
+ return -1;
+ }
#if !defined(SWIG)
- // whether the audio buffer have to be stored in the JB then pulled using "ProxyAudioConsumer::pull()" or not
- virtual bool putInJitterBuffer(){ return true; }
- // whether we are using the "telepresence" system (PIVOT audio settings must not be changed)
- virtual bool isPivotSettings() { return false; }
- // only called if "putInJitterBuffer()" return "true"
- virtual int consume(const void* buffer_ptr, tsk_size_t buffer_size, const tsk_object_t* proto_hdr){ return -1; }
+ // whether the audio buffer have to be stored in the JB then pulled using "ProxyAudioConsumer::pull()" or not
+ virtual bool putInJitterBuffer() {
+ return true;
+ }
+ // whether we are using the "telepresence" system (PIVOT audio settings must not be changed)
+ virtual bool isPivotSettings() {
+ return false;
+ }
+ // only called if "putInJitterBuffer()" return "true"
+ virtual int consume(const void* buffer_ptr, tsk_size_t buffer_size, const tsk_object_t* proto_hdr) {
+ return -1;
+ }
#endif
};
@@ -63,43 +77,47 @@ class ProxyAudioConsumer : public ProxyPlugin
{
public:
#if !defined(SWIG)
- ProxyAudioConsumer(struct twrap_consumer_proxy_audio_s* pConsumer);
+ ProxyAudioConsumer(struct twrap_consumer_proxy_audio_s* pConsumer);
#endif
- virtual ~ProxyAudioConsumer();
- bool setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels);
- bool queryForResampler(uint16_t nInFreq, uint16_t nOutFreq, uint16_t nFrameDuration, uint16_t nChannels, uint16_t nResamplerQuality);
- bool setPullBuffer(const void* pPullBufferPtr, unsigned nPullBufferSize);
- unsigned pull(void* pOutput=tsk_null, unsigned nSize=0);
- bool setGain(unsigned nGain);
- unsigned getGain();
- bool reset();
- void setCallback(ProxyAudioConsumerCallback* pCallback) { m_pCallback = pCallback; }
+ virtual ~ProxyAudioConsumer();
+ bool setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels);
+ bool queryForResampler(uint16_t nInFreq, uint16_t nOutFreq, uint16_t nFrameDuration, uint16_t nChannels, uint16_t nResamplerQuality);
+ bool setPullBuffer(const void* pPullBufferPtr, unsigned nPullBufferSize);
+ unsigned pull(void* pOutput=tsk_null, unsigned nSize=0);
+ bool setGain(unsigned nGain);
+ unsigned getGain();
+ bool reset();
+ void setCallback(ProxyAudioConsumerCallback* pCallback) {
+ m_pCallback = pCallback;
+ }
#if !defined(SWIG)
- inline ProxyAudioConsumerCallback* getCallback()const { return m_pCallback; }
- virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin){
- return m_pWrappedPlugin == pWrappedPlugin;
- }
+ inline ProxyAudioConsumerCallback* getCallback()const {
+ return m_pCallback;
+ }
+ virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin) {
+ return m_pWrappedPlugin == pWrappedPlugin;
+ }
#endif
- virtual inline uint64_t getMediaSessionId(){
- return m_pWrappedPlugin ? TMEDIA_CONSUMER(m_pWrappedPlugin)->session_id : 0;
- }
+ virtual inline uint64_t getMediaSessionId() {
+ return m_pWrappedPlugin ? TMEDIA_CONSUMER(m_pWrappedPlugin)->session_id : 0;
+ }
public:
- static bool registerPlugin();
+ static bool registerPlugin();
private:
- struct twrap_consumer_proxy_audio_s* m_pWrappedPlugin;
- ProxyAudioConsumerCallback* m_pCallback;
- struct{
- const void* pPullBufferPtr;
- unsigned nPullBufferSize;
- } m_PullBuffer;
-
- struct{
- void* pInBufferPtr;
- unsigned nInBufferSizeInByte;
- AudioResampler* pResampler;
- } m_Resampler;
+ struct twrap_consumer_proxy_audio_s* m_pWrappedPlugin;
+ ProxyAudioConsumerCallback* m_pCallback;
+ struct {
+ const void* pPullBufferPtr;
+ unsigned nPullBufferSize;
+ } m_PullBuffer;
+
+ struct {
+ void* pInBufferPtr;
+ unsigned nInBufferSizeInByte;
+ AudioResampler* pResampler;
+ } m_Resampler;
};
class ProxyVideoFrame;
@@ -108,16 +126,28 @@ class ProxyVideoFrame;
class ProxyVideoConsumerCallback
{
public:
- ProxyVideoConsumerCallback(){}
- virtual ~ProxyVideoConsumerCallback() {}
-
- virtual int prepare(int nWidth, int nHeight, int nFps) { return -1; }
- virtual int consume(const ProxyVideoFrame* frame) { return -1; }
- // only called if a buffer is registered using setPullBuffer(). Otherwise, consume() will be called
- virtual int bufferCopied(unsigned nCopiedSize, unsigned nAvailableSize) { return -1; }
- virtual int start() { return -1; }
- virtual int pause() { return -1; }
- virtual int stop() { return -1; }
+ ProxyVideoConsumerCallback() {}
+ virtual ~ProxyVideoConsumerCallback() {}
+
+ virtual int prepare(int nWidth, int nHeight, int nFps) {
+ return -1;
+ }
+ virtual int consume(const ProxyVideoFrame* frame) {
+ return -1;
+ }
+ // only called if a buffer is registered using setPullBuffer(). Otherwise, consume() will be called
+ virtual int bufferCopied(unsigned nCopiedSize, unsigned nAvailableSize) {
+ return -1;
+ }
+ virtual int start() {
+ return -1;
+ }
+ virtual int pause() {
+ return -1;
+ }
+ virtual int stop() {
+ return -1;
+ }
};
/* ============ ProxyVideoConsumer Class ================= */
@@ -125,58 +155,72 @@ class ProxyVideoConsumer : public ProxyPlugin
{
public:
#if !defined(SWIG)
- ProxyVideoConsumer(tmedia_chroma_t eChroma, struct twrap_consumer_proxy_video_s* pConsumer);
+ ProxyVideoConsumer(tmedia_chroma_t eChroma, struct twrap_consumer_proxy_video_s* pConsumer);
#endif
- virtual ~ProxyVideoConsumer();
+ virtual ~ProxyVideoConsumer();
- bool setDisplaySize(unsigned nWidth, unsigned nHeight);
- unsigned getDisplayWidth();
- unsigned getDisplayHeight();
+ bool setDisplaySize(unsigned nWidth, unsigned nHeight);
+ unsigned getDisplayWidth();
+ unsigned getDisplayHeight();
unsigned getDecodedWidth();
- unsigned getDecodedHeight();
-
- void setCallback(ProxyVideoConsumerCallback* pCallback) { m_pCallback = pCallback; }
- bool setAutoResizeDisplay(bool bAutoResizeDisplay);
- bool getAutoResizeDisplay()const;
- bool setConsumeBuffer(const void* pConsumeBufferPtr, unsigned nConsumeBufferSize);
- unsigned pull(void* pOutput, unsigned nSize);
- bool reset();
-
+ unsigned getDecodedHeight();
+
+ void setCallback(ProxyVideoConsumerCallback* pCallback) {
+ m_pCallback = pCallback;
+ }
+ bool setAutoResizeDisplay(bool bAutoResizeDisplay);
+ bool getAutoResizeDisplay()const;
+ bool setConsumeBuffer(const void* pConsumeBufferPtr, unsigned nConsumeBufferSize);
+ unsigned pull(void* pOutput, unsigned nSize);
+ bool reset();
+
#if !defined(SWIG)
- bool hasConsumeBuffer()const { return m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize; }
- unsigned copyBuffer(const void* pBuffer, unsigned nSize)const;
- inline ProxyVideoConsumerCallback* getCallback()const { return m_pCallback; }
- virtual inline bool isWrapping(tsk_object_t* wrapped_plugin){
- return m_pWrappedPlugin == wrapped_plugin;
- }
+ bool hasConsumeBuffer()const {
+ return m_ConsumeBuffer.pConsumeBufferPtr && m_ConsumeBuffer.nConsumeBufferSize;
+ }
+ unsigned copyBuffer(const void* pBuffer, unsigned nSize)const;
+ inline ProxyVideoConsumerCallback* getCallback()const {
+ return m_pCallback;
+ }
+ virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) {
+ return m_pWrappedPlugin == wrapped_plugin;
+ }
#endif
- virtual inline uint64_t getMediaSessionId(){
- return m_pWrappedPlugin ? TMEDIA_CONSUMER(m_pWrappedPlugin)->session_id : 0;
- }
+ virtual inline uint64_t getMediaSessionId() {
+ return m_pWrappedPlugin ? TMEDIA_CONSUMER(m_pWrappedPlugin)->session_id : 0;
+ }
public:
- static bool registerPlugin();
- static void setDefaultChroma(tmedia_chroma_t eChroma){ s_eDefaultChroma = eChroma; }
- static void setDefaultAutoResizeDisplay(bool bAutoResizeDisplay){ s_bAutoResizeDisplay = bAutoResizeDisplay;}
+ static bool registerPlugin();
+ static void setDefaultChroma(tmedia_chroma_t eChroma) {
+ s_eDefaultChroma = eChroma;
+ }
+ static void setDefaultAutoResizeDisplay(bool bAutoResizeDisplay) {
+ s_bAutoResizeDisplay = bAutoResizeDisplay;
+ }
#if !defined(SWIG)
- tmedia_chroma_t getChroma()const;
- static tmedia_chroma_t getDefaultChroma() { return s_eDefaultChroma; }
- static bool getDefaultAutoResizeDisplay() { return s_bAutoResizeDisplay; }
+ tmedia_chroma_t getChroma()const;
+ static tmedia_chroma_t getDefaultChroma() {
+ return s_eDefaultChroma;
+ }
+ static bool getDefaultAutoResizeDisplay() {
+ return s_bAutoResizeDisplay;
+ }
#endif
private:
- struct twrap_consumer_proxy_video_s* m_pWrappedPlugin;
- tmedia_chroma_t m_eChroma;
- ProxyVideoConsumerCallback* m_pCallback;
- struct{
- const void* pConsumeBufferPtr;
- unsigned nConsumeBufferSize;
- } m_ConsumeBuffer;
- bool m_bAutoResizeDisplay;
-
- static tmedia_chroma_t s_eDefaultChroma;
- static bool s_bAutoResizeDisplay;
+ struct twrap_consumer_proxy_video_s* m_pWrappedPlugin;
+ tmedia_chroma_t m_eChroma;
+ ProxyVideoConsumerCallback* m_pCallback;
+ struct {
+ const void* pConsumeBufferPtr;
+ unsigned nConsumeBufferSize;
+ } m_ConsumeBuffer;
+ bool m_bAutoResizeDisplay;
+
+ static tmedia_chroma_t s_eDefaultChroma;
+ static bool s_bAutoResizeDisplay;
};
/* ============ ProxyVideoFrame Class ================= */
@@ -184,27 +228,37 @@ class ProxyVideoFrame
{
public:
#if !defined(SWIG)
- ProxyVideoFrame(const void* pBufferPtr, unsigned nBufferSize, unsigned nFrameWidth, unsigned nFrameHeight, const tsk_object_t* pProtoHdr);
+ ProxyVideoFrame(const void* pBufferPtr, unsigned nBufferSize, unsigned nFrameWidth, unsigned nFrameHeight, const tsk_object_t* pProtoHdr);
#endif
- virtual ~ProxyVideoFrame();
+ virtual ~ProxyVideoFrame();
public: /* For Java/C# applications */
- unsigned getSize();
- unsigned getContent(void* pOutput, unsigned nMaxsize);
- inline unsigned getFrameWidth()const{ return m_nFrameWidth; }
- inline unsigned getFrameHeight()const{ return m_nFrameHeight; }
+ unsigned getSize();
+ unsigned getContent(void* pOutput, unsigned nMaxsize);
+ inline unsigned getFrameWidth()const {
+ return m_nFrameWidth;
+ }
+ inline unsigned getFrameHeight()const {
+ return m_nFrameHeight;
+ }
#if !defined(SWIG) /* For C/C++ applications */
public:
- inline unsigned getBufferSize()const{ return m_nBufferSize; }
- inline const void* getBufferPtr()const{ return m_pBufferPtr; }
- inline const tsk_object_t* getProtoHdr()const{ return m_pProtoHdr; }
+ inline unsigned getBufferSize()const {
+ return m_nBufferSize;
+ }
+ inline const void* getBufferPtr()const {
+ return m_pBufferPtr;
+ }
+ inline const tsk_object_t* getProtoHdr()const {
+ return m_pProtoHdr;
+ }
#endif
private:
- const void* m_pBufferPtr;
- unsigned m_nBufferSize, m_nFrameWidth, m_nFrameHeight;
- const tsk_object_t* m_pProtoHdr;
+ const void* m_pBufferPtr;
+ unsigned m_nBufferSize, m_nFrameWidth, m_nFrameHeight;
+ const tsk_object_t* m_pProtoHdr;
};
diff --git a/bindings/_common/ProxyPluginMgr.cxx b/bindings/_common/ProxyPluginMgr.cxx
index fd6e026..2191b98 100755
--- a/bindings/_common/ProxyPluginMgr.cxx
+++ b/bindings/_common/ProxyPluginMgr.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -27,10 +27,9 @@
//
// "twrap_proxy_plugin_t" Declarations
//
-typedef struct twrap_proxy_plugin_s
-{
- TSK_DECLARE_OBJECT;
- ProxyPlugin* plugin;
+typedef struct twrap_proxy_plugin_s {
+ TSK_DECLARE_OBJECT;
+ ProxyPlugin* plugin;
}
twrap_proxy_plugin_t;
#define TWRAP_PROXY_PLUGIN(self) ((twrap_proxy_plugin_t*)(self))
@@ -45,191 +44,191 @@ ProxyPluginMgr* ProxyPluginMgr::instance = tsk_null;
static uint64_t __uniqueId = 0;
ProxyPluginMgr::ProxyPluginMgr(ProxyPluginMgrCallback* _callback)
-:callback(_callback)
+ :callback(_callback)
{
- this->plugins = tsk_list_create();
- if(!this->callback){
- TSK_DEBUG_WARN("Callback function is Null => You will have big problems as we won't check it before call");
- }
+ this->plugins = tsk_list_create();
+ if(!this->callback) {
+ TSK_DEBUG_WARN("Callback function is Null => You will have big problems as we won't check it before call");
+ }
}
ProxyPluginMgr::~ProxyPluginMgr()
{
- if(this == ProxyPluginMgr::instance){
- ProxyPluginMgr::instance = tsk_null;
- }
- TSK_OBJECT_SAFE_FREE(this->plugins);
+ if(this == ProxyPluginMgr::instance) {
+ ProxyPluginMgr::instance = tsk_null;
+ }
+ TSK_OBJECT_SAFE_FREE(this->plugins);
}
ProxyPluginMgr* ProxyPluginMgr::createInstance(ProxyPluginMgrCallback* pCallback)
{
- if(!ProxyPluginMgr::instance){
- ProxyPluginMgr::instance = new ProxyPluginMgr(pCallback);
- }
- else{
- TSK_DEBUG_WARN("Plugin instance already exist");
- ProxyPluginMgr::instance->callback = pCallback;
- }
- return ProxyPluginMgr::instance;
+ if(!ProxyPluginMgr::instance) {
+ ProxyPluginMgr::instance = new ProxyPluginMgr(pCallback);
+ }
+ else {
+ TSK_DEBUG_WARN("Plugin instance already exist");
+ ProxyPluginMgr::instance->callback = pCallback;
+ }
+ return ProxyPluginMgr::instance;
}
void ProxyPluginMgr::destroyInstance(ProxyPluginMgr** ppInstance)
{
- if(ppInstance && *ppInstance){
- bool bMatch = ProxyPluginMgr::instance && (*ppInstance == ProxyPluginMgr::instance);
- delete *ppInstance, *ppInstance = tsk_null;
- if(bMatch){
- ProxyPluginMgr::instance = tsk_null;
- }
- }
+ if(ppInstance && *ppInstance) {
+ bool bMatch = ProxyPluginMgr::instance && (*ppInstance == ProxyPluginMgr::instance);
+ delete *ppInstance, *ppInstance = tsk_null;
+ if(bMatch) {
+ ProxyPluginMgr::instance = tsk_null;
+ }
+ }
}
ProxyPluginMgr* ProxyPluginMgr::getInstance()
{
- if(!ProxyPluginMgr::instance){
- TSK_DEBUG_ERROR("No instance of the manager could be found");
- }
- return ProxyPluginMgr::instance;
+ if(!ProxyPluginMgr::instance) {
+ TSK_DEBUG_ERROR("No instance of the manager could be found");
+ }
+ return ProxyPluginMgr::instance;
}
uint64_t ProxyPluginMgr::getUniqueId()
{
- return ++__uniqueId;
+ return ++__uniqueId;
}
int ProxyPluginMgr::addPlugin(ProxyPlugin** plugin)
{
- twrap_proxy_plugin_t* twrap_plugin;
- int ret = -1;
-
- tsk_list_lock(this->plugins);
-
- if(!plugin || !*plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- goto bail;
- }
-
- if(tsk_list_find_item_by_pred(this->plugins, pred_find_plugin_by_value, *plugin)){
- TSK_DEBUG_ERROR("Plugin already exist");
- goto bail;
- }
-
- if((twrap_plugin = twrap_proxy_plugin_create(plugin))){
- tsk_list_push_back_data(this->plugins, (void**)&twrap_plugin);
- ret = 0;
- }
- else{
- TSK_DEBUG_ERROR("Failed to create plugin");
- goto bail;
- }
+ twrap_proxy_plugin_t* twrap_plugin;
+ int ret = -1;
+
+ tsk_list_lock(this->plugins);
+
+ if(!plugin || !*plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ goto bail;
+ }
+
+ if(tsk_list_find_item_by_pred(this->plugins, pred_find_plugin_by_value, *plugin)) {
+ TSK_DEBUG_ERROR("Plugin already exist");
+ goto bail;
+ }
+
+ if((twrap_plugin = twrap_proxy_plugin_create(plugin))) {
+ tsk_list_push_back_data(this->plugins, (void**)&twrap_plugin);
+ ret = 0;
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create plugin");
+ goto bail;
+ }
bail:
- tsk_list_unlock(this->plugins);
+ tsk_list_unlock(this->plugins);
- return ret;
+ return ret;
}
int ProxyPluginMgr::removePlugin(ProxyPlugin** plugin)
{
- if(!plugin || !*plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return -1;
- }
- return this->removePlugin((*plugin)->getId());
+ if(!plugin || !*plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return -1;
+ }
+ return this->removePlugin((*plugin)->getId());
}
const ProxyPlugin* ProxyPluginMgr::findPlugin(uint64_t id)
{
- ProxyPlugin* ret = tsk_null;
+ ProxyPlugin* ret = tsk_null;
- tsk_list_item_t* item;
+ tsk_list_item_t* item;
- tsk_list_lock(this->plugins);
- tsk_list_foreach(item, this->plugins){
- if(TWRAP_PROXY_PLUGIN(item->data)->plugin->getId() == id){
- ret = TWRAP_PROXY_PLUGIN(item->data)->plugin;
- break;
- }
- }
- tsk_list_unlock(this->plugins);
+ tsk_list_lock(this->plugins);
+ tsk_list_foreach(item, this->plugins) {
+ if(TWRAP_PROXY_PLUGIN(item->data)->plugin->getId() == id) {
+ ret = TWRAP_PROXY_PLUGIN(item->data)->plugin;
+ break;
+ }
+ }
+ tsk_list_unlock(this->plugins);
- return ret;
+ return ret;
}
const ProxyPlugin* ProxyPluginMgr::findPlugin(tsk_object_t* wrapped_plugin)
{
- ProxyPlugin* ret = tsk_null;
+ ProxyPlugin* ret = tsk_null;
- tsk_list_item_t* item;
+ tsk_list_item_t* item;
- if(!wrapped_plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
+ if(!wrapped_plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
- tsk_list_lock(this->plugins);
- tsk_list_foreach(item, this->plugins){
- if(TWRAP_PROXY_PLUGIN(item->data)->plugin->isWrapping(wrapped_plugin)){
- ret = TWRAP_PROXY_PLUGIN(item->data)->plugin;
- break;
- }
- }
- tsk_list_unlock(this->plugins);
+ tsk_list_lock(this->plugins);
+ tsk_list_foreach(item, this->plugins) {
+ if(TWRAP_PROXY_PLUGIN(item->data)->plugin->isWrapping(wrapped_plugin)) {
+ ret = TWRAP_PROXY_PLUGIN(item->data)->plugin;
+ break;
+ }
+ }
+ tsk_list_unlock(this->plugins);
- return ret;
+ return ret;
}
int ProxyPluginMgr::removePlugin(uint64_t id)
{
- tsk_list_item_t* item;
+ tsk_list_item_t* item;
- tsk_list_lock(this->plugins);
+ tsk_list_lock(this->plugins);
- tsk_list_foreach(item, this->plugins){
- if(TWRAP_PROXY_PLUGIN(item->data)->plugin->getId() == id){
- tsk_list_remove_item(this->plugins, item);
- break;
- }
- }
+ tsk_list_foreach(item, this->plugins) {
+ if(TWRAP_PROXY_PLUGIN(item->data)->plugin->getId() == id) {
+ tsk_list_remove_item(this->plugins, item);
+ break;
+ }
+ }
- tsk_list_unlock(this->plugins);
- return 0;
+ tsk_list_unlock(this->plugins);
+ return 0;
}
const ProxyAudioConsumer* ProxyPluginMgr::findAudioConsumer(uint64_t id)
{
- const ProxyPlugin* audioConsumer = this->findPlugin(id);
- if(audioConsumer && audioConsumer->getType() == twrap_proxy_plugin_audio_consumer){
- return dyn_cast<const ProxyAudioConsumer*>(audioConsumer);
- }
- return tsk_null;
+ const ProxyPlugin* audioConsumer = this->findPlugin(id);
+ if(audioConsumer && audioConsumer->getType() == twrap_proxy_plugin_audio_consumer) {
+ return dyn_cast<const ProxyAudioConsumer*>(audioConsumer);
+ }
+ return tsk_null;
}
const ProxyVideoConsumer* ProxyPluginMgr::findVideoConsumer(uint64_t id)
{
- const ProxyPlugin* videoConsumer = this->findPlugin(id);
- if(videoConsumer && videoConsumer->getType() == twrap_proxy_plugin_video_consumer){
- return dyn_cast<const ProxyVideoConsumer*>(videoConsumer);
- }
- return tsk_null;
+ const ProxyPlugin* videoConsumer = this->findPlugin(id);
+ if(videoConsumer && videoConsumer->getType() == twrap_proxy_plugin_video_consumer) {
+ return dyn_cast<const ProxyVideoConsumer*>(videoConsumer);
+ }
+ return tsk_null;
}
const ProxyAudioProducer* ProxyPluginMgr::findAudioProducer(uint64_t id)
{
- const ProxyPlugin* audioProducer = this->findPlugin(id);
- if(audioProducer && audioProducer->getType() == twrap_proxy_plugin_audio_producer){
- return dyn_cast<const ProxyAudioProducer*>(audioProducer);
- }
- return tsk_null;
+ const ProxyPlugin* audioProducer = this->findPlugin(id);
+ if(audioProducer && audioProducer->getType() == twrap_proxy_plugin_audio_producer) {
+ return dyn_cast<const ProxyAudioProducer*>(audioProducer);
+ }
+ return tsk_null;
}
const ProxyVideoProducer* ProxyPluginMgr::findVideoProducer(uint64_t id)
{
- const ProxyPlugin* videoProducer = this->findPlugin(id);
- if(videoProducer && videoProducer->getType() == twrap_proxy_plugin_video_producer){
- return dyn_cast<const ProxyVideoProducer*>(videoProducer);
- }
- return tsk_null;
+ const ProxyPlugin* videoProducer = this->findPlugin(id);
+ if(videoProducer && videoProducer->getType() == twrap_proxy_plugin_video_producer) {
+ return dyn_cast<const ProxyVideoProducer*>(videoProducer);
+ }
+ return tsk_null;
}
@@ -238,69 +237,72 @@ const ProxyVideoProducer* ProxyPluginMgr::findVideoProducer(uint64_t id)
//
static tsk_object_t* twrap_proxy_plugin_ctor(tsk_object_t * self, va_list * app)
{
- twrap_proxy_plugin_t *_self = dyn_cast<twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(self));
- if(_self){
- }
- return self;
+ twrap_proxy_plugin_t *_self = dyn_cast<twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(self));
+ if(_self) {
+ }
+ return self;
}
static tsk_object_t* twrap_proxy_plugin_dtor(tsk_object_t * self)
-{
- twrap_proxy_plugin_t *_self = dyn_cast<twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(self));
- if(_self){
- if(_self->plugin){
- delete _self->plugin, _self->plugin = tsk_null;
- }
- }
-
- return self;
+{
+ twrap_proxy_plugin_t *_self = dyn_cast<twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(self));
+ if(_self) {
+ if(_self->plugin) {
+ delete _self->plugin, _self->plugin = tsk_null;
+ }
+ }
+
+ return self;
}
static int twrap_proxy_plugin_cmp(const tsk_object_t *_c1, const tsk_object_t *_c2)
{
- const twrap_proxy_plugin_t *c1 = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(_c1));
- const twrap_proxy_plugin_t *c2 = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(_c2));
-
- if(c1 && c2){
- return (c1->plugin == c2->plugin); // See "ProxyPlugin::operator =="
- }
- else if(!c1 && !c2) return 0;
- else return -1;
+ const twrap_proxy_plugin_t *c1 = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(_c1));
+ const twrap_proxy_plugin_t *c2 = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(_c2));
+
+ if(c1 && c2) {
+ return (c1->plugin == c2->plugin); // See "ProxyPlugin::operator =="
+ }
+ else if(!c1 && !c2) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
-static const tsk_object_def_t twrap_proxy_plugin_def_s =
-{
- sizeof(twrap_proxy_plugin_t),
- twrap_proxy_plugin_ctor,
- twrap_proxy_plugin_dtor,
- twrap_proxy_plugin_cmp,
+static const tsk_object_def_t twrap_proxy_plugin_def_s = {
+ sizeof(twrap_proxy_plugin_t),
+ twrap_proxy_plugin_ctor,
+ twrap_proxy_plugin_dtor,
+ twrap_proxy_plugin_cmp,
};
const tsk_object_def_t *twrap_proxy_plugin_def_t = &twrap_proxy_plugin_def_s;
static int pred_find_plugin_by_value(const tsk_list_item_t *item, const void *proxyPlugin)
{
- if(item && item->data){
- const twrap_proxy_plugin_t *twrap_plugin = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(item->data));
- return (twrap_plugin->plugin == dyn_cast<const ProxyPlugin *>((const ProxyPlugin*)proxyPlugin)) ? 0 : -1;
- }
- return -1;
+ if(item && item->data) {
+ const twrap_proxy_plugin_t *twrap_plugin = dyn_cast<const twrap_proxy_plugin_t *>(TWRAP_PROXY_PLUGIN(item->data));
+ return (twrap_plugin->plugin == dyn_cast<const ProxyPlugin *>((const ProxyPlugin*)proxyPlugin)) ? 0 : -1;
+ }
+ return -1;
}
static twrap_proxy_plugin_t* twrap_proxy_plugin_create(ProxyPlugin** plugin)
{
- if(!plugin || !*plugin){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- twrap_proxy_plugin_t* twrap_plugin = (twrap_proxy_plugin_t*)tsk_object_new(twrap_proxy_plugin_def_t);
- if(!twrap_plugin){
- TSK_DEBUG_ERROR("Failed to create new instance of 'twrap_proxy_plugin_t'");
- return tsk_null;
- }
-
- twrap_plugin->plugin = *plugin,
- *plugin = tsk_null;
- return twrap_plugin;
+ if(!plugin || !*plugin) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ twrap_proxy_plugin_t* twrap_plugin = (twrap_proxy_plugin_t*)tsk_object_new(twrap_proxy_plugin_def_t);
+ if(!twrap_plugin) {
+ TSK_DEBUG_ERROR("Failed to create new instance of 'twrap_proxy_plugin_t'");
+ return tsk_null;
+ }
+
+ twrap_plugin->plugin = *plugin,
+ *plugin = tsk_null;
+ return twrap_plugin;
}
diff --git a/bindings/_common/ProxyPluginMgr.h b/bindings/_common/ProxyPluginMgr.h
index 9644093..1bfd117 100755
--- a/bindings/_common/ProxyPluginMgr.h
+++ b/bindings/_common/ProxyPluginMgr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -33,12 +33,11 @@ class ProxyAudioProducer;
class ProxyVideoProducer;
class ProxyPluginMgrCallback;
-typedef enum twrap_proxy_plugin_type_e
-{
- twrap_proxy_plugin_audio_producer,
- twrap_proxy_plugin_video_producer,
- twrap_proxy_plugin_audio_consumer,
- twrap_proxy_plugin_video_consumer,
+typedef enum twrap_proxy_plugin_type_e {
+ twrap_proxy_plugin_audio_producer,
+ twrap_proxy_plugin_video_producer,
+ twrap_proxy_plugin_audio_consumer,
+ twrap_proxy_plugin_video_consumer,
}
twrap_proxy_plugin_type_t;
@@ -49,40 +48,42 @@ typedef tsk_list_t twrap_proxy_plungins_L_t; // contains "twrap_proxy_plungin_t"
class ProxyPluginMgr
{
private:
- ProxyPluginMgr(ProxyPluginMgrCallback* callback);
+ ProxyPluginMgr(ProxyPluginMgrCallback* callback);
public:
- virtual ~ProxyPluginMgr();
+ virtual ~ProxyPluginMgr();
- // SWIG %newobject
- static ProxyPluginMgr* createInstance(ProxyPluginMgrCallback* pCallback);
+ // SWIG %newobject
+ static ProxyPluginMgr* createInstance(ProxyPluginMgrCallback* pCallback);
#if !defined(SWIG)
- static void destroyInstance(ProxyPluginMgr** ppInstance);
+ static void destroyInstance(ProxyPluginMgr** ppInstance);
#endif
- static ProxyPluginMgr* getInstance();
+ static ProxyPluginMgr* getInstance();
#if !defined(SWIG)
- static uint64_t getUniqueId();
+ static uint64_t getUniqueId();
- int addPlugin(ProxyPlugin**);
- const ProxyPlugin* findPlugin(tsk_object_t* wrapped_plugin);
- int removePlugin(uint64_t id);
- int removePlugin(ProxyPlugin**);
+ int addPlugin(ProxyPlugin**);
+ const ProxyPlugin* findPlugin(tsk_object_t* wrapped_plugin);
+ int removePlugin(uint64_t id);
+ int removePlugin(ProxyPlugin**);
- inline ProxyPluginMgrCallback* getCallback(){ return this->callback; }
+ inline ProxyPluginMgrCallback* getCallback() {
+ return this->callback;
+ }
#endif
- const ProxyPlugin* findPlugin(uint64_t id);
+ const ProxyPlugin* findPlugin(uint64_t id);
- const ProxyAudioConsumer* findAudioConsumer(uint64_t id);
- const ProxyVideoConsumer* findVideoConsumer(uint64_t id);
- const ProxyAudioProducer* findAudioProducer(uint64_t id);
- const ProxyVideoProducer* findVideoProducer(uint64_t id);
+ const ProxyAudioConsumer* findAudioConsumer(uint64_t id);
+ const ProxyVideoConsumer* findVideoConsumer(uint64_t id);
+ const ProxyAudioProducer* findAudioProducer(uint64_t id);
+ const ProxyVideoProducer* findVideoProducer(uint64_t id);
private:
- static ProxyPluginMgr* instance;
- ProxyPluginMgrCallback* callback;
+ static ProxyPluginMgr* instance;
+ ProxyPluginMgrCallback* callback;
- twrap_proxy_plungins_L_t* plugins;
+ twrap_proxy_plungins_L_t* plugins;
};
@@ -90,11 +91,15 @@ private:
class ProxyPluginMgrCallback
{
public:
- ProxyPluginMgrCallback() { }
- virtual ~ProxyPluginMgrCallback() { }
-
- virtual int OnPluginCreated(uint64_t id, enum twrap_proxy_plugin_type_e type) { return -1; }
- virtual int OnPluginDestroyed(uint64_t id, enum twrap_proxy_plugin_type_e type) { return -1; }
+ ProxyPluginMgrCallback() { }
+ virtual ~ProxyPluginMgrCallback() { }
+
+ virtual int OnPluginCreated(uint64_t id, enum twrap_proxy_plugin_type_e type) {
+ return -1;
+ }
+ virtual int OnPluginDestroyed(uint64_t id, enum twrap_proxy_plugin_type_e type) {
+ return -1;
+ }
};
/* ============ ProxyPlugin Class ================= */
@@ -102,27 +107,31 @@ class ProxyPlugin
{
public:
#if !defined SWIG
- ProxyPlugin(twrap_proxy_plugin_type_t _type) {
- this->type=_type;
- this->id = ProxyPluginMgr::getUniqueId();
- }
+ ProxyPlugin(twrap_proxy_plugin_type_t _type) {
+ this->type=_type;
+ this->id = ProxyPluginMgr::getUniqueId();
+ }
#endif
- virtual ~ProxyPlugin() {}
-
+ virtual ~ProxyPlugin() {}
+
#if !defined(SWIG)
- virtual bool operator ==(const ProxyPlugin &plugin)const{
- return this->getId() == plugin.getId();
- }
- virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) = 0;
- virtual inline uint64_t getMediaSessionId() = 0;
+ virtual bool operator ==(const ProxyPlugin &plugin)const {
+ return this->getId() == plugin.getId();
+ }
+ virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) = 0;
+ virtual inline uint64_t getMediaSessionId() = 0;
#endif
- inline twrap_proxy_plugin_type_t getType()const{ return this->type; }
- inline uint64_t getId()const{ return this->id; }
+ inline twrap_proxy_plugin_type_t getType()const {
+ return this->type;
+ }
+ inline uint64_t getId()const {
+ return this->id;
+ }
protected:
- uint64_t id;
- twrap_proxy_plugin_type_t type;
+ uint64_t id;
+ twrap_proxy_plugin_type_t type;
};
#endif /* TINYWRAP_PROXY_PLUGIN_MGR_H */
diff --git a/bindings/_common/ProxyProducer.cxx b/bindings/_common/ProxyProducer.cxx
index 2cdb952..087a2d2 100755
--- a/bindings/_common/ProxyProducer.cxx
+++ b/bindings/_common/ProxyProducer.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -37,83 +37,82 @@
/* ============ Audio Media Producer Interface ================= */
-typedef struct twrap_producer_proxy_audio_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- uint64_t id;
- tsk_bool_t started;
+typedef struct twrap_producer_proxy_audio_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ uint64_t id;
+ tsk_bool_t started;
}
twrap_producer_proxy_audio_t;
#define TWRAP_PRODUCER_PROXY_AUDIO(self) ((twrap_producer_proxy_audio_t*)(self))
static int twrap_producer_proxy_audio_set(tmedia_producer_t* _self, const tmedia_param_t* param)
{
- twrap_producer_proxy_audio_t* self = (twrap_producer_proxy_audio_t*)_self;
- if(param->plugin_type == tmedia_ppt_producer){
- // specific proxy producer
- }
- return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
+ twrap_producer_proxy_audio_t* self = (twrap_producer_proxy_audio_t*)_self;
+ if(param->plugin_type == tmedia_ppt_producer) {
+ // specific proxy producer
+ }
+ return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int twrap_producer_proxy_audio_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if(codec && (manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioProducer* audioProducer;
- if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()){
- self->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
- self->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
- self->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
- ret = audioProducer->getCallback()->prepare((int)self->audio.ptime, self->audio.rate, self->audio.channels);
- }
- }
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if(codec && (manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioProducer* audioProducer;
+ if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()) {
+ self->audio.channels = TMEDIA_CODEC_CHANNELS_AUDIO_ENCODING(codec);
+ self->audio.rate = TMEDIA_CODEC_RATE_ENCODING(codec);
+ self->audio.ptime = TMEDIA_CODEC_PTIME_AUDIO_ENCODING(codec);
+ ret = audioProducer->getCallback()->prepare((int)self->audio.ptime, self->audio.rate, self->audio.channels);
+ }
+ }
+ return ret;
}
static int twrap_producer_proxy_audio_start(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioProducer* audioProducer;
- if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()){
- const_cast<ProxyAudioProducer*>(audioProducer)->startPushCallback();
- ret = audioProducer->getCallback()->start();
- }
- }
-
- TWRAP_PRODUCER_PROXY_AUDIO(self)->started = (ret == 0);
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioProducer* audioProducer;
+ if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()) {
+ const_cast<ProxyAudioProducer*>(audioProducer)->startPushCallback();
+ ret = audioProducer->getCallback()->start();
+ }
+ }
+
+ TWRAP_PRODUCER_PROXY_AUDIO(self)->started = (ret == 0);
+ return ret;
}
static int twrap_producer_proxy_audio_pause(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioProducer* audioProducer;
- if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()){
- ret = audioProducer->getCallback()->pause();
- }
- }
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioProducer* audioProducer;
+ if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()) {
+ ret = audioProducer->getCallback()->pause();
+ }
+ }
+ return ret;
}
static int twrap_producer_proxy_audio_stop(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyAudioProducer* audioProducer;
- if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()){
- const_cast<ProxyAudioProducer*>(audioProducer)->stopPushCallback();
- ret = audioProducer->getCallback()->stop();
- }
- }
- TWRAP_PRODUCER_PROXY_AUDIO(self)->started = (ret == 0) ? tsk_false : tsk_true;
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyAudioProducer* audioProducer;
+ if((audioProducer = manager->findAudioProducer(TWRAP_PRODUCER_PROXY_AUDIO(self)->id)) && audioProducer->getCallback()) {
+ const_cast<ProxyAudioProducer*>(audioProducer)->stopPushCallback();
+ ret = audioProducer->getCallback()->stop();
+ }
+ }
+ TWRAP_PRODUCER_PROXY_AUDIO(self)->started = (ret == 0) ? tsk_false : tsk_true;
+ return ret;
}
@@ -123,69 +122,67 @@ static int twrap_producer_proxy_audio_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* twrap_producer_proxy_audio_ctor(tsk_object_t * self, va_list * app)
{
- twrap_producer_proxy_audio_t *producer = (twrap_producer_proxy_audio_t *)self;
- if(producer){
- /* init base */
- tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
- /* init self */
-
- /* Add the plugin to the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- ProxyPlugin* proxyProducer = new ProxyAudioProducer(producer);
- uint64_t id = proxyProducer->getId();
- manager->addPlugin(&proxyProducer);
- manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_audio_producer);
- }
- }
- return self;
+ twrap_producer_proxy_audio_t *producer = (twrap_producer_proxy_audio_t *)self;
+ if(producer) {
+ /* init base */
+ tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(producer));
+ /* init self */
+
+ /* Add the plugin to the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ ProxyPlugin* proxyProducer = new ProxyAudioProducer(producer);
+ uint64_t id = proxyProducer->getId();
+ manager->addPlugin(&proxyProducer);
+ manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_audio_producer);
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* twrap_producer_proxy_audio_dtor(tsk_object_t * self)
-{
- twrap_producer_proxy_audio_t *producer = (twrap_producer_proxy_audio_t *)self;
- if(producer){
-
- /* stop */
- if(producer->started){
- twrap_producer_proxy_audio_stop(TMEDIA_PRODUCER(producer));
- }
-
- /* deinit base */
- tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
- /* deinit self */
-
- /* Remove plugin from the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- manager->getCallback()->OnPluginDestroyed(producer->id, twrap_proxy_plugin_audio_producer);
- manager->removePlugin(producer->id);
- }
- }
-
- return self;
+{
+ twrap_producer_proxy_audio_t *producer = (twrap_producer_proxy_audio_t *)self;
+ if(producer) {
+
+ /* stop */
+ if(producer->started) {
+ twrap_producer_proxy_audio_stop(TMEDIA_PRODUCER(producer));
+ }
+
+ /* deinit base */
+ tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(producer));
+ /* deinit self */
+
+ /* Remove plugin from the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ manager->getCallback()->OnPluginDestroyed(producer->id, twrap_proxy_plugin_audio_producer);
+ manager->removePlugin(producer->id);
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t twrap_producer_proxy_audio_def_s =
-{
- sizeof(twrap_producer_proxy_audio_t),
- twrap_producer_proxy_audio_ctor,
- twrap_producer_proxy_audio_dtor,
- tdav_producer_audio_cmp,
+static const tsk_object_def_t twrap_producer_proxy_audio_def_s = {
+ sizeof(twrap_producer_proxy_audio_t),
+ twrap_producer_proxy_audio_ctor,
+ twrap_producer_proxy_audio_dtor,
+ tdav_producer_audio_cmp,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t twrap_producer_proxy_audio_plugin_def_s =
-{
- &twrap_producer_proxy_audio_def_s,
-
- tmedia_audio,
- "Audio Proxy Producer",
-
- twrap_producer_proxy_audio_set,
- twrap_producer_proxy_audio_prepare,
- twrap_producer_proxy_audio_start,
- twrap_producer_proxy_audio_pause,
- twrap_producer_proxy_audio_stop
+static const tmedia_producer_plugin_def_t twrap_producer_proxy_audio_plugin_def_s = {
+ &twrap_producer_proxy_audio_def_s,
+
+ tmedia_audio,
+ "Audio Proxy Producer",
+
+ twrap_producer_proxy_audio_set,
+ twrap_producer_proxy_audio_prepare,
+ twrap_producer_proxy_audio_start,
+ twrap_producer_proxy_audio_pause,
+ twrap_producer_proxy_audio_stop
};
/*TINYWRAP_GEXTERN*/ const tmedia_producer_plugin_def_t *twrap_producer_proxy_audio_plugin_def_t = &twrap_producer_proxy_audio_plugin_def_s;
@@ -194,141 +191,141 @@ static const tmedia_producer_plugin_def_t twrap_producer_proxy_audio_plugin_def_
/* ============ ProxyAudioProducer Class ================= */
ProxyAudioProducer::ProxyAudioProducer(twrap_producer_proxy_audio_t* pProducer)
-:m_pCallback(tsk_null), m_pWrappedPlugin(pProducer), m_bUsePushCallback(false), m_hPushTimerMgr(tsk_null), ProxyPlugin(twrap_proxy_plugin_audio_producer)
+ :m_pCallback(tsk_null), m_pWrappedPlugin(pProducer), m_bUsePushCallback(false), m_hPushTimerMgr(tsk_null), ProxyPlugin(twrap_proxy_plugin_audio_producer)
{
- m_pWrappedPlugin->id = this->getId();
- m_PushBuffer.pPushBufferPtr = tsk_null;
- m_PushBuffer.nPushBufferSize = 0;
+ m_pWrappedPlugin->id = this->getId();
+ m_PushBuffer.pPushBufferPtr = tsk_null;
+ m_PushBuffer.nPushBufferSize = 0;
}
ProxyAudioProducer::~ProxyAudioProducer()
{
- stopPushCallback();
+ stopPushCallback();
}
// Use this function to request resampling when your sound card can't honor negotaited record parameters
bool ProxyAudioProducer::setActualSndCardRecordParams(int nPtime, int nRate, int nChannels)
{
- if(m_pWrappedPlugin){
- TSK_DEBUG_INFO("setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, nChannels);
- TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.ptime = nPtime;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.rate = nRate;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.channels = nChannels;
- return true;
- }
- else{
- TSK_DEBUG_ERROR("Invalid state");
- return false;
- }
+ if(m_pWrappedPlugin) {
+ TSK_DEBUG_INFO("setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, nChannels);
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.ptime = nPtime;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.rate = nRate;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.channels = nChannels;
+ return true;
+ }
+ else {
+ TSK_DEBUG_ERROR("Invalid state");
+ return false;
+ }
}
bool ProxyAudioProducer::setPushBuffer(const void* pPushBufferPtr, unsigned nPushBufferSize, bool bUsePushCallback/*=false*/)
{
- m_PushBuffer.pPushBufferPtr = pPushBufferPtr;
- m_PushBuffer.nPushBufferSize = nPushBufferSize;
- m_bUsePushCallback = bUsePushCallback;
+ m_PushBuffer.pPushBufferPtr = pPushBufferPtr;
+ m_PushBuffer.nPushBufferSize = nPushBufferSize;
+ m_bUsePushCallback = bUsePushCallback;
- if(!pPushBufferPtr || !nPushBufferSize || !bUsePushCallback){
- return stopPushCallback();
- }
- else if(m_bUsePushCallback && m_pWrappedPlugin && m_pWrappedPlugin->started){
- return startPushCallback();
- }
- return true;
+ if(!pPushBufferPtr || !nPushBufferSize || !bUsePushCallback) {
+ return stopPushCallback();
+ }
+ else if(m_bUsePushCallback && m_pWrappedPlugin && m_pWrappedPlugin->started) {
+ return startPushCallback();
+ }
+ return true;
}
int ProxyAudioProducer::push(const void* _pBuffer/*=tsk_null*/, unsigned _nSize/*=0*/)
{
- if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback){
- const void* pBuffer;
- unsigned nSize;
- if(_pBuffer && _nSize){
- pBuffer = _pBuffer, nSize = _nSize;
- }
- else{
- pBuffer = m_PushBuffer.pPushBufferPtr, nSize = m_PushBuffer.nPushBufferSize;
- }
- return TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback_data, pBuffer, nSize);
- }
- return 0;
+ if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback) {
+ const void* pBuffer;
+ unsigned nSize;
+ if(_pBuffer && _nSize) {
+ pBuffer = _pBuffer, nSize = _nSize;
+ }
+ else {
+ pBuffer = m_PushBuffer.pPushBufferPtr, nSize = m_PushBuffer.nPushBufferSize;
+ }
+ return TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback_data, pBuffer, nSize);
+ }
+ return 0;
}
bool ProxyAudioProducer::setGain(unsigned nGain)
{
- if(m_pWrappedPlugin){
- // see also: MediaSessionMgr.producerSetInt32(org.doubango.tinyWRAP.twrap_media_type_t.twrap_media_audio, "gain", nGain);
- TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.gain = TSK_MIN(nGain,14);
- return true;
- }
- return false;
+ if(m_pWrappedPlugin) {
+ // see also: MediaSessionMgr.producerSetInt32(org.doubango.tinyWRAP.twrap_media_type_t.twrap_media_audio, "gain", nGain);
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.gain = TSK_MIN(nGain,14);
+ return true;
+ }
+ return false;
}
unsigned ProxyAudioProducer::getGain()
{
- if(m_pWrappedPlugin){
- return TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.gain;
- }
- return 0;
+ if(m_pWrappedPlugin) {
+ return TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.gain;
+ }
+ return 0;
}
bool ProxyAudioProducer::startPushCallback()
{
- if(!m_bUsePushCallback){
- return true;
- }
-
- if(!m_pWrappedPlugin){
- TSK_DEBUG_ERROR("Not wrapping plugin");
- return false;
- }
-
- if(!m_hPushTimerMgr){
- if(!(m_hPushTimerMgr = tsk_timer_manager_create())){
- TSK_DEBUG_ERROR("Failed to create timer manager");
- return false;
- }
- }
-
- if(!TSK_RUNNABLE(m_hPushTimerMgr)->started){
- if((tsk_timer_manager_start(m_hPushTimerMgr)) == 0){
- m_uPushTimer = tsk_timer_manager_schedule(m_hPushTimerMgr, TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.ptime, &ProxyAudioProducer::pushTimerCallback, this);
- }
- else{
- TSK_DEBUG_ERROR("Failed to start timer");
- return false;
- }
- }
- return true;
+ if(!m_bUsePushCallback) {
+ return true;
+ }
+
+ if(!m_pWrappedPlugin) {
+ TSK_DEBUG_ERROR("Not wrapping plugin");
+ return false;
+ }
+
+ if(!m_hPushTimerMgr) {
+ if(!(m_hPushTimerMgr = tsk_timer_manager_create())) {
+ TSK_DEBUG_ERROR("Failed to create timer manager");
+ return false;
+ }
+ }
+
+ if(!TSK_RUNNABLE(m_hPushTimerMgr)->started) {
+ if((tsk_timer_manager_start(m_hPushTimerMgr)) == 0) {
+ m_uPushTimer = tsk_timer_manager_schedule(m_hPushTimerMgr, TMEDIA_PRODUCER(m_pWrappedPlugin)->audio.ptime, &ProxyAudioProducer::pushTimerCallback, this);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to start timer");
+ return false;
+ }
+ }
+ return true;
}
bool ProxyAudioProducer::stopPushCallback()
{
- if(m_hPushTimerMgr){
- tsk_timer_manager_destroy(&m_hPushTimerMgr);
- }
- return true;
+ if(m_hPushTimerMgr) {
+ tsk_timer_manager_destroy(&m_hPushTimerMgr);
+ }
+ return true;
}
int ProxyAudioProducer::pushTimerCallback(const void* arg, tsk_timer_id_t timer_id)
{
- ProxyAudioProducer* This = (ProxyAudioProducer*)arg;
+ ProxyAudioProducer* This = (ProxyAudioProducer*)arg;
- This->m_uPushTimer = tsk_timer_manager_schedule(This->m_hPushTimerMgr, TMEDIA_PRODUCER(This->m_pWrappedPlugin)->audio.ptime, &ProxyAudioProducer::pushTimerCallback, This);
+ This->m_uPushTimer = tsk_timer_manager_schedule(This->m_hPushTimerMgr, TMEDIA_PRODUCER(This->m_pWrappedPlugin)->audio.ptime, &ProxyAudioProducer::pushTimerCallback, This);
- if(This->m_pCallback){
- if(This->m_pCallback->fillPushBuffer() == 0){
- return This->push();
- }
- }
- return 0;
+ if(This->m_pCallback) {
+ if(This->m_pCallback->fillPushBuffer() == 0) {
+ return This->push();
+ }
+ }
+ return 0;
}
bool ProxyAudioProducer::registerPlugin()
{
- /* HACK: Unregister all other audio plugins */
- tmedia_producer_plugin_unregister_by_type(tmedia_audio);
- /* Register our proxy plugin */
- return (tmedia_producer_plugin_register(twrap_producer_proxy_audio_plugin_def_t) == 0);
+ /* HACK: Unregister all other audio plugins */
+ tmedia_producer_plugin_unregister_by_type(tmedia_audio);
+ /* Register our proxy plugin */
+ return (tmedia_producer_plugin_register(twrap_producer_proxy_audio_plugin_def_t) == 0);
}
@@ -354,18 +351,17 @@ bool ProxyAudioProducer::registerPlugin()
/* ============ Video Media Producer Interface ================= */
-typedef struct twrap_producer_proxy_video_s
-{
- TMEDIA_DECLARE_PRODUCER;
+typedef struct twrap_producer_proxy_video_s {
+ TMEDIA_DECLARE_PRODUCER;
- int rotation;
- uint64_t id;
- tsk_bool_t started;
+ int rotation;
+ uint64_t id;
+ tsk_bool_t started;
#if 0
- // https://code.google.com/p/doubango/issues/detail?id=416
- // The lock on the producer is useless because all tinyDAV proxied functions (push(), stop(), prepare()...) are already thread safe.
- // Locking the push method while tinDAV locks the stop() function produce a deadlock on Android devices with slow video producer implementations (e.g. Hovis Box v1)
- TSK_DECLARE_SAFEOBJ;
+ // https://code.google.com/p/doubango/issues/detail?id=416
+ // The lock on the producer is useless because all tinyDAV proxied functions (push(), stop(), prepare()...) are already thread safe.
+ // Locking the push method while tinDAV locks the stop() function produce a deadlock on Android devices with slow video producer implementations (e.g. Hovis Box v1)
+ TSK_DECLARE_SAFEOBJ;
#endif
}
twrap_producer_proxy_video_t;
@@ -373,67 +369,67 @@ twrap_producer_proxy_video_t;
int twrap_producer_proxy_video_set(tmedia_producer_t* self, const tmedia_param_t* params)
{
- return 0;
+ return 0;
}
int twrap_producer_proxy_video_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if(codec && (manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoProducer* videoProducer;
- if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()){
- self->video.chroma = videoProducer->getChroma();
- self->video.rotation = videoProducer->getRotation();
- ret = videoProducer->getCallback()->prepare(TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height, TMEDIA_CODEC_VIDEO(codec)->out.fps);
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if(codec && (manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoProducer* videoProducer;
+ if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()) {
+ self->video.chroma = videoProducer->getChroma();
+ self->video.rotation = videoProducer->getRotation();
+ ret = videoProducer->getCallback()->prepare(TMEDIA_CODEC_VIDEO(codec)->out.width, TMEDIA_CODEC_VIDEO(codec)->out.height, TMEDIA_CODEC_VIDEO(codec)->out.fps);
+ }
+ }
+
+ return ret;
}
int twrap_producer_proxy_video_start(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoProducer* videoProducer;
- if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()){
- ret = videoProducer->getCallback()->start();
- TWRAP_PRODUCER_PROXY_VIDEO(self)->started = (ret == 0);
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoProducer* videoProducer;
+ if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()) {
+ ret = videoProducer->getCallback()->start();
+ TWRAP_PRODUCER_PROXY_VIDEO(self)->started = (ret == 0);
+ }
+ }
+
+ return ret;
}
int twrap_producer_proxy_video_pause(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoProducer* videoProducer;
- if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()){
- ret = videoProducer->getCallback()->pause();
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoProducer* videoProducer;
+ if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()) {
+ ret = videoProducer->getCallback()->pause();
+ }
+ }
+
+ return ret;
}
int twrap_producer_proxy_video_stop(tmedia_producer_t* self)
{
- ProxyPluginMgr* manager;
- int ret = -1;
- if((manager = ProxyPluginMgr::getInstance())){
- const ProxyVideoProducer* videoProducer;
- if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()){
- ret = videoProducer->getCallback()->stop();
- TWRAP_PRODUCER_PROXY_VIDEO(self)->started = ((ret == 0) ? tsk_false : tsk_true);
- }
- }
-
- return ret;
+ ProxyPluginMgr* manager;
+ int ret = -1;
+ if((manager = ProxyPluginMgr::getInstance())) {
+ const ProxyVideoProducer* videoProducer;
+ if((videoProducer = manager->findVideoProducer(TWRAP_PRODUCER_PROXY_VIDEO(self)->id)) && videoProducer->getCallback()) {
+ ret = videoProducer->getCallback()->stop();
+ TWRAP_PRODUCER_PROXY_VIDEO(self)->started = ((ret == 0) ? tsk_false : tsk_true);
+ }
+ }
+
+ return ret;
}
@@ -443,69 +439,67 @@ int twrap_producer_proxy_video_stop(tmedia_producer_t* self)
/* constructor */
static tsk_object_t* twrap_producer_proxy_video_ctor(tsk_object_t * self, va_list * app)
{
- twrap_producer_proxy_video_t *producer = (twrap_producer_proxy_video_t *)self;
- if(producer){
- /* init base */
- tmedia_producer_init(TMEDIA_PRODUCER(producer));
- /* init self */
-
- /* Add the plugin to the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- ProxyPlugin* proxyProducer = new ProxyVideoProducer(ProxyVideoProducer::getDefaultChroma(), producer);
- uint64_t id = proxyProducer->getId();
- manager->addPlugin(&proxyProducer);
- manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_video_producer);
- }
- }
- return self;
+ twrap_producer_proxy_video_t *producer = (twrap_producer_proxy_video_t *)self;
+ if(producer) {
+ /* init base */
+ tmedia_producer_init(TMEDIA_PRODUCER(producer));
+ /* init self */
+
+ /* Add the plugin to the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ ProxyPlugin* proxyProducer = new ProxyVideoProducer(ProxyVideoProducer::getDefaultChroma(), producer);
+ uint64_t id = proxyProducer->getId();
+ manager->addPlugin(&proxyProducer);
+ manager->getCallback()->OnPluginCreated(id, twrap_proxy_plugin_video_producer);
+ }
+ }
+ return self;
}
/* destructor */
static tsk_object_t* twrap_producer_proxy_video_dtor(tsk_object_t * self)
-{
- twrap_producer_proxy_video_t *producer = (twrap_producer_proxy_video_t *)self;
- if(producer){
- TSK_DEBUG_INFO("twrap_producer_proxy_video_dtor()");
- /* stop */
- if(producer->started){
- twrap_producer_proxy_video_stop(TMEDIA_PRODUCER(producer));
- }
-
- /* deinit base */
- tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
- /* deinit self */
-
- /* Remove plugin from the manager */
- ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
- if(manager){
- manager->getCallback()->OnPluginDestroyed(producer->id, twrap_proxy_plugin_video_producer);
- manager->removePlugin(producer->id);
- }
- }
-
- return self;
+{
+ twrap_producer_proxy_video_t *producer = (twrap_producer_proxy_video_t *)self;
+ if(producer) {
+ TSK_DEBUG_INFO("twrap_producer_proxy_video_dtor()");
+ /* stop */
+ if(producer->started) {
+ twrap_producer_proxy_video_stop(TMEDIA_PRODUCER(producer));
+ }
+
+ /* deinit base */
+ tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
+ /* deinit self */
+
+ /* Remove plugin from the manager */
+ ProxyPluginMgr* manager = ProxyPluginMgr::getInstance();
+ if(manager) {
+ manager->getCallback()->OnPluginDestroyed(producer->id, twrap_proxy_plugin_video_producer);
+ manager->removePlugin(producer->id);
+ }
+ }
+
+ return self;
}
/* object definition */
-static const tsk_object_def_t twrap_producer_proxy_video_def_s =
-{
- sizeof(twrap_producer_proxy_video_t),
- twrap_producer_proxy_video_ctor,
- twrap_producer_proxy_video_dtor,
- tsk_null,
+static const tsk_object_def_t twrap_producer_proxy_video_def_s = {
+ sizeof(twrap_producer_proxy_video_t),
+ twrap_producer_proxy_video_ctor,
+ twrap_producer_proxy_video_dtor,
+ tsk_null,
};
/* plugin definition*/
-static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_s =
-{
- &twrap_producer_proxy_video_def_s,
-
- tmedia_video,
- "Video Proxy Producer",
-
- twrap_producer_proxy_video_set,
- twrap_producer_proxy_video_prepare,
- twrap_producer_proxy_video_start,
- twrap_producer_proxy_video_pause,
- twrap_producer_proxy_video_stop
+static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_s = {
+ &twrap_producer_proxy_video_def_s,
+
+ tmedia_video,
+ "Video Proxy Producer",
+
+ twrap_producer_proxy_video_set,
+ twrap_producer_proxy_video_prepare,
+ twrap_producer_proxy_video_start,
+ twrap_producer_proxy_video_pause,
+ twrap_producer_proxy_video_stop
};
/*TINYWRAP_GEXTERN*/ const tmedia_producer_plugin_def_t *twrap_producer_proxy_video_plugin_def_t = &twrap_producer_proxy_video_plugin_def_s;
@@ -516,111 +510,111 @@ static const tmedia_producer_plugin_def_t twrap_producer_proxy_video_plugin_def_
tmedia_chroma_t ProxyVideoProducer::s_eDefaultChroma = tmedia_chroma_nv21;
ProxyVideoProducer::ProxyVideoProducer(tmedia_chroma_t eChroma, struct twrap_producer_proxy_video_s* pProducer)
-:m_pCallback(tsk_null), m_eChroma(eChroma), m_nRotation(0), m_bMirror(false), m_pWrappedPlugin(pProducer), ProxyPlugin(twrap_proxy_plugin_video_producer)
+ :m_pCallback(tsk_null), m_eChroma(eChroma), m_nRotation(0), m_bMirror(false), m_pWrappedPlugin(pProducer), ProxyPlugin(twrap_proxy_plugin_video_producer)
{
- if(m_pWrappedPlugin){
- m_pWrappedPlugin->id = this->getId();
- }
+ if(m_pWrappedPlugin) {
+ m_pWrappedPlugin->id = this->getId();
+ }
}
ProxyVideoProducer::~ProxyVideoProducer()
{
- TSK_DEBUG_INFO("~ProxyVideoProducer");
+ TSK_DEBUG_INFO("~ProxyVideoProducer");
}
int ProxyVideoProducer::getRotation()const
{
- return m_nRotation;
+ return m_nRotation;
}
bool ProxyVideoProducer::setRotation(int nRot)
{
- m_nRotation = nRot;
- if (m_pWrappedPlugin) {
- TMEDIA_PRODUCER(m_pWrappedPlugin)->video.rotation = m_nRotation;
- return true;
- }
- return false;
+ m_nRotation = nRot;
+ if (m_pWrappedPlugin) {
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->video.rotation = m_nRotation;
+ return true;
+ }
+ return false;
}
bool ProxyVideoProducer::getMirror()const
{
- return m_bMirror;
+ return m_bMirror;
}
bool ProxyVideoProducer::setMirror(bool bMirror)
{
- m_bMirror = bMirror;
- if (m_pWrappedPlugin) {
- TMEDIA_PRODUCER(m_pWrappedPlugin)->video.mirror = m_bMirror ? tsk_true : tsk_false;
- return true;
- }
- return false;
+ m_bMirror = bMirror;
+ if (m_pWrappedPlugin) {
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->video.mirror = m_bMirror ? tsk_true : tsk_false;
+ return true;
+ }
+ return false;
}
// alert the encoder which size your camera is using because it's very hard to retrieve it from send(buffer, size) function
// this function is only needed if the actual size (output from your camera) is different than the negociated one
bool ProxyVideoProducer::setActualCameraOutputSize(unsigned nWidth, unsigned nHeight)
{
- if(m_pWrappedPlugin){
- TMEDIA_PRODUCER(m_pWrappedPlugin)->video.width = nWidth;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->video.height = nHeight;
- return true;
- }
- return false;
+ if(m_pWrappedPlugin) {
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->video.width = nWidth;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->video.height = nHeight;
+ return true;
+ }
+ return false;
}
// encode() then send()
int ProxyVideoProducer::push(const void* pBuffer, unsigned nSize)
{
- if (m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback) {
- int ret = -1;
- if (m_pWrappedPlugin->started) {
- ret = TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback_data, pBuffer, nSize);
- }
- return ret;
- }
- return 0;
+ if (m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback) {
+ int ret = -1;
+ if (m_pWrappedPlugin->started) {
+ ret = TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback(TMEDIA_PRODUCER(m_pWrappedPlugin)->enc_cb.callback_data, pBuffer, nSize);
+ }
+ return ret;
+ }
+ return 0;
}
// send() "as is"
// only used by telepresence system with a H.264 SVC hardaware encoder
int ProxyVideoProducer::sendRaw(const void* pBuffer, unsigned nSize, unsigned nDuration, bool bMarker)
{
- if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback){
- //tmedia_video_encode_result_reset(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
+ if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback) {
+ //tmedia_video_encode_result_reset(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.ptr = pBuffer;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.size = nSize;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.duration = nDuration;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.last_chunck = (bMarker == true);
- return TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
- }
- return 0;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.ptr = pBuffer;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.size = nSize;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.duration = nDuration;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.last_chunck = (bMarker == true);
+ return TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
+ }
+ return 0;
}
int ProxyVideoProducer::sendRaw(const void* pBuffer, unsigned nSize, const void* proto_hdr)
{
- if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback){
- //tmedia_video_encode_result_reset(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
+ if(m_pWrappedPlugin && TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback) {
+ //tmedia_video_encode_result_reset(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.ptr = pBuffer;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.size = nSize;
- TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.proto_hdr = proto_hdr;
- return TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
- }
- return 0;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.ptr = pBuffer;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.buffer.size = nSize;
+ TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr.proto_hdr = proto_hdr;
+ return TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.callback(&TMEDIA_PRODUCER(m_pWrappedPlugin)->raw_cb.chunck_curr);
+ }
+ return 0;
}
tmedia_chroma_t ProxyVideoProducer::getChroma()const
{
- return m_eChroma;
+ return m_eChroma;
}
bool ProxyVideoProducer::registerPlugin()
{
- /* HACK: Unregister all other video plugins */
- tmedia_producer_plugin_unregister_by_type(tmedia_video);
- /* Register our proxy plugin */
- return (tmedia_producer_plugin_register(twrap_producer_proxy_video_plugin_def_t) == 0);
+ /* HACK: Unregister all other video plugins */
+ tmedia_producer_plugin_unregister_by_type(tmedia_video);
+ /* Register our proxy plugin */
+ return (tmedia_producer_plugin_register(twrap_producer_proxy_video_plugin_def_t) == 0);
}
diff --git a/bindings/_common/ProxyProducer.h b/bindings/_common/ProxyProducer.h
index 83ed673..4a4ea66 100755
--- a/bindings/_common/ProxyProducer.h
+++ b/bindings/_common/ProxyProducer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -41,15 +41,25 @@
class ProxyAudioProducerCallback
{
public:
- ProxyAudioProducerCallback() { }
- virtual ~ProxyAudioProducerCallback(){ }
-
- virtual int prepare(int ptime, int rate, int channels) { return -1; }
- virtual int start() { return -1; }
- virtual int pause() { return -1; }
- virtual int stop() { return -1; }
- // this function is called to signal that it's time to copy push data
- virtual int fillPushBuffer(){ return -1; }
+ ProxyAudioProducerCallback() { }
+ virtual ~ProxyAudioProducerCallback() { }
+
+ virtual int prepare(int ptime, int rate, int channels) {
+ return -1;
+ }
+ virtual int start() {
+ return -1;
+ }
+ virtual int pause() {
+ return -1;
+ }
+ virtual int stop() {
+ return -1;
+ }
+ // this function is called to signal that it's time to copy push data
+ virtual int fillPushBuffer() {
+ return -1;
+ }
};
@@ -58,61 +68,75 @@ class ProxyAudioProducer : public ProxyPlugin
{
public:
#if !defined(SWIG)
- ProxyAudioProducer(struct twrap_producer_proxy_audio_s* pProducer);
+ ProxyAudioProducer(struct twrap_producer_proxy_audio_s* pProducer);
#endif
- virtual ~ProxyAudioProducer();
-
- bool setActualSndCardRecordParams(int nPtime, int nRate, int nChannels);
- bool setPushBuffer(const void* pPushBufferPtr, unsigned nPushBufferSize, bool bUsePushCallback=false);
- int push(const void* pBuffer=tsk_null, unsigned nSize=0);
- bool setGain(unsigned nGain);
- unsigned getGain();
- void setCallback(ProxyAudioProducerCallback* pCallback) { m_pCallback = pCallback; }
+ virtual ~ProxyAudioProducer();
+
+ bool setActualSndCardRecordParams(int nPtime, int nRate, int nChannels);
+ bool setPushBuffer(const void* pPushBufferPtr, unsigned nPushBufferSize, bool bUsePushCallback=false);
+ int push(const void* pBuffer=tsk_null, unsigned nSize=0);
+ bool setGain(unsigned nGain);
+ unsigned getGain();
+ void setCallback(ProxyAudioProducerCallback* pCallback) {
+ m_pCallback = pCallback;
+ }
#if !defined(SWIG)
- inline bool usePushCallback(){ return m_bUsePushCallback; }
- inline ProxyAudioProducerCallback* getCallback()const { return m_pCallback; }
- virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin){
- return m_pWrappedPlugin == pWrappedPlugin;
- }
+ inline bool usePushCallback() {
+ return m_bUsePushCallback;
+ }
+ inline ProxyAudioProducerCallback* getCallback()const {
+ return m_pCallback;
+ }
+ virtual inline bool isWrapping(tsk_object_t* pWrappedPlugin) {
+ return m_pWrappedPlugin == pWrappedPlugin;
+ }
#endif
- virtual inline uint64_t getMediaSessionId(){
- return m_pWrappedPlugin ? TMEDIA_PRODUCER(m_pWrappedPlugin)->session_id : 0;
- }
+ virtual inline uint64_t getMediaSessionId() {
+ return m_pWrappedPlugin ? TMEDIA_PRODUCER(m_pWrappedPlugin)->session_id : 0;
+ }
#if !defined(SWIG)
public:
- bool startPushCallback();
- bool stopPushCallback();
+ bool startPushCallback();
+ bool stopPushCallback();
private:
- static int pushTimerCallback(const void* arg, tsk_timer_id_t timer_id);
+ static int pushTimerCallback(const void* arg, tsk_timer_id_t timer_id);
#endif
public:
- static bool registerPlugin();
+ static bool registerPlugin();
private:
- struct twrap_producer_proxy_audio_s* m_pWrappedPlugin;
- ProxyAudioProducerCallback* m_pCallback;
- struct{
- const void* pPushBufferPtr;
- unsigned nPushBufferSize;
- } m_PushBuffer;
- bool m_bUsePushCallback;
- void* m_hPushTimerMgr;
- uint64_t m_uPushTimer;
+ struct twrap_producer_proxy_audio_s* m_pWrappedPlugin;
+ ProxyAudioProducerCallback* m_pCallback;
+ struct {
+ const void* pPushBufferPtr;
+ unsigned nPushBufferSize;
+ } m_PushBuffer;
+ bool m_bUsePushCallback;
+ void* m_hPushTimerMgr;
+ uint64_t m_uPushTimer;
};
/* ============ ProxyVideoProducerCallback Class ================= */
class ProxyVideoProducerCallback
{
public:
- ProxyVideoProducerCallback() { }
- virtual ~ProxyVideoProducerCallback(){ }
-
- virtual int prepare(int width, int height, int fps) { return -1; }
- virtual int start() { return -1; }
- virtual int pause() { return -1; }
- virtual int stop() { return -1; }
+ ProxyVideoProducerCallback() { }
+ virtual ~ProxyVideoProducerCallback() { }
+
+ virtual int prepare(int width, int height, int fps) {
+ return -1;
+ }
+ virtual int start() {
+ return -1;
+ }
+ virtual int pause() {
+ return -1;
+ }
+ virtual int stop() {
+ return -1;
+ }
};
/* ============ ProxyVideoProducer Class ================= */
@@ -120,49 +144,57 @@ class ProxyVideoProducer : public ProxyPlugin
{
public:
#if !defined(SWIG)
- ProxyVideoProducer(tmedia_chroma_t eChroma, struct twrap_producer_proxy_video_s* pProducer);
+ ProxyVideoProducer(tmedia_chroma_t eChroma, struct twrap_producer_proxy_video_s* pProducer);
#endif
- virtual ~ProxyVideoProducer();
-
- int getRotation()const;
- bool setRotation(int nRot);
- bool getMirror()const;
- bool setMirror(bool bMirror);
- bool setActualCameraOutputSize(unsigned nWidth, unsigned nHeight);
- int push(const void* pBuffer, unsigned nSize);
- void setCallback(ProxyVideoProducerCallback* pCallback) { m_pCallback = pCallback; }
+ virtual ~ProxyVideoProducer();
+
+ int getRotation()const;
+ bool setRotation(int nRot);
+ bool getMirror()const;
+ bool setMirror(bool bMirror);
+ bool setActualCameraOutputSize(unsigned nWidth, unsigned nHeight);
+ int push(const void* pBuffer, unsigned nSize);
+ void setCallback(ProxyVideoProducerCallback* pCallback) {
+ m_pCallback = pCallback;
+ }
#if !defined(SWIG)
- int sendRaw(const void* pBuffer, unsigned nSize, unsigned nDuration, bool bMarker);
- int sendRaw(const void* pBuffer, unsigned nSize, const void* proto_hdr);
- inline ProxyVideoProducerCallback* getCallback()const { return m_pCallback; }
- virtual inline bool isWrapping(tsk_object_t* wrapped_plugin){
- return m_pWrappedPlugin == wrapped_plugin;
- }
- virtual inline const tmedia_producer_t* getWrappedPlugin()const{
- return (tmedia_producer_t*)m_pWrappedPlugin;
- }
+ int sendRaw(const void* pBuffer, unsigned nSize, unsigned nDuration, bool bMarker);
+ int sendRaw(const void* pBuffer, unsigned nSize, const void* proto_hdr);
+ inline ProxyVideoProducerCallback* getCallback()const {
+ return m_pCallback;
+ }
+ virtual inline bool isWrapping(tsk_object_t* wrapped_plugin) {
+ return m_pWrappedPlugin == wrapped_plugin;
+ }
+ virtual inline const tmedia_producer_t* getWrappedPlugin()const {
+ return (tmedia_producer_t*)m_pWrappedPlugin;
+ }
#endif
- virtual inline uint64_t getMediaSessionId(){
- return m_pWrappedPlugin ? TMEDIA_PRODUCER(m_pWrappedPlugin)->session_id : 0;
- }
+ virtual inline uint64_t getMediaSessionId() {
+ return m_pWrappedPlugin ? TMEDIA_PRODUCER(m_pWrappedPlugin)->session_id : 0;
+ }
public:
- static bool registerPlugin();
- static void setDefaultChroma(tmedia_chroma_t eChroma){ s_eDefaultChroma = eChroma; }
+ static bool registerPlugin();
+ static void setDefaultChroma(tmedia_chroma_t eChroma) {
+ s_eDefaultChroma = eChroma;
+ }
#if !defined(SWIG)
- tmedia_chroma_t getChroma()const;
- static tmedia_chroma_t getDefaultChroma() { return s_eDefaultChroma; }
+ tmedia_chroma_t getChroma()const;
+ static tmedia_chroma_t getDefaultChroma() {
+ return s_eDefaultChroma;
+ }
#endif
private:
- struct twrap_producer_proxy_video_s* m_pWrappedPlugin;
- ProxyVideoProducerCallback* m_pCallback;
- tmedia_chroma_t m_eChroma;
- int m_nRotation;
- bool m_bMirror;
+ struct twrap_producer_proxy_video_s* m_pWrappedPlugin;
+ ProxyVideoProducerCallback* m_pCallback;
+ tmedia_chroma_t m_eChroma;
+ int m_nRotation;
+ bool m_bMirror;
- static tmedia_chroma_t s_eDefaultChroma;
+ static tmedia_chroma_t s_eDefaultChroma;
};
#endif /* TINYWRAP_PRODUCER_PROXY_H */
diff --git a/bindings/_common/SMSEncoder.cxx b/bindings/_common/SMSEncoder.cxx
index 7fc24cd..d07ab2b 100755
--- a/bindings/_common/SMSEncoder.cxx
+++ b/bindings/_common/SMSEncoder.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@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.
*
@@ -26,351 +26,346 @@
RPMessage::RPMessage(twrap_rpmessage_type_t _type, tsms_rpdu_message_t* _rp_message)
{
- this->rp_message = (tsms_rpdu_message_t*)tsk_object_ref(_rp_message);
- this->type = _type;
- this->tmpBuffer = tsk_null;
+ this->rp_message = (tsms_rpdu_message_t*)tsk_object_ref(_rp_message);
+ this->type = _type;
+ this->tmpBuffer = tsk_null;
}
-RPMessage::RPMessage() :
- rp_message(tsk_null),
- type(twrap_rpmessage_type_sms_none),
- tmpBuffer(tsk_null)
+RPMessage::RPMessage() :
+ rp_message(tsk_null),
+ type(twrap_rpmessage_type_sms_none),
+ tmpBuffer(tsk_null)
{
}
twrap_rpmessage_type_t RPMessage::getType()
{
- return this->type;
+ return this->type;
}
unsigned RPMessage::getPayloadLength()
{
- if(!this->tmpBuffer){
- if((this->tmpBuffer = tsk_buffer_create_null())){
- tsms_rpdu_data_serialize(this->rp_message, this->tmpBuffer);
- }
- }
- return this->tmpBuffer ? this->tmpBuffer->size : 0;
+ if(!this->tmpBuffer) {
+ if((this->tmpBuffer = tsk_buffer_create_null())) {
+ tsms_rpdu_data_serialize(this->rp_message, this->tmpBuffer);
+ }
+ }
+ return this->tmpBuffer ? this->tmpBuffer->size : 0;
}
unsigned RPMessage::getPayload(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
-
- if(!this->tmpBuffer){
- if((this->tmpBuffer = tsk_buffer_create_null())){
- tsms_rpdu_message_serialize(this->rp_message, this->tmpBuffer);
- }
- }
-
- if(output && maxsize && this->tmpBuffer && this->tmpBuffer->data){
- retsize = (this->tmpBuffer->size > maxsize) ? maxsize : this->tmpBuffer->size;
- memcpy(output, this->tmpBuffer->data, retsize);
- }
- return retsize;
+ unsigned retsize = 0;
+
+ if(!this->tmpBuffer) {
+ if((this->tmpBuffer = tsk_buffer_create_null())) {
+ tsms_rpdu_message_serialize(this->rp_message, this->tmpBuffer);
+ }
+ }
+
+ if(output && maxsize && this->tmpBuffer && this->tmpBuffer->data) {
+ retsize = (this->tmpBuffer->size > maxsize) ? maxsize : this->tmpBuffer->size;
+ memcpy(output, this->tmpBuffer->data, retsize);
+ }
+ return retsize;
}
RPMessage::~RPMessage()
{
- TSK_OBJECT_SAFE_FREE(this->rp_message);
- TSK_OBJECT_SAFE_FREE(this->tmpBuffer);
+ TSK_OBJECT_SAFE_FREE(this->rp_message);
+ TSK_OBJECT_SAFE_FREE(this->tmpBuffer);
}
SMSData::SMSData(twrap_sms_type_t _type, int _mr, const void* _ascii, tsk_size_t _size): oa(tsk_null), da(tsk_null)
{
- this->type = _type;
- this->mr = _mr;
- if((this->size = _size)){
- if((this->ascii = tsk_calloc(size+1, 1))){
- memcpy(this->ascii, _ascii, _size);
- }
- }
- else{
- this->ascii = tsk_null;
- }
+ this->type = _type;
+ this->mr = _mr;
+ if((this->size = _size)) {
+ if((this->ascii = tsk_calloc(size+1, 1))) {
+ memcpy(this->ascii, _ascii, _size);
+ }
+ }
+ else {
+ this->ascii = tsk_null;
+ }
}
SMSData::SMSData(): oa(tsk_null), da(tsk_null)
{
- this->type = twrap_sms_type_none;
- this->mr = 0;
- this->size = 0;
- this->ascii = tsk_null;
+ this->type = twrap_sms_type_none;
+ this->mr = 0;
+ this->size = 0;
+ this->ascii = tsk_null;
}
SMSData::~SMSData()
{
- TSK_FREE(this->ascii);
- TSK_FREE(this->oa);
- TSK_FREE(this->da);
+ TSK_FREE(this->ascii);
+ TSK_FREE(this->oa);
+ TSK_FREE(this->da);
}
twrap_sms_type_t SMSData::getType()
{
- return this->type;
+ return this->type;
}
int SMSData::getMR()
{
- return this->mr;
+ return this->mr;
}
unsigned SMSData::getPayloadLength()
{
- return this->size;
+ return this->size;
}
unsigned SMSData::getPayload(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
-
- if(output && maxsize && this->ascii){
- retsize = (this->size > maxsize) ? maxsize : this->size;
- memcpy(output, this->ascii, retsize);
- }
- return retsize;
+ unsigned retsize = 0;
+
+ if(output && maxsize && this->ascii) {
+ retsize = (this->size > maxsize) ? maxsize : this->size;
+ memcpy(output, this->ascii, retsize);
+ }
+ return retsize;
}
const char* SMSData::getOA()
{
- return this->oa;
+ return this->oa;
}
const char* SMSData::getDA()
{
- return this->da;
+ return this->da;
}
void SMSData::setOA(const char* _oa)
{
- TSK_FREE(this->oa);
- this->oa = tsk_strdup(_oa);
+ TSK_FREE(this->oa);
+ this->oa = tsk_strdup(_oa);
}
void SMSData::setDA(const char* _da)
{
- TSK_FREE(this->da);
- this->da = tsk_strdup(_da);
+ TSK_FREE(this->da);
+ this->da = tsk_strdup(_da);
}
// More information about RP-DATA: http://www.doubango.org/API/tinySMS/group__tsms__rpdu__group.html#tsms_rpdu_group_DATA
RPMessage* SMSEncoder::encodeSubmit(int mr, const char *smsc, const char *destination, const char *ascii)
{
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_submit_t* sms_submit = tsk_null;
- tsms_rpdu_data_t* rp_data = tsk_null;
-
- RPMessage* encodedData = tsk_null;
-
- if(!smsc || ! destination || !ascii){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(mr<0 || mr>0xFF){
- TSK_DEBUG_WARN("Invalid Message Reference");
- mr &= 0xFF;
- }
-
- // create SMS-SUBMIT message
- if(!(sms_submit = tsms_tpdu_submit_create(mr, (const uint8_t*)smsc, (const uint8_t*)destination))){
- TSK_DEBUG_ERROR("Failed to create the TPDU SMS-SUBMIT message");
- goto bail;
- }
- // Set content for SMS-SUBMIT
- if((buffer = tsms_pack_to_7bit(ascii))){
- ret = tsms_tpdu_submit_set_userdata(sms_submit, buffer, tsms_alpha_7bit);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- else{
- TSK_DEBUG_ERROR("Failed to encode the TPDU SMS-SUBMIT message");
- goto bail;
- }
-
- // create RP-DATA(SMS-SUBMIT)
- if((rp_data = tsms_rpdu_data_create_mo(mr, (const uint8_t*)smsc, TSMS_TPDU_MESSAGE(sms_submit)))){
- encodedData = new RPMessage(twrap_rpmessage_type_sms_submit, TSMS_RPDU_MESSAGE(rp_data));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create the RP-DATA(SMS-SUBMIT) message");
- goto bail;
- }
-
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_submit_t* sms_submit = tsk_null;
+ tsms_rpdu_data_t* rp_data = tsk_null;
+
+ RPMessage* encodedData = tsk_null;
+
+ if(!smsc || ! destination || !ascii) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(mr<0 || mr>0xFF) {
+ TSK_DEBUG_WARN("Invalid Message Reference");
+ mr &= 0xFF;
+ }
+
+ // create SMS-SUBMIT message
+ if(!(sms_submit = tsms_tpdu_submit_create(mr, (const uint8_t*)smsc, (const uint8_t*)destination))) {
+ TSK_DEBUG_ERROR("Failed to create the TPDU SMS-SUBMIT message");
+ goto bail;
+ }
+ // Set content for SMS-SUBMIT
+ if((buffer = tsms_pack_to_7bit(ascii))) {
+ ret = tsms_tpdu_submit_set_userdata(sms_submit, buffer, tsms_alpha_7bit);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to encode the TPDU SMS-SUBMIT message");
+ goto bail;
+ }
+
+ // create RP-DATA(SMS-SUBMIT)
+ if((rp_data = tsms_rpdu_data_create_mo(mr, (const uint8_t*)smsc, TSMS_TPDU_MESSAGE(sms_submit)))) {
+ encodedData = new RPMessage(twrap_rpmessage_type_sms_submit, TSMS_RPDU_MESSAGE(rp_data));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create the RP-DATA(SMS-SUBMIT) message");
+ goto bail;
+ }
+
bail:
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(sms_submit);
- TSK_OBJECT_SAFE_FREE(rp_data);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sms_submit);
+ TSK_OBJECT_SAFE_FREE(rp_data);
- return encodedData;
+ return encodedData;
}
// More information about RP-DATA: http://www.doubango.org/API/tinySMS/group__tsms__rpdu__group.html#tsms_rpdu_group_DATA
RPMessage* SMSEncoder::encodeDeliver(int mr, const char* smsc, const char* originator, const char* ascii)
{
- int ret;
- tsk_buffer_t* buffer = tsk_null;
- tsms_tpdu_deliver_t* sms_deliver = tsk_null;
- tsms_rpdu_data_t* rp_data = tsk_null;
-
- RPMessage* encodedData = tsk_null;
-
- if(!smsc || ! originator || !ascii){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if(mr<0 || mr>0xFF){
- TSK_DEBUG_WARN("Invalid Message Reference");
- mr &= 0xFF;
- }
-
- // create SMS-DELIVER message
- sms_deliver = tsms_tpdu_deliver_create((const uint8_t*)smsc, (const uint8_t*)originator);
- // Set content for SMS-DELIVER
- if((buffer = tsms_pack_to_7bit(ascii))){
- ret = tsms_tpdu_deliver_set_userdata(sms_deliver, buffer, tsms_alpha_7bit);
- TSK_OBJECT_SAFE_FREE(buffer);
- }
- // create RP-DATA message
- if((rp_data = tsms_rpdu_data_create_mt(mr, (const uint8_t*)smsc, TSMS_TPDU_MESSAGE(sms_deliver)))){
- encodedData = new RPMessage(twrap_rpmessage_type_sms_deliver, TSMS_RPDU_MESSAGE(rp_data));
- }
- else{
- TSK_DEBUG_ERROR("Failed to create the RP-DATA(SMS-DELIVER) message");
- goto bail;
- }
+ int ret;
+ tsk_buffer_t* buffer = tsk_null;
+ tsms_tpdu_deliver_t* sms_deliver = tsk_null;
+ tsms_rpdu_data_t* rp_data = tsk_null;
+
+ RPMessage* encodedData = tsk_null;
+
+ if(!smsc || ! originator || !ascii) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if(mr<0 || mr>0xFF) {
+ TSK_DEBUG_WARN("Invalid Message Reference");
+ mr &= 0xFF;
+ }
+
+ // create SMS-DELIVER message
+ sms_deliver = tsms_tpdu_deliver_create((const uint8_t*)smsc, (const uint8_t*)originator);
+ // Set content for SMS-DELIVER
+ if((buffer = tsms_pack_to_7bit(ascii))) {
+ ret = tsms_tpdu_deliver_set_userdata(sms_deliver, buffer, tsms_alpha_7bit);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ }
+ // create RP-DATA message
+ if((rp_data = tsms_rpdu_data_create_mt(mr, (const uint8_t*)smsc, TSMS_TPDU_MESSAGE(sms_deliver)))) {
+ encodedData = new RPMessage(twrap_rpmessage_type_sms_deliver, TSMS_RPDU_MESSAGE(rp_data));
+ }
+ else {
+ TSK_DEBUG_ERROR("Failed to create the RP-DATA(SMS-DELIVER) message");
+ goto bail;
+ }
bail:
- TSK_OBJECT_SAFE_FREE(buffer);
- TSK_OBJECT_SAFE_FREE(sms_deliver);
- TSK_OBJECT_SAFE_FREE(rp_data);
+ TSK_OBJECT_SAFE_FREE(buffer);
+ TSK_OBJECT_SAFE_FREE(sms_deliver);
+ TSK_OBJECT_SAFE_FREE(rp_data);
- return encodedData;
+ return encodedData;
}
RPMessage* SMSEncoder::encodeACK(int mr, const char* smsc, const char* destination, bool forSUBMIT)
{
- tsms_tpdu_report_t* sms_report = tsk_null;
- tsms_rpdu_ack_t* rp_ack = tsk_null;
- tsk_bool_t isSUBMIT = forSUBMIT ? tsk_true : tsk_false;
- tsk_bool_t isERROR = tsk_false;
-
- RPMessage* encodedData = tsk_null;
-
- // create SMS-DELIVER(or SUBMIT)-REPORT message
- sms_report = tsms_tpdu_report_create((const uint8_t*)smsc, isSUBMIT, isERROR);
- // create RP-ACK message (From MS to SC)
- if((rp_ack = tsms_rpdu_ack_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report)))){
- encodedData = new RPMessage(twrap_rpmessage_type_sms_ack, TSMS_RPDU_MESSAGE(rp_ack));
- }
-
- TSK_OBJECT_SAFE_FREE(sms_report);
- TSK_OBJECT_SAFE_FREE(rp_ack);
-
- return encodedData;
+ tsms_tpdu_report_t* sms_report = tsk_null;
+ tsms_rpdu_ack_t* rp_ack = tsk_null;
+ tsk_bool_t isSUBMIT = forSUBMIT ? tsk_true : tsk_false;
+ tsk_bool_t isERROR = tsk_false;
+
+ RPMessage* encodedData = tsk_null;
+
+ // create SMS-DELIVER(or SUBMIT)-REPORT message
+ sms_report = tsms_tpdu_report_create((const uint8_t*)smsc, isSUBMIT, isERROR);
+ // create RP-ACK message (From MS to SC)
+ if((rp_ack = tsms_rpdu_ack_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report)))) {
+ encodedData = new RPMessage(twrap_rpmessage_type_sms_ack, TSMS_RPDU_MESSAGE(rp_ack));
+ }
+
+ TSK_OBJECT_SAFE_FREE(sms_report);
+ TSK_OBJECT_SAFE_FREE(rp_ack);
+
+ return encodedData;
}
RPMessage* SMSEncoder::encodeError(int mr, const char* smsc, const char* destination, bool forSUBMIT)
{
- tsms_tpdu_report_t* sms_report = tsk_null;
- tsms_rpdu_error_t* rp_error= tsk_null;
- tsk_bool_t isSUBMIT = forSUBMIT ? tsk_true : tsk_false;
- tsk_bool_t isERROR = tsk_true;
+ tsms_tpdu_report_t* sms_report = tsk_null;
+ tsms_rpdu_error_t* rp_error= tsk_null;
+ tsk_bool_t isSUBMIT = forSUBMIT ? tsk_true : tsk_false;
+ tsk_bool_t isERROR = tsk_true;
- RPMessage* encodedData = tsk_null;
+ RPMessage* encodedData = tsk_null;
- // create SMS-DELIVER-REPORT message
- sms_report = tsms_tpdu_report_create((const uint8_t*)smsc, isSUBMIT, isERROR);
- // create RP-ERROR message
- if((rp_error = tsms_rpdu_error_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report), 0x0A/*call barred*/))){
- encodedData = new RPMessage(twrap_rpmessage_type_sms_error, TSMS_RPDU_MESSAGE(rp_error));
- }
+ // create SMS-DELIVER-REPORT message
+ sms_report = tsms_tpdu_report_create((const uint8_t*)smsc, isSUBMIT, isERROR);
+ // create RP-ERROR message
+ if((rp_error = tsms_rpdu_error_create_mo(mr, TSMS_TPDU_MESSAGE(sms_report), 0x0A/*call barred*/))) {
+ encodedData = new RPMessage(twrap_rpmessage_type_sms_error, TSMS_RPDU_MESSAGE(rp_error));
+ }
- TSK_OBJECT_SAFE_FREE(sms_report);
- TSK_OBJECT_SAFE_FREE(rp_error);
+ TSK_OBJECT_SAFE_FREE(sms_report);
+ TSK_OBJECT_SAFE_FREE(rp_error);
- return encodedData;
+ return encodedData;
}
SMSData* SMSEncoder::decode(const void* data, unsigned size, bool MobOrig)
{
- tsms_rpdu_message_t* rp_message = tsk_null;
- tsms_tpdu_message_t* tpdu = tsk_null;
-
- SMSData* decodedData = tsk_null;
-
- if(!(rp_message = tsms_rpdu_message_deserialize(data, size))){
- TSK_DEBUG_ERROR("Failed to deserialize the RP-MESSAGE");
- goto bail;
- }
-
- switch(rp_message->mti){
- case tsms_rpdu_type_data_mo:
- case tsms_rpdu_type_data_mt:
- {
- char* ascii = tsk_null;
- tsms_rpdu_data_t* rp_data = TSMS_RPDU_DATA(rp_message);
- if((tpdu = tsms_tpdu_message_deserialize(rp_data->udata->data, rp_data->udata->size, MobOrig))){
- if(tpdu->mti == tsms_tpdu_mti_deliver_mt || tpdu->mti == tsms_tpdu_mti_submit_mo){ /* SMS-SUBMIT or SMS-DELIVER? */
- ascii = tsms_tpdu_message_get_payload(tpdu);
- decodedData = new SMSData(twrap_sms_type_rpdata, rp_message->mr, ascii, (tsk_size_t)tsk_strlen(ascii));
-
- if(tpdu->mti == tsms_tpdu_mti_deliver_mt){
- tsms_tpdu_deliver_t* tpdu_deliver = (tsms_tpdu_deliver_t*)tpdu;
- decodedData->setOA(tpdu_deliver->oa ? tpdu_deliver->oa->digits : tsk_null);
- }
- /* IMPORTANT: to not uncomment
- else if(TSK_OBJECT_DEF(tpdu) == tsms_tpdu_submit_def_t){
- tsms_tpdu_submit_t* tpdu_submit = (tsms_tpdu_submit_t*)tpdu;
- decodedData->setDA(tpdu_submit->da ? tpdu_submit->da->digits : tsk_null);
- }*/
- TSK_FREE(ascii);
- }
- }
- break;
- }
- case tsms_rpdu_type_ack_mo:
- case tsms_rpdu_type_ack_mt:
- {
- tsms_rpdu_ack_t* rp_ack = TSMS_RPDU_ACK(rp_message);
- // ...do whatever you want
- if(rp_ack->udata && (tpdu = tsms_tpdu_message_deserialize(rp_ack->udata->data, rp_ack->udata->size, MobOrig))){
- // ...do whatever you want
- }
- decodedData = new SMSData(twrap_sms_type_ack, rp_message->mr, tsk_null, 0);
- break;
- }
- case tsms_rpdu_type_error_mo:
- case tsms_rpdu_type_error_mt:
- {
- tsms_rpdu_error_t* rp_error = TSMS_RPDU_ERROR(rp_message);
- // ...do whatever you want
- if(rp_error->udata && (tpdu = tsms_tpdu_message_deserialize(rp_error->udata->data, rp_error->udata->size, MobOrig))){
- // ...do whatever you want
- }
- decodedData = new SMSData(twrap_sms_type_error, rp_message->mr, tsk_null, 0);
- break;
- }
- case tsms_rpdu_type_smma_mo:
- {
- // tsms_rpdu_smma_t* rp_smma = TSMS_RPDU_SMMA(rp_message);
- // ...do whatever you want
- decodedData = new SMSData(twrap_sms_type_smma, rp_message->mr, tsk_null, 0);
- break;
- }
- default:
- {
- TSK_DEBUG_INFO("Unknown RP-Message type (%u).", rp_message->mti);
- break;
- }
- }
+ tsms_rpdu_message_t* rp_message = tsk_null;
+ tsms_tpdu_message_t* tpdu = tsk_null;
+
+ SMSData* decodedData = tsk_null;
+
+ if(!(rp_message = tsms_rpdu_message_deserialize(data, size))) {
+ TSK_DEBUG_ERROR("Failed to deserialize the RP-MESSAGE");
+ goto bail;
+ }
+
+ switch(rp_message->mti) {
+ case tsms_rpdu_type_data_mo:
+ case tsms_rpdu_type_data_mt: {
+ char* ascii = tsk_null;
+ tsms_rpdu_data_t* rp_data = TSMS_RPDU_DATA(rp_message);
+ if((tpdu = tsms_tpdu_message_deserialize(rp_data->udata->data, rp_data->udata->size, MobOrig))) {
+ if(tpdu->mti == tsms_tpdu_mti_deliver_mt || tpdu->mti == tsms_tpdu_mti_submit_mo) { /* SMS-SUBMIT or SMS-DELIVER? */
+ ascii = tsms_tpdu_message_get_payload(tpdu);
+ decodedData = new SMSData(twrap_sms_type_rpdata, rp_message->mr, ascii, (tsk_size_t)tsk_strlen(ascii));
+
+ if(tpdu->mti == tsms_tpdu_mti_deliver_mt) {
+ tsms_tpdu_deliver_t* tpdu_deliver = (tsms_tpdu_deliver_t*)tpdu;
+ decodedData->setOA(tpdu_deliver->oa ? tpdu_deliver->oa->digits : tsk_null);
+ }
+ /* IMPORTANT: to not uncomment
+ else if(TSK_OBJECT_DEF(tpdu) == tsms_tpdu_submit_def_t){
+ tsms_tpdu_submit_t* tpdu_submit = (tsms_tpdu_submit_t*)tpdu;
+ decodedData->setDA(tpdu_submit->da ? tpdu_submit->da->digits : tsk_null);
+ }*/
+ TSK_FREE(ascii);
+ }
+ }
+ break;
+ }
+ case tsms_rpdu_type_ack_mo:
+ case tsms_rpdu_type_ack_mt: {
+ tsms_rpdu_ack_t* rp_ack = TSMS_RPDU_ACK(rp_message);
+ // ...do whatever you want
+ if(rp_ack->udata && (tpdu = tsms_tpdu_message_deserialize(rp_ack->udata->data, rp_ack->udata->size, MobOrig))) {
+ // ...do whatever you want
+ }
+ decodedData = new SMSData(twrap_sms_type_ack, rp_message->mr, tsk_null, 0);
+ break;
+ }
+ case tsms_rpdu_type_error_mo:
+ case tsms_rpdu_type_error_mt: {
+ tsms_rpdu_error_t* rp_error = TSMS_RPDU_ERROR(rp_message);
+ // ...do whatever you want
+ if(rp_error->udata && (tpdu = tsms_tpdu_message_deserialize(rp_error->udata->data, rp_error->udata->size, MobOrig))) {
+ // ...do whatever you want
+ }
+ decodedData = new SMSData(twrap_sms_type_error, rp_message->mr, tsk_null, 0);
+ break;
+ }
+ case tsms_rpdu_type_smma_mo: {
+ // tsms_rpdu_smma_t* rp_smma = TSMS_RPDU_SMMA(rp_message);
+ // ...do whatever you want
+ decodedData = new SMSData(twrap_sms_type_smma, rp_message->mr, tsk_null, 0);
+ break;
+ }
+ default: {
+ TSK_DEBUG_INFO("Unknown RP-Message type (%u).", rp_message->mti);
+ break;
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(rp_message);
- TSK_OBJECT_SAFE_FREE(tpdu);
+ TSK_OBJECT_SAFE_FREE(rp_message);
+ TSK_OBJECT_SAFE_FREE(tpdu);
- return decodedData;
+ return decodedData;
} \ No newline at end of file
diff --git a/bindings/_common/SMSEncoder.h b/bindings/_common/SMSEncoder.h
index 597f978..f38c9d4 100755
--- a/bindings/_common/SMSEncoder.h
+++ b/bindings/_common/SMSEncoder.h
@@ -2,19 +2,19 @@
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@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.
*
@@ -27,23 +27,21 @@
#include "tinysip.h" /* SIP/IMS */
#include "tinysms.h" /* Binary SMS API*/
-typedef enum twrap_rpmessage_type_e
-{
- twrap_rpmessage_type_sms_none,
- twrap_rpmessage_type_sms_submit,
- twrap_rpmessage_type_sms_deliver,
- twrap_rpmessage_type_sms_ack,
- twrap_rpmessage_type_sms_error,
+typedef enum twrap_rpmessage_type_e {
+ twrap_rpmessage_type_sms_none,
+ twrap_rpmessage_type_sms_submit,
+ twrap_rpmessage_type_sms_deliver,
+ twrap_rpmessage_type_sms_ack,
+ twrap_rpmessage_type_sms_error,
}
twrap_rpmessage_type_t;
-typedef enum twrap_sms_type_e
-{
- twrap_sms_type_none,
- twrap_sms_type_rpdata,
- twrap_sms_type_smma,
- twrap_sms_type_ack,
- twrap_sms_type_error,
+typedef enum twrap_sms_type_e {
+ twrap_sms_type_none,
+ twrap_sms_type_rpdata,
+ twrap_sms_type_smma,
+ twrap_sms_type_ack,
+ twrap_sms_type_error,
}
twrap_sms_type_t;
@@ -51,65 +49,65 @@ class RPMessage
{
public:
#if !defined(SWIG)
- RPMessage(twrap_rpmessage_type_t type, tsms_rpdu_message_t* rp_message);
+ RPMessage(twrap_rpmessage_type_t type, tsms_rpdu_message_t* rp_message);
#endif
- RPMessage();
+ RPMessage();
- virtual ~RPMessage();
+ virtual ~RPMessage();
public:
- /* Public API functions */
- twrap_rpmessage_type_t getType();
- unsigned getPayloadLength();
- unsigned getPayload(void* output, unsigned maxsize);
+ /* Public API functions */
+ twrap_rpmessage_type_t getType();
+ unsigned getPayloadLength();
+ unsigned getPayload(void* output, unsigned maxsize);
private:
- twrap_rpmessage_type_t type;
- tsms_rpdu_message_t* rp_message;
+ twrap_rpmessage_type_t type;
+ tsms_rpdu_message_t* rp_message;
- tsk_buffer_t* tmpBuffer;
+ tsk_buffer_t* tmpBuffer;
};
class SMSData
{
public:
#if !defined(SWIG)
- SMSData(twrap_sms_type_t type, int mr, const void* ascii, tsk_size_t size);
+ SMSData(twrap_sms_type_t type, int mr, const void* ascii, tsk_size_t size);
#endif
- SMSData();
+ SMSData();
- virtual ~SMSData();
+ virtual ~SMSData();
public:
- /* Public API functions */
- twrap_sms_type_t getType();
- int getMR();
- unsigned getPayloadLength();
- unsigned getPayload(void* output, unsigned maxsize);
- const char* getOA();
- const char* getDA();
+ /* Public API functions */
+ twrap_sms_type_t getType();
+ int getMR();
+ unsigned getPayloadLength();
+ unsigned getPayload(void* output, unsigned maxsize);
+ const char* getOA();
+ const char* getDA();
#if !defined(SWIG)
- void setOA(const char* oa);
- void setDA(const char* da);
+ void setOA(const char* oa);
+ void setDA(const char* da);
#endif
private:
- twrap_sms_type_t type;
- int mr;
- void* ascii;
- char* oa;
- char* da;
- tsk_size_t size;
+ twrap_sms_type_t type;
+ int mr;
+ void* ascii;
+ char* oa;
+ char* da;
+ tsk_size_t size;
};
class SMSEncoder
{
public:
- static RPMessage* encodeSubmit(int mr, const char* smsc, const char* destination, const char* ascii);
- static RPMessage* encodeDeliver(int mr, const char* smsc, const char* originator, const char* ascii);
- static RPMessage* encodeACK(int mr, const char* smsc, const char* destination, bool forSUBMIT);
- static RPMessage* encodeError(int mr, const char* smsc, const char* destination, bool forSUBMIT);
- static SMSData* decode(const void* data, unsigned size, bool MobOrig);
+ static RPMessage* encodeSubmit(int mr, const char* smsc, const char* destination, const char* ascii);
+ static RPMessage* encodeDeliver(int mr, const char* smsc, const char* originator, const char* ascii);
+ static RPMessage* encodeACK(int mr, const char* smsc, const char* destination, bool forSUBMIT);
+ static RPMessage* encodeError(int mr, const char* smsc, const char* destination, bool forSUBMIT);
+ static SMSData* decode(const void* data, unsigned size, bool MobOrig);
};
#endif /* TINYWRAP_SMSENCODER_H */
diff --git a/bindings/_common/SafeObject.cxx b/bindings/_common/SafeObject.cxx
index 9d51696..b0dfc01 100755
--- a/bindings/_common/SafeObject.cxx
+++ b/bindings/_common/SafeObject.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -23,20 +23,20 @@
SafeObject::SafeObject()
{
- this->mutex = tsk_mutex_create();
+ this->mutex = tsk_mutex_create();
}
int SafeObject::Lock()const
{
- return tsk_mutex_lock(this->mutex);
+ return tsk_mutex_lock(this->mutex);
}
int SafeObject::UnLock()const
{
- return tsk_mutex_unlock(this->mutex);
+ return tsk_mutex_unlock(this->mutex);
}
SafeObject::~SafeObject()
{
- tsk_mutex_destroy(&this->mutex);
+ tsk_mutex_destroy(&this->mutex);
}
diff --git a/bindings/_common/SafeObject.h b/bindings/_common/SafeObject.h
index 1b4e6bd..bb290b7 100755
--- a/bindings/_common/SafeObject.h
+++ b/bindings/_common/SafeObject.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -29,15 +29,15 @@
class TINYWRAP_API SafeObject
{
public:
- SafeObject();
- virtual ~SafeObject();
+ SafeObject();
+ virtual ~SafeObject();
-/* protected: */
- int Lock()const;
- int UnLock()const;
+ /* protected: */
+ int Lock()const;
+ int UnLock()const;
private:
- tsk_mutex_handle_t *mutex;
+ tsk_mutex_handle_t *mutex;
};
#endif /* TINYWRAP_SAFEOBJECT_H */
diff --git a/bindings/_common/SipCallback.cxx b/bindings/_common/SipCallback.cxx
index 995327e..5785bd9 100755
--- a/bindings/_common/SipCallback.cxx
+++ b/bindings/_common/SipCallback.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
diff --git a/bindings/_common/SipCallback.h b/bindings/_common/SipCallback.h
index f7e1b98..c402628 100755
--- a/bindings/_common/SipCallback.h
+++ b/bindings/_common/SipCallback.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -36,21 +36,39 @@ class SubscriptionEvent;
class SipCallback
{
public:
- SipCallback() { }
- virtual ~SipCallback() {}
- virtual int OnDialogEvent(const DialogEvent* e) { return -1; }
- virtual int OnStackEvent(const StackEvent* e) { return -1; }
+ SipCallback() { }
+ virtual ~SipCallback() {}
+ virtual int OnDialogEvent(const DialogEvent* e) {
+ return -1;
+ }
+ virtual int OnStackEvent(const StackEvent* e) {
+ return -1;
+ }
- virtual int OnInviteEvent(const InviteEvent* e) { return -1; }
- virtual int OnMessagingEvent(const MessagingEvent* e) { return -1; }
- virtual int OnInfoEvent(const InfoEvent* e) { return -1; }
- virtual int OnOptionsEvent(const OptionsEvent* e) { return -1; }
- virtual int OnPublicationEvent(const PublicationEvent* e) { return -1; }
- virtual int OnRegistrationEvent(const RegistrationEvent* e) { return -1; }
- virtual int OnSubscriptionEvent(const SubscriptionEvent* e) { return -1; }
+ virtual int OnInviteEvent(const InviteEvent* e) {
+ return -1;
+ }
+ virtual int OnMessagingEvent(const MessagingEvent* e) {
+ return -1;
+ }
+ virtual int OnInfoEvent(const InfoEvent* e) {
+ return -1;
+ }
+ virtual int OnOptionsEvent(const OptionsEvent* e) {
+ return -1;
+ }
+ virtual int OnPublicationEvent(const PublicationEvent* e) {
+ return -1;
+ }
+ virtual int OnRegistrationEvent(const RegistrationEvent* e) {
+ return -1;
+ }
+ virtual int OnSubscriptionEvent(const SubscriptionEvent* e) {
+ return -1;
+ }
private:
-
+
};
#endif /* TINYWRAP_SIPCALLBACK_H */
diff --git a/bindings/_common/SipEvent.cxx b/bindings/_common/SipEvent.cxx
index 3518f4a..cc8a8eb 100755
--- a/bindings/_common/SipEvent.cxx
+++ b/bindings/_common/SipEvent.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -38,78 +38,78 @@ name##Session* cls##Event::take##session##Ownership() const \
} \
return tsk_null; \
} \
-
+
/* ======================== SipEvent ========================*/
SipEvent::SipEvent(const tsip_event_t *_sipevent)
{
- this->sipevent = _sipevent;
- if(_sipevent){
- this->sipmessage = new SipMessage(_sipevent->sipmessage);
- }
- else{
- this->sipmessage = tsk_null;
- }
+ this->sipevent = _sipevent;
+ if(_sipevent) {
+ this->sipmessage = new SipMessage(_sipevent->sipmessage);
+ }
+ else {
+ this->sipmessage = tsk_null;
+ }
}
SipEvent::~SipEvent()
{
- if(this->sipmessage){
- delete this->sipmessage;
- }
+ if(this->sipmessage) {
+ delete this->sipmessage;
+ }
}
short SipEvent::getCode() const
{
- return this->sipevent->code;
+ return this->sipevent->code;
}
const char* SipEvent::getPhrase() const
{
- return this->sipevent->phrase;
+ return this->sipevent->phrase;
}
const SipSession* SipEvent::getBaseSession() const
{
- const void* userdata = tsip_ssession_get_userdata(this->sipevent->ss);
- if(userdata){
- return dyn_cast<const SipSession*>((const SipSession*)userdata);
- }
- return tsk_null;
+ const void* userdata = tsip_ssession_get_userdata(this->sipevent->ss);
+ if(userdata) {
+ return dyn_cast<const SipSession*>((const SipSession*)userdata);
+ }
+ return tsk_null;
}
const SipMessage* SipEvent::getSipMessage() const
{
- return this->sipmessage;
+ return this->sipmessage;
}
SipStack* SipEvent::getStack()const
{
- const tsip_stack_handle_t* stack_handle = tsip_ssession_get_stack(sipevent->ss);
- const void* userdata;
- if(stack_handle && (userdata = tsip_stack_get_userdata(stack_handle))){
- return dyn_cast<SipStack*>((SipStack*)userdata);
- }
- return tsk_null;
+ const tsip_stack_handle_t* stack_handle = tsip_ssession_get_stack(sipevent->ss);
+ const void* userdata;
+ if(stack_handle && (userdata = tsip_stack_get_userdata(stack_handle))) {
+ return dyn_cast<SipStack*>((SipStack*)userdata);
+ }
+ return tsk_null;
}
/* ======================== DialogEvent ========================*/
DialogEvent::DialogEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent){ }
+ :SipEvent(_sipevent) { }
-DialogEvent::~DialogEvent(){ }
+DialogEvent::~DialogEvent() { }
/* ======================== DialogEvent ========================*/
StackEvent::StackEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent){ }
+ :SipEvent(_sipevent) { }
-StackEvent::~StackEvent(){ }
+StackEvent::~StackEvent() { }
/* ======================== InviteEvent ========================*/
InviteEvent::InviteEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -119,27 +119,27 @@ InviteEvent::~InviteEvent()
tsip_invite_event_type_t InviteEvent::getType() const
{
- return TSIP_INVITE_EVENT(this->sipevent)->type;
+ return TSIP_INVITE_EVENT(this->sipevent)->type;
}
twrap_media_type_t InviteEvent::getMediaType() const
{
- // Ignore Mixed session (both audio/video and MSRP) as specified by GSMA RCS.
- if (this->sipevent && this->sipevent->ss) {
- tmedia_type_t type = tsip_ssession_get_mediatype(this->sipevent->ss);
- if ((type & tmedia_msrp) == tmedia_msrp) {
- return twrap_media_msrp;
- }
- else {
- return twrap_get_wrapped_media_type(type);
- }
- }
- return twrap_media_none;
+ // Ignore Mixed session (both audio/video and MSRP) as specified by GSMA RCS.
+ if (this->sipevent && this->sipevent->ss) {
+ tmedia_type_t type = tsip_ssession_get_mediatype(this->sipevent->ss);
+ if ((type & tmedia_msrp) == tmedia_msrp) {
+ return twrap_media_msrp;
+ }
+ else {
+ return twrap_get_wrapped_media_type(type);
+ }
+ }
+ return twrap_media_none;
}
const InviteSession* InviteEvent::getSession() const
{
- return dyn_cast<const InviteSession*>(this->getBaseSession());
+ return dyn_cast<const InviteSession*>(this->getBaseSession());
}
takeOwnership_Implement(Invite, Call, CallSession);
@@ -147,7 +147,7 @@ takeOwnership_Implement(Invite, Msrp, MsrpSession);
/* ======================== MessagingEvent ========================*/
MessagingEvent::MessagingEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -157,12 +157,12 @@ MessagingEvent::~MessagingEvent()
tsip_message_event_type_t MessagingEvent::getType() const
{
- return TSIP_MESSAGE_EVENT(this->sipevent)->type;
+ return TSIP_MESSAGE_EVENT(this->sipevent)->type;
}
const MessagingSession* MessagingEvent::getSession() const
{
- return dyn_cast<const MessagingSession*>(this->getBaseSession());
+ return dyn_cast<const MessagingSession*>(this->getBaseSession());
}
takeOwnership_Implement(Messaging, Messaging, Session);
@@ -170,7 +170,7 @@ takeOwnership_Implement(Messaging, Messaging, Session);
/* ======================== InfoEvent ========================*/
InfoEvent::InfoEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -180,12 +180,12 @@ InfoEvent::~InfoEvent()
tsip_info_event_type_t InfoEvent::getType() const
{
- return TSIP_INFO_EVENT(this->sipevent)->type;
+ return TSIP_INFO_EVENT(this->sipevent)->type;
}
const InfoSession* InfoEvent::getSession() const
{
- return dyn_cast<const InfoSession*>(this->getBaseSession());
+ return dyn_cast<const InfoSession*>(this->getBaseSession());
}
takeOwnership_Implement(Info, Info, Session);
@@ -194,7 +194,7 @@ takeOwnership_Implement(Info, Info, Session);
/* ======================== OptionsEvent ========================*/
OptionsEvent::OptionsEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -204,12 +204,12 @@ OptionsEvent::~OptionsEvent()
tsip_options_event_type_t OptionsEvent::getType() const
{
- return TSIP_OPTIONS_EVENT(this->sipevent)->type;
+ return TSIP_OPTIONS_EVENT(this->sipevent)->type;
}
const OptionsSession* OptionsEvent::getSession() const
{
- return dyn_cast<const OptionsSession*>(this->getBaseSession());
+ return dyn_cast<const OptionsSession*>(this->getBaseSession());
}
takeOwnership_Implement(Options, Options, Session);
@@ -217,7 +217,7 @@ takeOwnership_Implement(Options, Options, Session);
/* ======================== PublicationEvent ========================*/
PublicationEvent::PublicationEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -227,12 +227,12 @@ PublicationEvent::~PublicationEvent()
tsip_publish_event_type_t PublicationEvent::getType() const
{
- return TSIP_PUBLISH_EVENT(this->sipevent)->type;
+ return TSIP_PUBLISH_EVENT(this->sipevent)->type;
}
const PublicationSession* PublicationEvent::getSession() const
{
- return dyn_cast<const PublicationSession*>(this->getBaseSession());
+ return dyn_cast<const PublicationSession*>(this->getBaseSession());
}
takeOwnership_Implement(Publication, Publication, Session);
@@ -240,7 +240,7 @@ takeOwnership_Implement(Publication, Publication, Session);
/* ======================== RegistrationEvent ========================*/
RegistrationEvent::RegistrationEvent(const tsip_event_t *_sipevent)
-:SipEvent(_sipevent)
+ :SipEvent(_sipevent)
{
}
@@ -250,12 +250,12 @@ RegistrationEvent::~RegistrationEvent()
tsip_register_event_type_t RegistrationEvent::getType() const
{
- return TSIP_REGISTER_EVENT(this->sipevent)->type;
+ return TSIP_REGISTER_EVENT(this->sipevent)->type;
}
const RegistrationSession* RegistrationEvent::getSession() const
{
- return dyn_cast<const RegistrationSession*>(this->getBaseSession());
+ return dyn_cast<const RegistrationSession*>(this->getBaseSession());
}
takeOwnership_Implement(Registration, Registration, Session);
@@ -263,7 +263,7 @@ takeOwnership_Implement(Registration, Registration, Session);
/* ======================== SubscriptionEvent ========================*/
SubscriptionEvent::SubscriptionEvent(const tsip_event_t *sipevent)
-:SipEvent(sipevent)
+ :SipEvent(sipevent)
{
}
@@ -273,12 +273,12 @@ SubscriptionEvent::~SubscriptionEvent()
tsip_subscribe_event_type_t SubscriptionEvent::getType() const
{
- return TSIP_SUBSCRIBE_EVENT(this->sipevent)->type;
+ return TSIP_SUBSCRIBE_EVENT(this->sipevent)->type;
}
const SubscriptionSession* SubscriptionEvent::getSession() const
{
- return dyn_cast<const SubscriptionSession*>(this->getBaseSession());
+ return dyn_cast<const SubscriptionSession*>(this->getBaseSession());
}
takeOwnership_Implement(Subscription, Subscription, Session); \ No newline at end of file
diff --git a/bindings/_common/SipEvent.h b/bindings/_common/SipEvent.h
index 85acb8d..c8b67a8 100755
--- a/bindings/_common/SipEvent.h
+++ b/bindings/_common/SipEvent.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -48,25 +48,27 @@ class TINYWRAP_API SipEvent
{
public:
#if !defined(SWIG)
- SipEvent(const tsip_event_t *sipevent);
+ SipEvent(const tsip_event_t *sipevent);
#endif
- virtual ~SipEvent();
+ virtual ~SipEvent();
public:
- short getCode() const;
- const char* getPhrase() const;
- const SipSession* getBaseSession() const;
- const SipMessage* getSipMessage() const;
+ short getCode() const;
+ const char* getPhrase() const;
+ const SipSession* getBaseSession() const;
+ const SipMessage* getSipMessage() const;
#if !defined(SWIG)
- const tsip_event_t * getWrappedEvent(){ return sipevent; }
+ const tsip_event_t * getWrappedEvent() {
+ return sipevent;
+ }
#endif
#if !defined(SWIG)
- SipStack* getStack()const;
+ SipStack* getStack()const;
#endif
protected:
- const tsip_event_t *sipevent;
- SipMessage* sipmessage;
+ const tsip_event_t *sipevent;
+ SipMessage* sipmessage;
};
@@ -75,9 +77,9 @@ class TINYWRAP_API DialogEvent: public SipEvent
{
public:
#if !defined(SWIG)
- DialogEvent(const tsip_event_t *sipevent);
+ DialogEvent(const tsip_event_t *sipevent);
#endif
- virtual ~DialogEvent();
+ virtual ~DialogEvent();
public: /* Public API functions */
};
@@ -87,9 +89,9 @@ class TINYWRAP_API StackEvent: public SipEvent
{
public:
#if !defined(SWIG)
- StackEvent(const tsip_event_t *sipevent);
+ StackEvent(const tsip_event_t *sipevent);
#endif
- virtual ~StackEvent();
+ virtual ~StackEvent();
public: /* Public API functions */
};
@@ -101,16 +103,16 @@ class TINYWRAP_API InviteEvent: public SipEvent
{
public:
#if !defined(SWIG)
- InviteEvent(const tsip_event_t *sipevent);
+ InviteEvent(const tsip_event_t *sipevent);
#endif
- virtual ~InviteEvent();
+ virtual ~InviteEvent();
public: /* Public API functions */
- tsip_invite_event_type_t getType() const;
- twrap_media_type_t getMediaType() const;
- const InviteSession* getSession() const;
- CallSession* takeCallSessionOwnership() const;
- MsrpSession* takeMsrpSessionOwnership() const;
+ tsip_invite_event_type_t getType() const;
+ twrap_media_type_t getMediaType() const;
+ const InviteSession* getSession() const;
+ CallSession* takeCallSessionOwnership() const;
+ MsrpSession* takeMsrpSessionOwnership() const;
};
@@ -120,14 +122,14 @@ class TINYWRAP_API MessagingEvent: public SipEvent
{
public:
#if !defined(SWIG)
- MessagingEvent(const tsip_event_t *sipevent);
+ MessagingEvent(const tsip_event_t *sipevent);
#endif
- virtual ~MessagingEvent();
+ virtual ~MessagingEvent();
public: /* Public API functions */
- tsip_message_event_type_t getType() const;
- const MessagingSession* getSession() const;
- MessagingSession* takeSessionOwnership() const;
+ tsip_message_event_type_t getType() const;
+ const MessagingSession* getSession() const;
+ MessagingSession* takeSessionOwnership() const;
};
/* ======================== InfoEvent ========================*/
@@ -135,14 +137,14 @@ class TINYWRAP_API InfoEvent: public SipEvent
{
public:
#if !defined(SWIG)
- InfoEvent(const tsip_event_t *sipevent);
+ InfoEvent(const tsip_event_t *sipevent);
#endif
- virtual ~InfoEvent();
+ virtual ~InfoEvent();
public: /* Public API functions */
- tsip_info_event_type_t getType() const;
- const InfoSession* getSession() const;
- InfoSession* takeSessionOwnership() const;
+ tsip_info_event_type_t getType() const;
+ const InfoSession* getSession() const;
+ InfoSession* takeSessionOwnership() const;
};
@@ -152,14 +154,14 @@ class TINYWRAP_API OptionsEvent: public SipEvent
{
public:
#if !defined(SWIG)
- OptionsEvent(const tsip_event_t *sipevent);
+ OptionsEvent(const tsip_event_t *sipevent);
#endif
- virtual ~OptionsEvent();
+ virtual ~OptionsEvent();
public: /* Public API functions */
- tsip_options_event_type_t getType() const;
- const OptionsSession* getSession() const;
- OptionsSession* takeSessionOwnership() const;
+ tsip_options_event_type_t getType() const;
+ const OptionsSession* getSession() const;
+ OptionsSession* takeSessionOwnership() const;
};
@@ -169,14 +171,14 @@ class TINYWRAP_API PublicationEvent: public SipEvent
{
public:
#if !defined(SWIG)
- PublicationEvent(const tsip_event_t *sipevent);
+ PublicationEvent(const tsip_event_t *sipevent);
#endif
- virtual ~PublicationEvent();
+ virtual ~PublicationEvent();
public: /* Public API functions */
- tsip_publish_event_type_t getType() const;
- const PublicationSession* getSession() const;
- PublicationSession* takeSessionOwnership() const;
+ tsip_publish_event_type_t getType() const;
+ const PublicationSession* getSession() const;
+ PublicationSession* takeSessionOwnership() const;
};
@@ -186,15 +188,15 @@ class TINYWRAP_API RegistrationEvent: public SipEvent
{
public:
#if !defined(SWIG)
- RegistrationEvent(const tsip_event_t *sipevent);
+ RegistrationEvent(const tsip_event_t *sipevent);
#endif
- virtual ~RegistrationEvent();
+ virtual ~RegistrationEvent();
public: /* Public API functions */
- tsip_register_event_type_t getType() const;
- const RegistrationSession* getSession() const;
- RegistrationSession* takeSessionOwnership() const;
-
+ tsip_register_event_type_t getType() const;
+ const RegistrationSession* getSession() const;
+ RegistrationSession* takeSessionOwnership() const;
+
};
@@ -203,14 +205,14 @@ class TINYWRAP_API SubscriptionEvent: public SipEvent
{
public:
#if !defined(SWIG)
- SubscriptionEvent(const tsip_event_t *sipevent);
+ SubscriptionEvent(const tsip_event_t *sipevent);
#endif
- virtual ~SubscriptionEvent();
+ virtual ~SubscriptionEvent();
public: /* Public API functions */
- tsip_subscribe_event_type_t getType() const;
- const SubscriptionSession* getSession() const;
- SubscriptionSession* takeSessionOwnership() const;
+ tsip_subscribe_event_type_t getType() const;
+ const SubscriptionSession* getSession() const;
+ SubscriptionSession* takeSessionOwnership() const;
};
#endif /* TINYWRAP_SIPEVENT_H */
diff --git a/bindings/_common/SipMessage.cxx b/bindings/_common/SipMessage.cxx
index a4f09fd..2f0000b 100755
--- a/bindings/_common/SipMessage.cxx
+++ b/bindings/_common/SipMessage.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -23,231 +23,297 @@
SdpMessage::SdpMessage()
-:m_pSdpMessage(tsk_null)
+ :m_pSdpMessage(tsk_null)
{
}
SdpMessage::SdpMessage(tsdp_message_t *_sdpmessage)
{
- m_pSdpMessage = (tsdp_message_t *)tsk_object_ref(_sdpmessage);
+ m_pSdpMessage = (tsdp_message_t *)tsk_object_ref(_sdpmessage);
}
SdpMessage::~SdpMessage()
{
- TSK_OBJECT_SAFE_FREE(m_pSdpMessage);
+ TSK_OBJECT_SAFE_FREE(m_pSdpMessage);
}
char* SdpMessage::getSdpHeaderValue(const char* media, char name, unsigned index /*= 0*/)
{
- const tsdp_header_M_t* M;
-
- if((M = (const tsdp_header_M_t*)tsdp_message_get_header(m_pSdpMessage, tsdp_htype_M))){
- tsdp_header_type_t type = tsdp_htype_Dummy;
- const tsdp_header_t* header;
- switch(name){
- case 'a': type = tsdp_htype_A; break;
- case 'b': type = tsdp_htype_B; break;
- case 'c': type = tsdp_htype_C; break;
- case 'e': type = tsdp_htype_E; break;
- case 'i': type = tsdp_htype_I; break;
- case 'k': type = tsdp_htype_K; break;
- case 'm': type = tsdp_htype_M; break;
- case 'o': type = tsdp_htype_O; break;
-
-
- case 'p': type = tsdp_htype_P; break;
- case 'r': type = tsdp_htype_R; break;
- case 's': type = tsdp_htype_S; break;
- case 't': type = tsdp_htype_T; break;
- case 'u': type = tsdp_htype_U; break;
- case 'v': type = tsdp_htype_V; break;
- case 'z': type = tsdp_htype_Z; break;
- }
-
- if((header = tsdp_message_get_headerAt(m_pSdpMessage, type, index))){
- return tsdp_header_tostring(header);
- }
- }
-
- return tsk_null;
+ const tsdp_header_M_t* M;
+
+ if((M = (const tsdp_header_M_t*)tsdp_message_get_header(m_pSdpMessage, tsdp_htype_M))) {
+ tsdp_header_type_t type = tsdp_htype_Dummy;
+ const tsdp_header_t* header;
+ switch(name) {
+ case 'a':
+ type = tsdp_htype_A;
+ break;
+ case 'b':
+ type = tsdp_htype_B;
+ break;
+ case 'c':
+ type = tsdp_htype_C;
+ break;
+ case 'e':
+ type = tsdp_htype_E;
+ break;
+ case 'i':
+ type = tsdp_htype_I;
+ break;
+ case 'k':
+ type = tsdp_htype_K;
+ break;
+ case 'm':
+ type = tsdp_htype_M;
+ break;
+ case 'o':
+ type = tsdp_htype_O;
+ break;
+
+
+ case 'p':
+ type = tsdp_htype_P;
+ break;
+ case 'r':
+ type = tsdp_htype_R;
+ break;
+ case 's':
+ type = tsdp_htype_S;
+ break;
+ case 't':
+ type = tsdp_htype_T;
+ break;
+ case 'u':
+ type = tsdp_htype_U;
+ break;
+ case 'v':
+ type = tsdp_htype_V;
+ break;
+ case 'z':
+ type = tsdp_htype_Z;
+ break;
+ }
+
+ if((header = tsdp_message_get_headerAt(m_pSdpMessage, type, index))) {
+ return tsdp_header_tostring(header);
+ }
+ }
+
+ return tsk_null;
}
char* SdpMessage::getSdpHeaderAValue(const char* media, const char* attributeName)
{
- const tsdp_header_M_t* M;
- tsk_size_t i;
-
- for(i = 0; (M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(m_pSdpMessage, tsdp_htype_M, i)); i++){
- if(tsk_striequals(M->media, media)){
- const tsdp_header_A_t* A;
- if((A = tsdp_header_M_findA(M, attributeName))){
- return tsk_strdup(A->value);
- }
- }
- }
-
- return tsk_null;
+ const tsdp_header_M_t* M;
+ tsk_size_t i;
+
+ for(i = 0; (M = (const tsdp_header_M_t*)tsdp_message_get_headerAt(m_pSdpMessage, tsdp_htype_M, i)); i++) {
+ if(tsk_striequals(M->media, media)) {
+ const tsdp_header_A_t* A;
+ if((A = tsdp_header_M_findA(M, attributeName))) {
+ return tsk_strdup(A->value);
+ }
+ }
+ }
+
+ return tsk_null;
}
SipMessage::SipMessage()
-:m_pSipMessage(tsk_null), m_pSdpMessage(tsk_null)
-{
+ :m_pSipMessage(tsk_null), m_pSdpMessage(tsk_null)
+{
}
SipMessage::SipMessage(tsip_message_t *_sipmessage)
-: m_pSdpMessage(tsk_null)
+ : m_pSdpMessage(tsk_null)
{
- m_pSipMessage = (tsip_message_t *)tsk_object_ref(_sipmessage);
+ m_pSipMessage = (tsip_message_t *)tsk_object_ref(_sipmessage);
}
SipMessage::~SipMessage()
{
- TSK_OBJECT_SAFE_FREE(m_pSipMessage);
- if(m_pSdpMessage){
- delete m_pSdpMessage;
- }
+ TSK_OBJECT_SAFE_FREE(m_pSipMessage);
+ if(m_pSdpMessage) {
+ delete m_pSdpMessage;
+ }
}
bool SipMessage::isResponse()
{
- return TSIP_MESSAGE_IS_RESPONSE(m_pSipMessage);
+ return TSIP_MESSAGE_IS_RESPONSE(m_pSipMessage);
}
tsip_request_type_t SipMessage::getRequestType()
{
- if(TSIP_MESSAGE_IS_REQUEST(m_pSipMessage)){
- return (m_pSipMessage)->line.request.request_type;
- }
- return tsip_NONE;
+ if(TSIP_MESSAGE_IS_REQUEST(m_pSipMessage)) {
+ return (m_pSipMessage)->line.request.request_type;
+ }
+ return tsip_NONE;
}
short SipMessage::getResponseCode()
{
- return TSIP_RESPONSE_CODE(m_pSipMessage);
+ return TSIP_RESPONSE_CODE(m_pSipMessage);
}
const char* SipMessage::getResponsePhrase()
{
- return TSIP_RESPONSE_PHRASE(m_pSipMessage);
+ return TSIP_RESPONSE_PHRASE(m_pSipMessage);
}
const tsip_header_t* SipMessage::getSipHeader(const char* name, unsigned index /* =0 */)
{
- /* Do not worry about calling tsk_striequals() several times because the function
- * is fully optimized.
- */
- /* Code below comes from tsip_message_get_headerAt() */
- tsk_size_t pos = 0;
- const tsk_list_item_t *item;
- const tsip_header_t* hdr = tsk_null;
- if(!m_pSipMessage || !name){
- return tsk_null;
- }
-
- if(tsk_striequals(name, "v") || tsk_striequals(name, "via")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->firstVia;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "f") || tsk_striequals(name, "from")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->From;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "t") || tsk_striequals(name, "to")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->To;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "m") || tsk_striequals(name, "contact")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Contact;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "i") || tsk_striequals(name, "call-id")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Call_ID;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "cseq")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->CSeq;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "expires")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Expires;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "c") || tsk_striequals(name, "content-type")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Content_Type;
- goto bail;
- }else pos++; }
- if(tsk_striequals(name, "l") || tsk_striequals(name, "content-length")){
- if(index == 0){
- hdr = (const tsip_header_t*)m_pSipMessage->Content_Length;
- goto bail;
- }else pos++; }
-
-
- tsk_list_foreach(item, m_pSipMessage->headers){
- if(tsk_striequals(tsip_header_get_name_2(TSIP_HEADER(item->data)), name)){
- if(pos++ >= index){
- hdr = (const tsip_header_t*)item->data;
- break;
- }
- }
- }
-
+ /* Do not worry about calling tsk_striequals() several times because the function
+ * is fully optimized.
+ */
+ /* Code below comes from tsip_message_get_headerAt() */
+ tsk_size_t pos = 0;
+ const tsk_list_item_t *item;
+ const tsip_header_t* hdr = tsk_null;
+ if(!m_pSipMessage || !name) {
+ return tsk_null;
+ }
+
+ if(tsk_striequals(name, "v") || tsk_striequals(name, "via")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->firstVia;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "f") || tsk_striequals(name, "from")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->From;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "t") || tsk_striequals(name, "to")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->To;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "m") || tsk_striequals(name, "contact")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Contact;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "i") || tsk_striequals(name, "call-id")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Call_ID;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "cseq")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->CSeq;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "expires")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Expires;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "c") || tsk_striequals(name, "content-type")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Content_Type;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+ if(tsk_striequals(name, "l") || tsk_striequals(name, "content-length")) {
+ if(index == 0) {
+ hdr = (const tsip_header_t*)m_pSipMessage->Content_Length;
+ goto bail;
+ }
+ else {
+ pos++;
+ }
+ }
+
+
+ tsk_list_foreach(item, m_pSipMessage->headers) {
+ if(tsk_striequals(tsip_header_get_name_2(TSIP_HEADER(item->data)), name)) {
+ if(pos++ >= index) {
+ hdr = (const tsip_header_t*)item->data;
+ break;
+ }
+ }
+ }
+
bail:
- return hdr;
+ return hdr;
}
// e.g. getHeaderParamValue("content-type");
char* SipMessage::getSipHeaderValue(const char* name, unsigned index /* = 0*/)
{
- const tsip_header_t* header;
- if((header = this->getSipHeader(name, index))){
-
- switch(header->type){
- case tsip_htype_From:
- return tsip_uri_tostring(((const tsip_header_From_t*)header)->uri, tsk_false, tsk_false);
- case tsip_htype_To:
- return tsip_uri_tostring(((const tsip_header_To_t*)header)->uri, tsk_false, tsk_false);
- break;
- case tsip_htype_P_Asserted_Identity:
- return tsip_uri_tostring(((const tsip_header_P_Asserted_Identity_t*)header)->uri, tsk_false, tsk_false);
- break;
-
- default:
- return tsip_header_value_tostring(header);
- }
- }
- // SWIG: %newobject getHeaderValueAt;
- return tsk_null;
+ const tsip_header_t* header;
+ if((header = this->getSipHeader(name, index))) {
+
+ switch(header->type) {
+ case tsip_htype_From:
+ return tsip_uri_tostring(((const tsip_header_From_t*)header)->uri, tsk_false, tsk_false);
+ case tsip_htype_To:
+ return tsip_uri_tostring(((const tsip_header_To_t*)header)->uri, tsk_false, tsk_false);
+ break;
+ case tsip_htype_P_Asserted_Identity:
+ return tsip_uri_tostring(((const tsip_header_P_Asserted_Identity_t*)header)->uri, tsk_false, tsk_false);
+ break;
+
+ default:
+ return tsip_header_value_tostring(header);
+ }
+ }
+ // SWIG: %newobject getHeaderValueAt;
+ return tsk_null;
}
// e.g. getHeaderParamValue("content-type", "charset");
char* SipMessage::getSipHeaderParamValue(const char* name, const char* param, unsigned index /*=0*/)
{
- const tsip_header_t* header;
+ const tsip_header_t* header;
- if((header = this->getSipHeader(name, index))){
- return tsip_header_get_param_value(header, param);
- }
+ if((header = this->getSipHeader(name, index))) {
+ return tsip_header_get_param_value(header, param);
+ }
- // SWIG: %newobject getSipHeaderParamValue;
- return tsk_null;
+ // SWIG: %newobject getSipHeaderParamValue;
+ return tsk_null;
}
/** Returns the content length.
*/
unsigned SipMessage::getSipContentLength()
{
- return TSIP_MESSAGE_CONTENT_DATA_LENGTH(m_pSipMessage);
+ return TSIP_MESSAGE_CONTENT_DATA_LENGTH(m_pSipMessage);
}
/** Gets the message content
@@ -259,31 +325,31 @@ unsigned SipMessage::getSipContentLength()
*/
unsigned SipMessage::getSipContent(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
- if(output && maxsize && TSIP_MESSAGE_HAS_CONTENT(m_pSipMessage)){
- retsize = (m_pSipMessage->Content->size > maxsize) ? maxsize : m_pSipMessage->Content->size;
- memcpy(output, m_pSipMessage->Content->data, retsize);
- }
- return retsize;
+ unsigned retsize = 0;
+ if(output && maxsize && TSIP_MESSAGE_HAS_CONTENT(m_pSipMessage)) {
+ retsize = (m_pSipMessage->Content->size > maxsize) ? maxsize : m_pSipMessage->Content->size;
+ memcpy(output, m_pSipMessage->Content->data, retsize);
+ }
+ return retsize;
}
const void* SipMessage::getSipContentPtr()
{
- if(m_pSipMessage && m_pSipMessage->Content){
- return m_pSipMessage->Content->data;
- }
- return tsk_null;
+ if(m_pSipMessage && m_pSipMessage->Content) {
+ return m_pSipMessage->Content->data;
+ }
+ return tsk_null;
}
const SdpMessage* SipMessage::getSdpMessage()
{
- if(!m_pSdpMessage && TSIP_MESSAGE_HAS_CONTENT(m_pSipMessage)){
- tsdp_message_t* sdp = tsdp_message_parse(m_pSipMessage->Content->data, m_pSipMessage->Content->size);
- if(sdp){
- m_pSdpMessage = new SdpMessage(sdp);
- TSK_OBJECT_SAFE_FREE(sdp);
- }
- }
-
- return m_pSdpMessage;
+ if(!m_pSdpMessage && TSIP_MESSAGE_HAS_CONTENT(m_pSipMessage)) {
+ tsdp_message_t* sdp = tsdp_message_parse(m_pSipMessage->Content->data, m_pSipMessage->Content->size);
+ if(sdp) {
+ m_pSdpMessage = new SdpMessage(sdp);
+ TSK_OBJECT_SAFE_FREE(sdp);
+ }
+ }
+
+ return m_pSdpMessage;
}
diff --git a/bindings/_common/SipMessage.h b/bindings/_common/SipMessage.h
index eb9d598..e63a4a1 100755
--- a/bindings/_common/SipMessage.h
+++ b/bindings/_common/SipMessage.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -28,51 +28,55 @@
class TINYWRAP_API SdpMessage
{
public:
- SdpMessage();
+ SdpMessage();
#if !defined(SWIG)
- SdpMessage(tsdp_message_t *sdpmessage);
+ SdpMessage(tsdp_message_t *sdpmessage);
#endif
- virtual ~SdpMessage();
+ virtual ~SdpMessage();
- char* getSdpHeaderValue(const char* media, char name, unsigned index = 0);
- char* getSdpHeaderAValue(const char* media, const char* attributeName);
+ char* getSdpHeaderValue(const char* media, char name, unsigned index = 0);
+ char* getSdpHeaderAValue(const char* media, const char* attributeName);
#if !defined(SWIG)
- const tsdp_message_t * getWrappedSdpMessage(){ return m_pSdpMessage; }
+ const tsdp_message_t * getWrappedSdpMessage() {
+ return m_pSdpMessage;
+ }
#endif
private:
- tsdp_message_t *m_pSdpMessage;
+ tsdp_message_t *m_pSdpMessage;
};
class TINYWRAP_API SipMessage
{
public:
- SipMessage();
+ SipMessage();
#if !defined(SWIG)
- SipMessage(tsip_message_t *sipmessage);
+ SipMessage(tsip_message_t *sipmessage);
#endif
- virtual ~SipMessage();
-
- bool isResponse();
- tsip_request_type_t getRequestType();
- short getResponseCode();
- const char* getResponsePhrase();
- char* getSipHeaderValue(const char* name, unsigned index = 0);
- char* getSipHeaderParamValue(const char* name, const char* param, unsigned index = 0);
- unsigned getSipContentLength();
- unsigned getSipContent(void* output, unsigned maxsize);
+ virtual ~SipMessage();
+
+ bool isResponse();
+ tsip_request_type_t getRequestType();
+ short getResponseCode();
+ const char* getResponsePhrase();
+ char* getSipHeaderValue(const char* name, unsigned index = 0);
+ char* getSipHeaderParamValue(const char* name, const char* param, unsigned index = 0);
+ unsigned getSipContentLength();
+ unsigned getSipContent(void* output, unsigned maxsize);
#if !defined(SWIG)
- const void* getSipContentPtr();
- const tsip_message_t* getWrappedSipMessage()const{ return m_pSipMessage; }
+ const void* getSipContentPtr();
+ const tsip_message_t* getWrappedSipMessage()const {
+ return m_pSipMessage;
+ }
#endif
- const SdpMessage* getSdpMessage();
+ const SdpMessage* getSdpMessage();
private:
- const tsip_header_t* getSipHeader(const char* name, unsigned index = 0);
+ const tsip_header_t* getSipHeader(const char* name, unsigned index = 0);
private:
- tsip_message_t *m_pSipMessage;
- SdpMessage *m_pSdpMessage;
+ tsip_message_t *m_pSipMessage;
+ SdpMessage *m_pSdpMessage;
};
#endif /* TINYWRAP_SIPMESSAGE_H */
diff --git a/bindings/_common/SipSession.cxx b/bindings/_common/SipSession.cxx
index ac80d41..2de0fc8 100755
--- a/bindings/_common/SipSession.cxx
+++ b/bindings/_common/SipSession.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -26,10 +26,9 @@
#include "Msrp.h"
/* ======================== AsyncAction ========================*/
-typedef struct twrap_async_action_s
-{
- const tsip_ssession_handle_t *session;
- const ActionConfig* config;
+typedef struct twrap_async_action_s {
+ const tsip_ssession_handle_t *session;
+ const ActionConfig* config;
}
twrap_async_action_t;
@@ -38,264 +37,264 @@ twrap_async_action_t;
/* ======================== SipSession ========================*/
SipSession::SipSession(SipStack* stack)
{
- init(stack);
+ init(stack);
}
SipSession::SipSession(SipStack* stack, tsip_ssession_handle_t* pHandle)
{
- init(stack, pHandle);
+ init(stack, pHandle);
}
SipSession::~SipSession()
{
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_USERDATA(tsk_null),
- TSIP_SSESSION_SET_NULL());
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_USERDATA(tsk_null),
+ TSIP_SSESSION_SET_NULL());
- TSK_OBJECT_SAFE_FREE(m_pHandle);
+ TSK_OBJECT_SAFE_FREE(m_pHandle);
}
void SipSession::init(SipStack* pStack, tsip_ssession_handle_t* pHandle/*=tsk_null*/)
{
- if(pHandle){
- /* "server-side-session" */
- if(tsip_ssession_have_ownership(pHandle)){
- tsk_object_ref(pHandle);
- }
- else if(tsip_ssession_take_ownership(pHandle) != 0){ /* should never happen */
- TSK_DEBUG_ERROR("Failed to take ownership");
- return;
- }
- m_pHandle = pHandle;
- }
- else{
- /* "client-side-session" */
- m_pHandle = tsip_ssession_create(pStack->getHandle(),
- TSIP_SSESSION_SET_USERDATA(this),
- TSIP_SSESSION_SET_NULL());
- }
-
- /* set userdata (context) and ref. the stack handle */
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_USERDATA(this),
- TSIP_SSESSION_SET_NULL());
- m_pStack = pStack;
+ if(pHandle) {
+ /* "server-side-session" */
+ if(tsip_ssession_have_ownership(pHandle)) {
+ tsk_object_ref(pHandle);
+ }
+ else if(tsip_ssession_take_ownership(pHandle) != 0) { /* should never happen */
+ TSK_DEBUG_ERROR("Failed to take ownership");
+ return;
+ }
+ m_pHandle = pHandle;
+ }
+ else {
+ /* "client-side-session" */
+ m_pHandle = tsip_ssession_create(pStack->getHandle(),
+ TSIP_SSESSION_SET_USERDATA(this),
+ TSIP_SSESSION_SET_NULL());
+ }
+
+ /* set userdata (context) and ref. the stack handle */
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_USERDATA(this),
+ TSIP_SSESSION_SET_NULL());
+ m_pStack = pStack;
}
bool SipSession::addHeader(const char* name, const char* value)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_HEADER(name, value),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_HEADER(name, value),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::haveOwnership()
{
- return (tsip_ssession_have_ownership(m_pHandle) == tsk_true);
+ return (tsip_ssession_have_ownership(m_pHandle) == tsk_true);
}
bool SipSession::removeHeader(const char* name)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_UNSET_HEADER(name),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_UNSET_HEADER(name),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::addCaps(const char* name, const char* value)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_CAPS(name, value),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_CAPS(name, value),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::addCaps(const char* name)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_CAPS(name, tsk_null),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_CAPS(name, tsk_null),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::removeCaps(const char* name)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_UNSET_CAPS(name),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_UNSET_CAPS(name),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setExpires(unsigned expires)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_EXPIRES(expires),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_EXPIRES(expires),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setFromUri(const char* fromUriString)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_FROM_STR(fromUriString),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_FROM_STR(fromUriString),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setFromUri(const SipUri* fromUri)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_FROM_OBJ(fromUri->getWrappedUri()),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_FROM_OBJ(fromUri->getWrappedUri()),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setToUri(const char* toUriString)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_TO_STR(toUriString),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_TO_STR(toUriString),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setToUri(const SipUri* toUri)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_TO_OBJ(toUri->getWrappedUri()),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_TO_OBJ(toUri->getWrappedUri()),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setSilentHangup(bool silent)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_SILENT_HANGUP(silent ? tsk_true : tsk_false),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_SILENT_HANGUP(silent ? tsk_true : tsk_false),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::addSigCompCompartment(const char* compId)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_SIGCOMP_COMPARTMENT(compId),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_SIGCOMP_COMPARTMENT(compId),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::setAuth(const char* authHa1, const char* authIMPI)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_AUTH_HA1(authHa1),
- TSIP_SSESSION_SET_AUTH_IMPI(authIMPI),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_AUTH_HA1(authHa1),
+ TSIP_SSESSION_SET_AUTH_IMPI(authIMPI),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool SipSession::removeSigCompCompartment()
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_UNSET_SIGCOMP_COMPARTMENT(),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_UNSET_SIGCOMP_COMPARTMENT(),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
// FIXME: should be "uint64_t" instead of "unsigned"
unsigned SipSession::getId()const
{
- return (unsigned)tsip_ssession_get_id(m_pHandle);
+ return (unsigned)tsip_ssession_get_id(m_pHandle);
}
bool SipSession::setWebSocketSrc(const char* host, int32_t port, const char* proto)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_WEBSOCKET_SRC(host, port, proto),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_WEBSOCKET_SRC(host, port, proto),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
const SipStack* SipSession::getStack()const
{
- return m_pStack;
+ return m_pStack;
}
/* ======================== InviteSession ========================*/
InviteSession::InviteSession(SipStack* pStack)
-: SipSession(pStack), m_pMediaMgr(tsk_null)
+ : SipSession(pStack), m_pMediaMgr(tsk_null)
{
}
InviteSession::InviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle), m_pMediaMgr(tsk_null)
+ : SipSession(pStack, pHandle), m_pMediaMgr(tsk_null)
{
}
InviteSession::~InviteSession()
{
- if(m_pMediaMgr){
- delete m_pMediaMgr, m_pMediaMgr = tsk_null;
- }
+ if(m_pMediaMgr) {
+ delete m_pMediaMgr, m_pMediaMgr = tsk_null;
+ }
}
bool InviteSession::hangup(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_bye(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_bye(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool InviteSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool InviteSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool InviteSession::sendInfo(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- int ret;
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- if(payload && len){
- ret = tsip_api_invite_send_info(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- else{
- ret = tsip_api_invite_send_info(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- return (ret == 0);
+ int ret;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(payload && len) {
+ ret = tsip_api_invite_send_info(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ else {
+ ret = tsip_api_invite_send_info(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ return (ret == 0);
}
const MediaSessionMgr* InviteSession::getMediaMgr()
{
- if(!m_pMediaMgr && m_pHandle){
- tmedia_session_mgr_t* mgr = tsip_session_get_mediamgr(m_pHandle);
- if(mgr){
- m_pMediaMgr = new MediaSessionMgr(mgr); // new() it's not yours: see "m_pMediaMgr" which is destroy in the destructor()
- tsk_object_unref(mgr);
- }
- else{
- TSK_DEBUG_WARN("No media session associated to this session");
- }
- }
- return m_pMediaMgr;
+ if(!m_pMediaMgr && m_pHandle) {
+ tmedia_session_mgr_t* mgr = tsip_session_get_mediamgr(m_pHandle);
+ if(mgr) {
+ m_pMediaMgr = new MediaSessionMgr(mgr); // new() it's not yours: see "m_pMediaMgr" which is destroy in the destructor()
+ tsk_object_unref(mgr);
+ }
+ else {
+ TSK_DEBUG_WARN("No media session associated to this session");
+ }
+ }
+ return m_pMediaMgr;
}
/* ======================== CallSession ========================*/
CallSession::CallSession(SipStack* Stack)
-: InviteSession(Stack)
+ : InviteSession(Stack)
{
}
CallSession::CallSession(SipStack* Stack, tsip_ssession_handle_t* handle)
-: InviteSession(Stack, handle)
-, m_pT140Callback(tsk_null)
-, m_pRtcpCallback(tsk_null)
+ : InviteSession(Stack, handle)
+ , m_pT140Callback(tsk_null)
+ , m_pRtcpCallback(tsk_null)
{
}
@@ -306,423 +305,423 @@ CallSession::~CallSession()
/* @deprecated */
bool CallSession::callAudio(const SipUri* remoteUri, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUri, twrap_media_audio, config);
+ return call(remoteUri, twrap_media_audio, config);
}
/* @deprecated */
bool CallSession::callAudio(const char* remoteUriString, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUriString, twrap_media_audio, config);
+ return call(remoteUriString, twrap_media_audio, config);
}
/* @deprecated */
bool CallSession::callAudioVideo(const SipUri* remoteUri, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUri, twrap_media_audio_video, config);
+ return call(remoteUri, twrap_media_audio_video, config);
}
/* @deprecated */
bool CallSession::callAudioVideo(const char* remoteUriString, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUriString, twrap_media_audio_video, config);
+ return call(remoteUriString, twrap_media_audio_video, config);
}
/* @deprecated */
bool CallSession::callVideo(const SipUri* remoteUri, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUri, twrap_media_video, config);
+ return call(remoteUri, twrap_media_video, config);
}
/* @deprecated */
bool CallSession::callVideo(const char* remoteUriString, ActionConfig* config/*=tsk_null*/)
{
- return call(remoteUriString, twrap_media_video, config);
+ return call(remoteUriString, twrap_media_video, config);
}
bool CallSession::call(const char* remoteUriString, twrap_media_type_t media, ActionConfig* config/*=tsk_null*/)
{
-
- SipUri sipUri(remoteUriString);
- if(sipUri.isValid()){
- return call(&sipUri, media, config);
- }
- TSK_DEBUG_ERROR("Failed to parse sip uri=%s", remoteUriString);
- return false;
+
+ SipUri sipUri(remoteUriString);
+ if(sipUri.isValid()) {
+ return call(&sipUri, media, config);
+ }
+ TSK_DEBUG_ERROR("Failed to parse sip uri=%s", remoteUriString);
+ return false;
}
bool CallSession::call(const SipUri* remoteUri, twrap_media_type_t media, ActionConfig* config/*=tsk_null*/)
{
- if(!remoteUri){
- TSK_DEBUG_ERROR("Invalid parameter");
- return false;
- }
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_TO_OBJ(remoteUri->getWrappedUri()),
- TSIP_SSESSION_SET_NULL());
+ if(!remoteUri) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return false;
+ }
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_TO_OBJ(remoteUri->getWrappedUri()),
+ TSIP_SSESSION_SET_NULL());
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_invite(m_pHandle, twrap_get_native_media_type(media),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_invite_send_invite(m_pHandle, twrap_get_native_media_type(media),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::setSupportedCodecs(int32_t codecs)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_CODECS(codecs),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_CODECS(codecs),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
int32_t CallSession::getNegotiatedCodecs()
{
- return (int32_t) tsip_ssession_get_codecs_neg(m_pHandle);
+ return (int32_t) tsip_ssession_get_codecs_neg(m_pHandle);
}
bool CallSession::setMediaSSRC(twrap_media_type_t media, uint32_t ssrc)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_RTP_SSRC(twrap_get_native_media_type(media), ssrc),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_RTP_SSRC(twrap_get_native_media_type(media), ssrc),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setSessionTimer(unsigned timeout, const char* refresher)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_TIMERS(timeout, refresher),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_TIMERS(timeout, refresher),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::set100rel(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_100rel(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_100rel(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setRtcp(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_RTCP(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
-
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_RTCP(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
+
}
bool CallSession::setRtcpMux(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_RTCPMUX(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_RTCPMUX(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setSRtpMode(enum tmedia_srtp_mode_e mode)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_SRTP_MODE(mode),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_SRTP_MODE(mode),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setAvpfMode(enum tmedia_mode_e mode)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_AVPF_MODE(mode),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_AVPF_MODE(mode),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setICE(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_ICE(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_ICE(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setICEStun(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_ICE_STUN(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_ICE_STUN(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setICETurn(bool enabled)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_ICE_TURN(enabled ? tsk_true : tsk_false),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_ICE_TURN(enabled ? tsk_true : tsk_false),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setSTUNServer(const char* hostname, uint16_t port)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_STUN_SERVER(hostname, port),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_STUN_SERVER(hostname, port),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setSTUNCred(const char* username, const char* password)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_STUN_CRED(username, password),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_STUN_CRED(username, password),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setVideoFps(int32_t fps)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_VIDEO_FPS(fps),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_VIDEO_FPS(fps),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setVideoBandwidthUploadMax(int32_t max)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_VIDEO_BW_UP(max),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_VIDEO_BW_UP(max),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setVideoBandwidthDownloadMax(int32_t max)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_VIDEO_BW_DOWN(max),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_VIDEO_BW_DOWN(max),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setVideoPrefSize(tmedia_pref_video_size_t pref_video_size)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_VIDEO_PREFSIZE(pref_video_size),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_VIDEO_PREFSIZE(pref_video_size),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength)
{
- return (tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_QOS(type, strength),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL()) == 0);
+ return (tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_QOS(type, strength),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL()) == 0);
}
bool CallSession::hold(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_hold(m_pHandle, tmedia_all,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) ==0 );
+ return (tsip_api_invite_send_hold(m_pHandle, tmedia_all,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) ==0 );
}
bool CallSession::resume(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_resume(m_pHandle, tmedia_all,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_resume(m_pHandle, tmedia_all,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::transfer(const char* referToUriString, ActionConfig* config/*=tsk_null*/)
{
- if(tsk_strnullORempty(referToUriString)){
- TSK_DEBUG_ERROR("Invalid parameter");
- return false;
- }
-
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_ect(m_pHandle, referToUriString,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ if(tsk_strnullORempty(referToUriString)) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return false;
+ }
+
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_invite_send_ect(m_pHandle, referToUriString,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::acceptTransfer(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_ect_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_invite_send_ect_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::rejectTransfer(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_ect_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_invite_send_ect_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool CallSession::sendDTMF(int number)
{
- return (tsip_api_invite_send_dtmf(m_pHandle, number,
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_dtmf(m_pHandle, number,
+ TSIP_ACTION_SET_NULL()) == 0);
}
unsigned CallSession::getSessionTransferId()
{
- return (unsigned)tsip_ssession_get_id_parent(m_pHandle);
+ return (unsigned)tsip_ssession_get_id_parent(m_pHandle);
}
bool CallSession::sendT140Data(enum tmedia_t140_data_type_e data_type, const void* data_ptr /*= NULL*/, unsigned data_size /*= 0*/)
{
- const tmedia_session_mgr_t* pWrappedMgr;
- const MediaSessionMgr* pMgr;
- if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())){
- return (tmedia_session_mgr_send_t140_data((tmedia_session_mgr_t*)pWrappedMgr, data_type, data_ptr, data_size) == 0);
- }
- return false;
+ const tmedia_session_mgr_t* pWrappedMgr;
+ const MediaSessionMgr* pMgr;
+ if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())) {
+ return (tmedia_session_mgr_send_t140_data((tmedia_session_mgr_t*)pWrappedMgr, data_type, data_ptr, data_size) == 0);
+ }
+ return false;
}
bool CallSession::setT140Callback(const T140Callback* pT140Callback)
{
- const tmedia_session_mgr_t* pWrappedMgr;
- const MediaSessionMgr* pMgr;
- if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())){
- if((m_pT140Callback = pT140Callback)){
- return (tmedia_session_mgr_set_t140_ondata_cbfn((tmedia_session_mgr_t*)pWrappedMgr, this, &CallSession::t140OnDataCallback) == 0);
- }
- else{
- return (tmedia_session_mgr_set_t140_ondata_cbfn((tmedia_session_mgr_t*)pWrappedMgr, this, tsk_null) == 0);
- }
- }
- return false;
+ const tmedia_session_mgr_t* pWrappedMgr;
+ const MediaSessionMgr* pMgr;
+ if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())) {
+ if((m_pT140Callback = pT140Callback)) {
+ return (tmedia_session_mgr_set_t140_ondata_cbfn((tmedia_session_mgr_t*)pWrappedMgr, this, &CallSession::t140OnDataCallback) == 0);
+ }
+ else {
+ return (tmedia_session_mgr_set_t140_ondata_cbfn((tmedia_session_mgr_t*)pWrappedMgr, this, tsk_null) == 0);
+ }
+ }
+ return false;
}
bool CallSession::sendRtcpEvent(enum tmedia_rtcp_event_type_e event_type, twrap_media_type_t media_type, uint32_t ssrc_media /*= 0*/)
{
- const tmedia_session_mgr_t* pWrappedMgr;
- const MediaSessionMgr* pMgr;
- if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())){
- return (tmedia_session_mgr_send_rtcp_event((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), event_type, ssrc_media) == 0);
- }
- TSK_DEBUG_ERROR("No media manager");
- return false;
+ const tmedia_session_mgr_t* pWrappedMgr;
+ const MediaSessionMgr* pMgr;
+ if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())) {
+ return (tmedia_session_mgr_send_rtcp_event((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), event_type, ssrc_media) == 0);
+ }
+ TSK_DEBUG_ERROR("No media manager");
+ return false;
}
bool CallSession::setRtcpCallback(const RtcpCallback* pRtcpCallback, twrap_media_type_t media_type)
{
- const tmedia_session_mgr_t* pWrappedMgr;
- const MediaSessionMgr* pMgr;
- if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())){
- if((m_pRtcpCallback = pRtcpCallback)){
- return (tmedia_session_mgr_set_onrtcp_cbfn((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), this, &CallSession::rtcpOnCallback) == 0);
- }
- else{
- return (tmedia_session_mgr_set_onrtcp_cbfn((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), this, tsk_null) == 0);
- }
- }
- return false;
+ const tmedia_session_mgr_t* pWrappedMgr;
+ const MediaSessionMgr* pMgr;
+ if((pMgr = getMediaMgr()) && (pWrappedMgr = pMgr->getWrappedMgr())) {
+ if((m_pRtcpCallback = pRtcpCallback)) {
+ return (tmedia_session_mgr_set_onrtcp_cbfn((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), this, &CallSession::rtcpOnCallback) == 0);
+ }
+ else {
+ return (tmedia_session_mgr_set_onrtcp_cbfn((tmedia_session_mgr_t*)pWrappedMgr, twrap_get_native_media_type(media_type), this, tsk_null) == 0);
+ }
+ }
+ return false;
}
const T140Callback* CallSession::getT140Callback() const
{
- return m_pT140Callback;
+ return m_pT140Callback;
}
int CallSession::t140OnDataCallback(const void* context, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
- const CallSession* session = dyn_cast<const CallSession*>((const CallSession*)context);
- if(session && session->getT140Callback()){
- T140CallbackData* dataObj = new T140CallbackData(data_type, data_ptr, data_size);
- if(dataObj){
- int ret = const_cast<T140Callback*>(session->getT140Callback())->ondata(dataObj);
- delete dataObj;
- return ret;
- }
- }
- return 0;
+ const CallSession* session = dyn_cast<const CallSession*>((const CallSession*)context);
+ if(session && session->getT140Callback()) {
+ T140CallbackData* dataObj = new T140CallbackData(data_type, data_ptr, data_size);
+ if(dataObj) {
+ int ret = const_cast<T140Callback*>(session->getT140Callback())->ondata(dataObj);
+ delete dataObj;
+ return ret;
+ }
+ }
+ return 0;
}
const RtcpCallback* CallSession::getRtcpCallback() const
{
- return m_pRtcpCallback;
+ return m_pRtcpCallback;
}
int CallSession::rtcpOnCallback(const void* context, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media)
{
- const CallSession* session = dyn_cast<const CallSession*>((const CallSession*)context);
- if(session && session->getRtcpCallback()){
- RtcpCallbackData* dataObj = new RtcpCallbackData(event_type, ssrc_media);
- if(dataObj){
- int ret = const_cast<RtcpCallback*>(session->getRtcpCallback())->onevent(dataObj);
- delete dataObj;
- return ret;
- }
- }
- TSK_DEBUG_INFO("Not Sending RTCP packet (no callback)");
- return 0;
+ const CallSession* session = dyn_cast<const CallSession*>((const CallSession*)context);
+ if(session && session->getRtcpCallback()) {
+ RtcpCallbackData* dataObj = new RtcpCallbackData(event_type, ssrc_media);
+ if(dataObj) {
+ int ret = const_cast<RtcpCallback*>(session->getRtcpCallback())->onevent(dataObj);
+ delete dataObj;
+ return ret;
+ }
+ }
+ TSK_DEBUG_INFO("Not Sending RTCP packet (no callback)");
+ return 0;
}
/* ======================== MsrpSession ========================*/
MsrpSession::MsrpSession(SipStack* pStack, MsrpCallback* pCallback)
-: InviteSession(pStack), m_pCallback(pCallback)
+ : InviteSession(pStack), m_pCallback(pCallback)
{
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_MSRP_CB(twrap_msrp_cb),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL());
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_MSRP_CB(twrap_msrp_cb),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL());
}
MsrpSession::MsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: InviteSession(pStack, pHandle), m_pCallback(tsk_null)
+ : InviteSession(pStack, pHandle), m_pCallback(tsk_null)
{
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_MEDIA(
- TSIP_MSESSION_SET_MSRP_CB(twrap_msrp_cb),
- TSIP_MSESSION_SET_NULL()
- ),
- TSIP_SSESSION_SET_NULL());
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_MEDIA(
+ TSIP_MSESSION_SET_MSRP_CB(twrap_msrp_cb),
+ TSIP_MSESSION_SET_NULL()
+ ),
+ TSIP_SSESSION_SET_NULL());
}
MsrpSession::~MsrpSession()
@@ -731,60 +730,60 @@ MsrpSession::~MsrpSession()
bool MsrpSession::setCallback(MsrpCallback* pCallback)
{
- m_pCallback = pCallback;
- return true;
+ m_pCallback = pCallback;
+ return true;
}
bool MsrpSession::callMsrp(const SipUri* remoteUri, ActionConfig* config/*=tsk_null*/)
{
- if(!remoteUri){
- TSK_DEBUG_ERROR("Invalid parameter");
- return false;
- }
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(!remoteUri) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return false;
+ }
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- tsip_ssession_set(m_pHandle,
- TSIP_SSESSION_SET_TO_OBJ(remoteUri->getWrappedUri()),
- TSIP_SSESSION_SET_NULL());
+ tsip_ssession_set(m_pHandle,
+ TSIP_SSESSION_SET_TO_OBJ(remoteUri->getWrappedUri()),
+ TSIP_SSESSION_SET_NULL());
- return (tsip_api_invite_send_invite(m_pHandle, tmedia_msrp,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_invite(m_pHandle, tmedia_msrp,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool MsrpSession::callMsrp(const char* remoteUriString, ActionConfig* config/*=tsk_null*/)
{
- SipUri sipUri(remoteUriString);
- if(sipUri.isValid()){
- return callMsrp(&sipUri, config);
- }
- TSK_DEBUG_ERROR("Failed to parse sip uri=%s", remoteUriString);
- return false;
+ SipUri sipUri(remoteUriString);
+ if(sipUri.isValid()) {
+ return callMsrp(&sipUri, config);
+ }
+ TSK_DEBUG_ERROR("Failed to parse sip uri=%s", remoteUriString);
+ return false;
}
bool MsrpSession::sendMessage(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_invite_send_large_message(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_invite_send_large_message(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool MsrpSession::sendFile(ActionConfig* config/*=tsk_null*/)
{
- return false;
+ return false;
}
/* ======================== MessagingSession ========================*/
MessagingSession::MessagingSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
MessagingSession::MessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -794,47 +793,47 @@ MessagingSession::~MessagingSession()
bool MessagingSession::send(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- int ret;
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- if(payload && len){
- ret = tsip_api_message_send_message(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- else{
- ret = tsip_api_message_send_message(m_pHandle,
- TSIP_ACTION_SET_NULL());
- }
- return (ret == 0);
+ int ret;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(payload && len) {
+ ret = tsip_api_message_send_message(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ else {
+ ret = tsip_api_message_send_message(m_pHandle,
+ TSIP_ACTION_SET_NULL());
+ }
+ return (ret == 0);
}
bool MessagingSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool MessagingSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
/* ======================== InfoSession ========================*/
InfoSession::InfoSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
InfoSession::InfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -844,35 +843,35 @@ InfoSession::~InfoSession()
bool InfoSession::send(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- int ret;
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- if(payload && len){
- ret = tsip_api_info_send_info(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- else{
- ret = tsip_api_info_send_info(m_pHandle,
- TSIP_ACTION_SET_NULL());
- }
- return (ret == 0);
+ int ret;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(payload && len) {
+ ret = tsip_api_info_send_info(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ else {
+ ret = tsip_api_info_send_info(m_pHandle,
+ TSIP_ACTION_SET_NULL());
+ }
+ return (ret == 0);
}
bool InfoSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool InfoSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
@@ -880,12 +879,12 @@ bool InfoSession::reject(ActionConfig* config/*=tsk_null*/)
/* ======================== OptionsSession ========================*/
OptionsSession::OptionsSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
OptionsSession::OptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -894,27 +893,27 @@ OptionsSession::~OptionsSession()
}
bool OptionsSession::send(ActionConfig* config/*=tsk_null*/)
-{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_options_send_options(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+{
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_options_send_options(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool OptionsSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool OptionsSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
@@ -922,12 +921,12 @@ bool OptionsSession::reject(ActionConfig* config/*=tsk_null*/)
/* ======================== PublicationSession ========================*/
PublicationSession::PublicationSession(SipStack* Stack)
-: SipSession(Stack)
+ : SipSession(Stack)
{
}
PublicationSession::PublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -938,39 +937,39 @@ PublicationSession::~PublicationSession()
bool PublicationSession::publish(const void* payload, unsigned len, ActionConfig* config/*=tsk_null*/)
{
- int ret;
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- if(payload && len){
- ret = tsip_api_publish_send_publish(m_pHandle,
- TSIP_ACTION_SET_PAYLOAD(payload, len),
- TSIP_ACTION_SET_NULL());
- }
- else{
- ret = tsip_api_publish_send_publish(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL());
- }
- return (ret == 0);
+ int ret;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ if(payload && len) {
+ ret = tsip_api_publish_send_publish(m_pHandle,
+ TSIP_ACTION_SET_PAYLOAD(payload, len),
+ TSIP_ACTION_SET_NULL());
+ }
+ else {
+ ret = tsip_api_publish_send_publish(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL());
+ }
+ return (ret == 0);
}
bool PublicationSession::unPublish(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_publish_send_unpublish(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_publish_send_unpublish(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
/* ======================== RegistrationSession ========================*/
RegistrationSession::RegistrationSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
RegistrationSession::RegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -981,47 +980,47 @@ RegistrationSession::~RegistrationSession()
bool RegistrationSession::register_(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_register_send_register(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_register_send_register(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool RegistrationSession::unRegister(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_register_send_unregister(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ return (tsip_api_register_send_unregister(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool RegistrationSession::accept(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_accept(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_common_accept(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool RegistrationSession::reject(ActionConfig* config/*=tsk_null*/)
{
- const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
+ const tsip_action_handle_t* action_cfg = config ? config->getHandle() : tsk_null;
- return (tsip_api_common_reject(m_pHandle,
- TSIP_ACTION_SET_CONFIG(action_cfg),
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_common_reject(m_pHandle,
+ TSIP_ACTION_SET_CONFIG(action_cfg),
+ TSIP_ACTION_SET_NULL()) == 0);
}
/* ======================== SubscriptionSession ========================*/
SubscriptionSession::SubscriptionSession(SipStack* pStack)
-: SipSession(pStack)
+ : SipSession(pStack)
{
}
SubscriptionSession::SubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
-: SipSession(pStack, pHandle)
+ : SipSession(pStack, pHandle)
{
}
@@ -1033,12 +1032,12 @@ SubscriptionSession::~SubscriptionSession()
bool SubscriptionSession::subscribe()
{
- return (tsip_api_subscribe_send_subscribe(m_pHandle,
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_subscribe_send_subscribe(m_pHandle,
+ TSIP_ACTION_SET_NULL()) == 0);
}
bool SubscriptionSession::unSubscribe()
{
- return (tsip_api_subscribe_send_unsubscribe(m_pHandle,
- TSIP_ACTION_SET_NULL()) == 0);
+ return (tsip_api_subscribe_send_unsubscribe(m_pHandle,
+ TSIP_ACTION_SET_NULL()) == 0);
}
diff --git a/bindings/_common/SipSession.h b/bindings/_common/SipSession.h
index 7a0963b..a77418d 100755
--- a/bindings/_common/SipSession.h
+++ b/bindings/_common/SipSession.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -34,63 +34,77 @@ class MsrpCallback;
class MediaSessionMgr;
/* ======================== T140Callback ========================*/
-class TINYWRAP_API T140CallbackData{
- public:
+class TINYWRAP_API T140CallbackData
+{
+public:
#if !defined(SWIG)
- T140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size){
- m_eType = data_type;
- m_pPtr = data_ptr;
- m_nSize = data_size;
- }
+ T140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size) {
+ m_eType = data_type;
+ m_pPtr = data_ptr;
+ m_nSize = data_size;
+ }
#endif
- virtual ~T140CallbackData(){}
-
- inline enum tmedia_t140_data_type_e getType()const{ return m_eType; }
- inline unsigned getSize()const{ return m_nSize; }
- inline unsigned getData(void* pOutput, unsigned nMaxsize)const{
- unsigned nRetsize = 0;
- if(pOutput && nMaxsize && m_pPtr){
- nRetsize = (m_nSize > nMaxsize) ? nMaxsize : m_nSize;
- memcpy(pOutput, m_pPtr, nRetsize);
- }
- return nRetsize;
- }
-
- private:
- enum tmedia_t140_data_type_e m_eType;
- const void* m_pPtr;
- unsigned m_nSize;
+ virtual ~T140CallbackData() {}
+
+ inline enum tmedia_t140_data_type_e getType()const {
+ return m_eType;
+ }
+ inline unsigned getSize()const {
+ return m_nSize;
+ }
+ inline unsigned getData(void* pOutput, unsigned nMaxsize)const {
+ unsigned nRetsize = 0;
+ if(pOutput && nMaxsize && m_pPtr) {
+ nRetsize = (m_nSize > nMaxsize) ? nMaxsize : m_nSize;
+ memcpy(pOutput, m_pPtr, nRetsize);
+ }
+ return nRetsize;
+ }
+
+private:
+ enum tmedia_t140_data_type_e m_eType;
+ const void* m_pPtr;
+ unsigned m_nSize;
};
class TINYWRAP_API T140Callback
{
public:
- T140Callback() {}
- virtual ~T140Callback(){}
- virtual int ondata(const T140CallbackData* pData){ return 0; }
+ T140Callback() {}
+ virtual ~T140Callback() {}
+ virtual int ondata(const T140CallbackData* pData) {
+ return 0;
+ }
};
#if !defined(SWIG)
-class RtcpCallbackData{
- public:
- RtcpCallbackData(enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media){
- m_eType = event_type;
- m_nSSRC = ssrc_media;
- }
- virtual ~RtcpCallbackData(){}
- inline enum tmedia_rtcp_event_type_e getType()const{ return m_eType; }
- inline uint32_t getSSRC()const{ return m_nSSRC; }
- private:
- enum tmedia_rtcp_event_type_e m_eType;
- uint32_t m_nSSRC;
+class RtcpCallbackData
+{
+public:
+ RtcpCallbackData(enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media) {
+ m_eType = event_type;
+ m_nSSRC = ssrc_media;
+ }
+ virtual ~RtcpCallbackData() {}
+ inline enum tmedia_rtcp_event_type_e getType()const {
+ return m_eType;
+ }
+ inline uint32_t getSSRC()const {
+ return m_nSSRC;
+ }
+private:
+ enum tmedia_rtcp_event_type_e m_eType;
+ uint32_t m_nSSRC;
};
class TINYWRAP_API RtcpCallback
{
public:
- RtcpCallback() {}
- virtual ~RtcpCallback(){}
- virtual int onevent(const RtcpCallbackData* e){ return 0; }
+ RtcpCallback() {}
+ virtual ~RtcpCallback() {}
+ virtual int onevent(const RtcpCallbackData* e) {
+ return 0;
+ }
};
#endif /* #if !defined(SWIG) */
@@ -100,65 +114,67 @@ public:
class TINYWRAP_API SipSession
{
public:
- SipSession(SipStack* stack);
+ SipSession(SipStack* stack);
#if !defined(SWIG)
- SipSession(SipStack* stack, tsip_ssession_handle_t* pHandle);
+ SipSession(SipStack* stack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~SipSession();
+ virtual ~SipSession();
public:
- bool haveOwnership();
- bool addHeader(const char* name, const char* value);
- bool removeHeader(const char* name);
- bool addCaps(const char* name, const char* value);
- bool addCaps(const char* name);
- bool removeCaps(const char* name);
- bool setExpires(unsigned expires);
- bool setFromUri(const char* fromUriString);
- bool setFromUri(const SipUri* fromUri);
- bool setToUri(const char* toUriString);
- bool setToUri(const SipUri* toUri);
- bool setSilentHangup(bool silent);
- bool addSigCompCompartment(const char* compId);
- bool removeSigCompCompartment();
+ bool haveOwnership();
+ bool addHeader(const char* name, const char* value);
+ bool removeHeader(const char* name);
+ bool addCaps(const char* name, const char* value);
+ bool addCaps(const char* name);
+ bool removeCaps(const char* name);
+ bool setExpires(unsigned expires);
+ bool setFromUri(const char* fromUriString);
+ bool setFromUri(const SipUri* fromUri);
+ bool setToUri(const char* toUriString);
+ bool setToUri(const SipUri* toUri);
+ bool setSilentHangup(bool silent);
+ bool addSigCompCompartment(const char* compId);
+ bool removeSigCompCompartment();
#if !defined(SWIG)
- bool setAuth(const char* authHa1, const char* authIMPI);
+ bool setAuth(const char* authHa1, const char* authIMPI);
#endif
- unsigned getId()const;
+ unsigned getId()const;
#if !defined(SWIG)
- bool setWebSocketSrc(const char* host, int32_t port, const char* proto);
- const SipStack* getStack() const;
- const tsip_ssession_handle_t* getWrappedSession() { return m_pHandle; }
+ bool setWebSocketSrc(const char* host, int32_t port, const char* proto);
+ const SipStack* getStack() const;
+ const tsip_ssession_handle_t* getWrappedSession() {
+ return m_pHandle;
+ }
#endif
-
+
private:
- void init(SipStack* stack, tsip_ssession_handle_t* pHandle=tsk_null);
+ void init(SipStack* stack, tsip_ssession_handle_t* pHandle=tsk_null);
protected:
- tsip_ssession_handle_t* m_pHandle;
- const SipStack* m_pStack;
+ tsip_ssession_handle_t* m_pHandle;
+ const SipStack* m_pStack;
};
/* ======================== InviteSession ========================*/
class TINYWRAP_API InviteSession : public SipSession
{
public: /* ctor() and dtor() */
- InviteSession(SipStack* Stack);
+ InviteSession(SipStack* Stack);
#if !defined(SWIG)
- InviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ InviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~InviteSession();
+ virtual ~InviteSession();
public: /* Public functions */
- bool accept(ActionConfig* config=tsk_null);
- bool hangup(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
- bool sendInfo(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- const MediaSessionMgr* getMediaMgr();
+ bool accept(ActionConfig* config=tsk_null);
+ bool hangup(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
+ bool sendInfo(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ const MediaSessionMgr* getMediaMgr();
private:
- MediaSessionMgr* m_pMediaMgr;
+ MediaSessionMgr* m_pMediaMgr;
};
@@ -166,92 +182,92 @@ private:
class TINYWRAP_API CallSession : public InviteSession
{
public: /* ctor() and dtor() */
- CallSession(SipStack* pStack);
+ CallSession(SipStack* pStack);
#if !defined(SWIG)
- CallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ CallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~CallSession();
+ virtual ~CallSession();
public: /* Public functions */
- bool callAudio(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
- bool callAudio(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
- bool callAudioVideo(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
- bool callAudioVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
- bool callVideo(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
- bool callVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
-
- bool call(const char* remoteUriString, twrap_media_type_t media, ActionConfig* config=tsk_null);
- bool call(const SipUri* remoteUri, twrap_media_type_t media, ActionConfig* config=tsk_null);
+ bool callAudio(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callAudio(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callAudioVideo(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callAudioVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callVideo(const char* remoteUriString, ActionConfig* config=tsk_null); /* @deprecated */
+ bool callVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null); /* @deprecated */
+
+ bool call(const char* remoteUriString, twrap_media_type_t media, ActionConfig* config=tsk_null);
+ bool call(const SipUri* remoteUri, twrap_media_type_t media, ActionConfig* config=tsk_null);
#if !defined(SWIG)
- bool setSupportedCodecs(int32_t codecs);
- int32_t getNegotiatedCodecs();
- bool setMediaSSRC(twrap_media_type_t media, uint32_t ssrc);
+ bool setSupportedCodecs(int32_t codecs);
+ int32_t getNegotiatedCodecs();
+ bool setMediaSSRC(twrap_media_type_t media, uint32_t ssrc);
#endif
- bool setSessionTimer(unsigned timeout, const char* refresher);
- bool set100rel(bool enabled);
- bool setRtcp(bool enabled);
- bool setRtcpMux(bool enabled);
- bool setSRtpMode(enum tmedia_srtp_mode_e mode);
- bool setAvpfMode(enum tmedia_mode_e mode);
- bool setICE(bool enabled);
- bool setICEStun(bool enabled);
- bool setICETurn(bool enabled);
- bool setSTUNServer(const char* hostname, uint16_t port);
- bool setSTUNCred(const char* username, const char* password);
- bool setVideoFps(int32_t fps);
- bool setVideoBandwidthUploadMax(int32_t max);
- bool setVideoBandwidthDownloadMax(int32_t max);
- bool setVideoPrefSize(tmedia_pref_video_size_t pref_video_size);
- bool setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength);
- bool hold(ActionConfig* config=tsk_null);
- bool resume(ActionConfig* config=tsk_null);
- bool transfer(const char* referToUriString, ActionConfig* config=tsk_null);
- bool acceptTransfer(ActionConfig* config=tsk_null);
- bool rejectTransfer(ActionConfig* config=tsk_null);
- bool sendDTMF(int number);
- unsigned getSessionTransferId();
- bool sendT140Data(enum tmedia_t140_data_type_e data_type, const void* data_ptr = NULL, unsigned data_size = 0);
- bool setT140Callback(const T140Callback* pT140Callback);
+ bool setSessionTimer(unsigned timeout, const char* refresher);
+ bool set100rel(bool enabled);
+ bool setRtcp(bool enabled);
+ bool setRtcpMux(bool enabled);
+ bool setSRtpMode(enum tmedia_srtp_mode_e mode);
+ bool setAvpfMode(enum tmedia_mode_e mode);
+ bool setICE(bool enabled);
+ bool setICEStun(bool enabled);
+ bool setICETurn(bool enabled);
+ bool setSTUNServer(const char* hostname, uint16_t port);
+ bool setSTUNCred(const char* username, const char* password);
+ bool setVideoFps(int32_t fps);
+ bool setVideoBandwidthUploadMax(int32_t max);
+ bool setVideoBandwidthDownloadMax(int32_t max);
+ bool setVideoPrefSize(tmedia_pref_video_size_t pref_video_size);
+ bool setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength);
+ bool hold(ActionConfig* config=tsk_null);
+ bool resume(ActionConfig* config=tsk_null);
+ bool transfer(const char* referToUriString, ActionConfig* config=tsk_null);
+ bool acceptTransfer(ActionConfig* config=tsk_null);
+ bool rejectTransfer(ActionConfig* config=tsk_null);
+ bool sendDTMF(int number);
+ unsigned getSessionTransferId();
+ bool sendT140Data(enum tmedia_t140_data_type_e data_type, const void* data_ptr = NULL, unsigned data_size = 0);
+ bool setT140Callback(const T140Callback* pT140Callback);
#if !defined(SWIG)
- bool sendRtcpEvent(enum tmedia_rtcp_event_type_e event_type, twrap_media_type_t media_type, uint32_t ssrc_media = 0);
- bool setRtcpCallback(const RtcpCallback* pRtcpCallback, twrap_media_type_t media_type);
- const T140Callback* getT140Callback() const;
- static int t140OnDataCallback(const void* context, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
- const RtcpCallback* getRtcpCallback() const;
- static int rtcpOnCallback(const void* context, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
+ bool sendRtcpEvent(enum tmedia_rtcp_event_type_e event_type, twrap_media_type_t media_type, uint32_t ssrc_media = 0);
+ bool setRtcpCallback(const RtcpCallback* pRtcpCallback, twrap_media_type_t media_type);
+ const T140Callback* getT140Callback() const;
+ static int t140OnDataCallback(const void* context, enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
+ const RtcpCallback* getRtcpCallback() const;
+ static int rtcpOnCallback(const void* context, enum tmedia_rtcp_event_type_e event_type, uint32_t ssrc_media);
#endif /* #if !defined(SWIG) */
private:
- const T140Callback* m_pT140Callback;
- const RtcpCallback* m_pRtcpCallback;
+ const T140Callback* m_pT140Callback;
+ const RtcpCallback* m_pRtcpCallback;
};
/* ======================== MsrpSession ========================*/
class TINYWRAP_API MsrpSession : public InviteSession
{
public: /* ctor() and dtor() */
- MsrpSession(SipStack* pStack, MsrpCallback* pCallback);
+ MsrpSession(SipStack* pStack, MsrpCallback* pCallback);
#if !defined(SWIG)
- MsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ MsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~MsrpSession();
+ virtual ~MsrpSession();
public: /* Public functions */
- bool setCallback(MsrpCallback* pCallback);
- bool callMsrp(const char* remoteUriString, ActionConfig* config=tsk_null);
- bool callMsrp(const SipUri* remoteUri, ActionConfig* config=tsk_null);
- bool sendMessage(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- bool sendFile(ActionConfig* config=tsk_null);
+ bool setCallback(MsrpCallback* pCallback);
+ bool callMsrp(const char* remoteUriString, ActionConfig* config=tsk_null);
+ bool callMsrp(const SipUri* remoteUri, ActionConfig* config=tsk_null);
+ bool sendMessage(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ bool sendFile(ActionConfig* config=tsk_null);
- public: /* Public helper function */
+public: /* Public helper function */
#if !defined(SWIG)
- inline MsrpCallback* getCallback()const{
- return m_pCallback;
- }
+ inline MsrpCallback* getCallback()const {
+ return m_pCallback;
+ }
#endif
private:
- MsrpCallback* m_pCallback;
+ MsrpCallback* m_pCallback;
};
@@ -260,48 +276,48 @@ private:
class TINYWRAP_API MessagingSession : public SipSession
{
public: /* ctor() and dtor() */
- MessagingSession(SipStack* pStack);
+ MessagingSession(SipStack* pStack);
#if !defined(SWIG)
- MessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ MessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~MessagingSession();
+ virtual ~MessagingSession();
public: /* Public functions */
- bool send(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- bool accept(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
+ bool send(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ bool accept(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
};
/* ======================== InfoSession ========================*/
class TINYWRAP_API InfoSession : public SipSession
{
public: /* ctor() and dtor() */
- InfoSession(SipStack* pStack);
+ InfoSession(SipStack* pStack);
#if !defined(SWIG)
- InfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ InfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~InfoSession();
+ virtual ~InfoSession();
public: /* Public functions */
- bool send(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- bool accept(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
+ bool send(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ bool accept(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
};
/* ======================== OptionsSession ========================*/
class TINYWRAP_API OptionsSession : public SipSession
{
public: /* ctor() and dtor() */
- OptionsSession(SipStack* pStack);
+ OptionsSession(SipStack* pStack);
#if !defined(SWIG)
- OptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ OptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~OptionsSession();
+ virtual ~OptionsSession();
public: /* Public functions */
- bool send(ActionConfig* config=tsk_null);
- bool accept(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
+ bool send(ActionConfig* config=tsk_null);
+ bool accept(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
};
@@ -310,15 +326,15 @@ public: /* Public functions */
class TINYWRAP_API PublicationSession : public SipSession
{
public: /* ctor() and dtor() */
- PublicationSession(SipStack* pStack);
+ PublicationSession(SipStack* pStack);
#if !defined(SWIG)
- PublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ PublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~PublicationSession();
+ virtual ~PublicationSession();
public: /* Public functions */
- bool publish(const void* payload, unsigned len, ActionConfig* config=tsk_null);
- bool unPublish(ActionConfig* config=tsk_null);
+ bool publish(const void* payload, unsigned len, ActionConfig* config=tsk_null);
+ bool unPublish(ActionConfig* config=tsk_null);
};
@@ -326,17 +342,17 @@ public: /* Public functions */
class TINYWRAP_API RegistrationSession : public SipSession
{
public: /* ctor() and dtor() */
- RegistrationSession(SipStack* pStack);
+ RegistrationSession(SipStack* pStack);
#if !defined(SWIG)
- RegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ RegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~RegistrationSession();
+ virtual ~RegistrationSession();
public: /* Public functions */
- bool register_(ActionConfig* config=tsk_null);
- bool unRegister(ActionConfig* config=tsk_null);
- bool accept(ActionConfig* config=tsk_null);
- bool reject(ActionConfig* config=tsk_null);
+ bool register_(ActionConfig* config=tsk_null);
+ bool unRegister(ActionConfig* config=tsk_null);
+ bool accept(ActionConfig* config=tsk_null);
+ bool reject(ActionConfig* config=tsk_null);
};
@@ -344,15 +360,15 @@ public: /* Public functions */
class TINYWRAP_API SubscriptionSession : public SipSession
{
public: /* ctor() and dtor() */
- SubscriptionSession(SipStack* pStack);
+ SubscriptionSession(SipStack* pStack);
#if !defined(SWIG)
- SubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ SubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
- virtual ~SubscriptionSession();
+ virtual ~SubscriptionSession();
public: /* Public functions */
- bool subscribe();
- bool unSubscribe();
+ bool subscribe();
+ bool unSubscribe();
};
#endif /* TINYWRAP_SIPSESSION_H */
diff --git a/bindings/_common/SipStack.cxx b/bindings/_common/SipStack.cxx
index 5ec3680..66def3b 100755
--- a/bindings/_common/SipStack.cxx
+++ b/bindings/_common/SipStack.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -36,585 +36,586 @@ static int stack_callback(const tsip_event_t *sipevent);
static int session_handle_event(const tsip_event_t *sipevent);
SipStack::SipStack(SipCallback* pCallback, const char* realm_uri, const char* impi_uri, const char* impu_uri)
-:SafeObject()
+ :SafeObject()
{
- m_pDebugCallback = tsk_null;
- m_pCallback = pCallback;
+ m_pDebugCallback = tsk_null;
+ m_pCallback = pCallback;
- /* Initialize network and media layers */
- if(!SipStack::initialize()){
- return;// isValid() will be false
- }
+ /* Initialize network and media layers */
+ if(!SipStack::initialize()) {
+ return;// isValid() will be false
+ }
- /* Creates stack handle */
- m_pHandle = tsip_stack_create(stack_callback, realm_uri, impi_uri, impu_uri,
- TSIP_STACK_SET_USERDATA(this), /* used as context (useful for server-initiated requests) */
- TSIP_STACK_SET_NULL());
+ /* Creates stack handle */
+ m_pHandle = tsip_stack_create(stack_callback, realm_uri, impi_uri, impu_uri,
+ TSIP_STACK_SET_USERDATA(this), /* used as context (useful for server-initiated requests) */
+ TSIP_STACK_SET_NULL());
}
SipStack::~SipStack()
{
- this->stop();
+ this->stop();
- /* Destroy stack handle */
- TSK_OBJECT_SAFE_FREE(m_pHandle);
+ /* Destroy stack handle */
+ TSK_OBJECT_SAFE_FREE(m_pHandle);
}
bool SipStack::start()
{
- bool ret = (tsip_stack_start(m_pHandle) == 0);
- return ret;
+ bool ret = (tsip_stack_start(m_pHandle) == 0);
+ return ret;
}
bool SipStack::setDebugCallback(DDebugCallback* pCallback)
{
- if(this && pCallback){
- m_pDebugCallback = pCallback;
- tsk_debug_set_arg_data(this);
- tsk_debug_set_info_cb(DDebugCallback::debug_info_cb);
- tsk_debug_set_warn_cb(DDebugCallback::debug_warn_cb);
- tsk_debug_set_error_cb(DDebugCallback::debug_error_cb);
- tsk_debug_set_fatal_cb(DDebugCallback::debug_fatal_cb);
- }
- else if(this){
- m_pDebugCallback = tsk_null;
- tsk_debug_set_arg_data(tsk_null);
- tsk_debug_set_info_cb(tsk_null);
- tsk_debug_set_warn_cb(tsk_null);
- tsk_debug_set_error_cb(tsk_null);
- tsk_debug_set_fatal_cb(tsk_null);
- }
-
- return true;
+ if(this && pCallback) {
+ m_pDebugCallback = pCallback;
+ tsk_debug_set_arg_data(this);
+ tsk_debug_set_info_cb(DDebugCallback::debug_info_cb);
+ tsk_debug_set_warn_cb(DDebugCallback::debug_warn_cb);
+ tsk_debug_set_error_cb(DDebugCallback::debug_error_cb);
+ tsk_debug_set_fatal_cb(DDebugCallback::debug_fatal_cb);
+ }
+ else if(this) {
+ m_pDebugCallback = tsk_null;
+ tsk_debug_set_arg_data(tsk_null);
+ tsk_debug_set_info_cb(tsk_null);
+ tsk_debug_set_warn_cb(tsk_null);
+ tsk_debug_set_error_cb(tsk_null);
+ tsk_debug_set_fatal_cb(tsk_null);
+ }
+
+ return true;
}
bool SipStack::setDisplayName(const char* display_name)
{
- int ret = tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_DISPLAY_NAME(display_name),
- TSIP_STACK_SET_NULL());
- return (ret == 0);
+ int ret = tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_DISPLAY_NAME(display_name),
+ TSIP_STACK_SET_NULL());
+ return (ret == 0);
}
bool SipStack::setRealm(const char* realm_uri)
{
- int ret = tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_REALM(realm_uri),
- TSIP_STACK_SET_NULL());
- return (ret == 0);
+ int ret = tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_REALM(realm_uri),
+ TSIP_STACK_SET_NULL());
+ return (ret == 0);
}
bool SipStack::setIMPI(const char* impi)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IMPI(impi),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IMPI(impi),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setIMPU(const char* impu_uri)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IMPU(impu_uri),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IMPU(impu_uri),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setPassword(const char* password)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_PASSWORD(password),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_PASSWORD(password),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setAMF(const char* amf)
{
- uint16_t _amf = (uint16_t)tsk_atox(amf);
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IMS_AKA_AMF(_amf),
- TSIP_STACK_SET_NULL()) == 0);
+ uint16_t _amf = (uint16_t)tsk_atox(amf);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IMS_AKA_AMF(_amf),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setOperatorId(const char* opid)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IMS_AKA_OPERATOR_ID(opid),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IMS_AKA_OPERATOR_ID(opid),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setProxyCSCF(const char* fqdn, unsigned short port, const char* transport, const char* ipversion)
{
- unsigned _port = port;//promote
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_PROXY_CSCF(fqdn, _port, transport, ipversion),
- TSIP_STACK_SET_NULL()) == 0);
+ unsigned _port = port;//promote
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_PROXY_CSCF(fqdn, _port, transport, ipversion),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setLocalIP(const char* ip, const char* transport/*=tsk_null*/)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_LOCAL_IP_2(transport, ip),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_LOCAL_IP_2(transport, ip),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setLocalPort(unsigned short port, const char* transport/*=tsk_null*/)
{
- unsigned _port = port;//promote
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_LOCAL_PORT_2(transport, _port),
- TSIP_STACK_SET_NULL()) == 0);
+ unsigned _port = port;//promote
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_LOCAL_PORT_2(transport, _port),
+ TSIP_STACK_SET_NULL()) == 0);
}
-bool SipStack::setEarlyIMS(bool enabled){
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_EARLY_IMS(enabled? tsk_true : tsk_false),
- TSIP_STACK_SET_NULL()) == 0);
+bool SipStack::setEarlyIMS(bool enabled)
+{
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_EARLY_IMS(enabled? tsk_true : tsk_false),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::addHeader(const char* name, const char* value)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_HEADER(name, value),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_HEADER(name, value),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::removeHeader(const char* name)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_UNSET_HEADER(name),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_UNSET_HEADER(name),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::addDnsServer(const char* ip)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_DNS_SERVER(ip),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_DNS_SERVER(ip),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setDnsDiscovery(bool enabled)
{
- tsk_bool_t _enabled = enabled;// 32bit/64bit workaround
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_DISCOVERY_NAPTR(_enabled),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enabled = enabled;// 32bit/64bit workaround
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_DISCOVERY_NAPTR(_enabled),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setAoR(const char* ip, int port)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_AOR(ip, port),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_AOR(ip, port),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setMode(enum tsip_stack_mode_e mode)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_MODE(mode),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_MODE(mode),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict)
{
- tsk_bool_t _enablePresDict= enablePresDict;// 32bit/64bit workaround
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_SIGCOMP(dms, sms, cpb, _enablePresDict),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enablePresDict= enablePresDict;// 32bit/64bit workaround
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_SIGCOMP(dms, sms, cpb, _enablePresDict),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::addSigCompCompartment(const char* compId)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_SIGCOMP_NEW_COMPARTMENT(compId),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_SIGCOMP_NEW_COMPARTMENT(compId),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::removeSigCompCompartment(const char* compId)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_UNSET_SIGCOMP_COMPARTMENT(compId),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_UNSET_SIGCOMP_COMPARTMENT(compId),
+ TSIP_STACK_SET_NULL()) == 0);
}
- // @deprecated
+// @deprecated
bool SipStack::setSTUNEnabledForICE(bool enabled)
{
#if 0
- tsk_bool_t _enabled = enabled ? tsk_true : tsk_false;
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_ICE_STUN_ENABLED(_enabled),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enabled = enabled ? tsk_true : tsk_false;
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_ICE_STUN_ENABLED(_enabled),
+ TSIP_STACK_SET_NULL()) == 0);
#else
- // set global value
- return (tmedia_defaults_set_icestun_enabled(enabled ? tsk_true : tsk_false) == 0);
- // to set the value per session, use "CallSession::setICEStun()"
+ // set global value
+ return (tmedia_defaults_set_icestun_enabled(enabled ? tsk_true : tsk_false) == 0);
+ // to set the value per session, use "CallSession::setICEStun()"
#endif
}
- // @deprecated
+// @deprecated
bool SipStack::setSTUNServer(const char* hostname, unsigned short port)
{
#if 0
- unsigned _port = port;//promote
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_STUN_SERVER(hostname, _port),
- TSIP_STACK_SET_NULL()) == 0);
+ unsigned _port = port;//promote
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_STUN_SERVER(hostname, _port),
+ TSIP_STACK_SET_NULL()) == 0);
#else
- // set global value
- return (tmedia_defaults_set_stun_server(hostname, port) == 0);
- // to set the value per session, use "CallSession::setSTUNServer()"
+ // set global value
+ return (tmedia_defaults_set_stun_server(hostname, port) == 0);
+ // to set the value per session, use "CallSession::setSTUNServer()"
#endif
}
- // @deprecated
+// @deprecated
bool SipStack::setSTUNCred(const char* login, const char* password)
{
#if 0
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_STUN_CRED(login, password),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_STUN_CRED(login, password),
+ TSIP_STACK_SET_NULL()) == 0);
#else
- // set global value
- return (tmedia_defaults_set_stun_cred(login, password) == 0);
- // to set the value per session, use "CallSession::setSTUNCred()"
+ // set global value
+ return (tmedia_defaults_set_stun_cred(login, password) == 0);
+ // to set the value per session, use "CallSession::setSTUNCred()"
#endif
}
bool SipStack::setSTUNEnabled(bool enabled)
{
- tsk_bool_t _enabled = enabled ? tsk_true : tsk_false;
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_STUN_ENABLED(_enabled),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enabled = enabled ? tsk_true : tsk_false;
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_STUN_ENABLED(_enabled),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setTLSSecAgree(bool enabled)
{
- tsk_bool_t _enable = enabled ? tsk_true : tsk_false;
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_SECAGREE_TLS(_enable),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enable = enabled ? tsk_true : tsk_false;
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_SECAGREE_TLS(_enable),
+ TSIP_STACK_SET_NULL()) == 0);
}
/*@deprecated: typo */
bool SipStack::setSSLCretificates(const char* privKey, const char* pubKey, const char* caKey, bool verify/* = false*/)
{
- return setSSLCertificates(privKey, pubKey, caKey, verify);
+ return setSSLCertificates(privKey, pubKey, caKey, verify);
}
bool SipStack::setSSLCertificates(const char* privKey, const char* pubKey, const char* caKey, bool verify/* = false*/)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_TLS_CERTS_2(caKey, pubKey, privKey, (verify ? tsk_true : tsk_false)),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_TLS_CERTS_2(caKey, pubKey, privKey, (verify ? tsk_true : tsk_false)),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setIPSecSecAgree(bool enabled)
{
- tsk_bool_t _enable = enabled;
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_SECAGREE_IPSEC(_enable),
- TSIP_STACK_SET_NULL()) == 0);
+ tsk_bool_t _enable = enabled;
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_SECAGREE_IPSEC(_enable),
+ TSIP_STACK_SET_NULL()) == 0);
}
bool SipStack::setIPSecParameters(const char* algo, const char* ealgo, const char* mode, const char* proto)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_IPSEC_PARAMS(algo, ealgo, mode, proto),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_IPSEC_PARAMS(algo, ealgo, mode, proto),
+ TSIP_STACK_SET_NULL()) == 0);
}
char* SipStack::dnsENUM(const char* service, const char* e164num, const char* domain)
{
- tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
- char* uri = tsk_null;
+ tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
+ char* uri = tsk_null;
- if(dnsctx){
- if(!(uri = tnet_dns_enum_2(dnsctx, service, e164num, domain))){
- TSK_DEBUG_ERROR("ENUM(%s) failed", e164num);
- }
- tsk_object_unref(dnsctx);
- return uri;
- }
- else{
- TSK_DEBUG_ERROR("No DNS Context could be found");
- return tsk_null;
- }
+ if(dnsctx) {
+ if(!(uri = tnet_dns_enum_2(dnsctx, service, e164num, domain))) {
+ TSK_DEBUG_ERROR("ENUM(%s) failed", e164num);
+ }
+ tsk_object_unref(dnsctx);
+ return uri;
+ }
+ else {
+ TSK_DEBUG_ERROR("No DNS Context could be found");
+ return tsk_null;
+ }
}
char* SipStack::dnsNaptrSrv(const char* domain, const char* service, unsigned short *OUTPUT)
{
- tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
- char* ip = tsk_null;
- tnet_port_t port;
- *OUTPUT = 0;
-
-
- if(dnsctx){
- if(!tnet_dns_query_naptr_srv(dnsctx, domain, service, &ip, &port)){
- *OUTPUT = port;
- }
- tsk_object_unref(dnsctx);
- return ip;
- }
- else{
- TSK_DEBUG_ERROR("No DNS Context could be found");
- return tsk_null;
- }
+ tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
+ char* ip = tsk_null;
+ tnet_port_t port;
+ *OUTPUT = 0;
+
+
+ if(dnsctx) {
+ if(!tnet_dns_query_naptr_srv(dnsctx, domain, service, &ip, &port)) {
+ *OUTPUT = port;
+ }
+ tsk_object_unref(dnsctx);
+ return ip;
+ }
+ else {
+ TSK_DEBUG_ERROR("No DNS Context could be found");
+ return tsk_null;
+ }
}
char* SipStack::dnsSrv(const char* service, unsigned short* OUTPUT)
{
- tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
- char* ip = tsk_null;
- tnet_port_t port = 0;
- *OUTPUT = 0;
+ tnet_dns_ctx_t* dnsctx = tsip_stack_get_dnsctx(m_pHandle);
+ char* ip = tsk_null;
+ tnet_port_t port = 0;
+ *OUTPUT = 0;
- if(dnsctx){
- if(!tnet_dns_query_srv(dnsctx, service, &ip, &port)){
- *OUTPUT = port;
- }
- tsk_object_unref(dnsctx);
- return ip;
- }
- else{
- TSK_DEBUG_ERROR("No DNS Context could be found");
- return tsk_null;
- }
+ if(dnsctx) {
+ if(!tnet_dns_query_srv(dnsctx, service, &ip, &port)) {
+ *OUTPUT = port;
+ }
+ tsk_object_unref(dnsctx);
+ return ip;
+ }
+ else {
+ TSK_DEBUG_ERROR("No DNS Context could be found");
+ return tsk_null;
+ }
}
bool SipStack::setMaxFDs(unsigned max_fds)
{
- return (tsip_stack_set(m_pHandle,
- TSIP_STACK_SET_MAX_FDS(max_fds),
- TSIP_STACK_SET_NULL()) == 0);
+ return (tsip_stack_set(m_pHandle,
+ TSIP_STACK_SET_MAX_FDS(max_fds),
+ TSIP_STACK_SET_NULL()) == 0);
}
char* SipStack::getLocalIPnPort(const char* protocol, unsigned short* OUTPUT)
{
- tnet_ip_t ip;
- tnet_port_t port;
- int ret;
+ tnet_ip_t ip;
+ tnet_port_t port;
+ int ret;
- if(!OUTPUT || !protocol){
- TSK_DEBUG_ERROR("invalid parameter");
- return tsk_null;
- }
+ if(!OUTPUT || !protocol) {
+ TSK_DEBUG_ERROR("invalid parameter");
+ return tsk_null;
+ }
- if((ret = tsip_stack_get_local_ip_n_port(m_pHandle, protocol, &port, &ip))){
- TSK_DEBUG_ERROR("Failed to get local ip and port with error code=%d", ret);
- return tsk_null;
- }
+ if((ret = tsip_stack_get_local_ip_n_port(m_pHandle, protocol, &port, &ip))) {
+ TSK_DEBUG_ERROR("Failed to get local ip and port with error code=%d", ret);
+ return tsk_null;
+ }
- *OUTPUT = port;
- return tsk_strdup(ip); // See Swig %newobject
+ *OUTPUT = port;
+ return tsk_strdup(ip); // See Swig %newobject
}
char* SipStack::getPreferredIdentity()
{
- tsip_uri_t* ppid = tsip_stack_get_preferred_id(m_pHandle);
- char* str_ppid = tsk_null;
- if(ppid){
- str_ppid = tsip_uri_tostring(ppid, tsk_false, tsk_false);
- TSK_OBJECT_SAFE_FREE(ppid);
- }
- return str_ppid;
+ tsip_uri_t* ppid = tsip_stack_get_preferred_id(m_pHandle);
+ char* str_ppid = tsk_null;
+ if(ppid) {
+ str_ppid = tsip_uri_tostring(ppid, tsk_false, tsk_false);
+ TSK_OBJECT_SAFE_FREE(ppid);
+ }
+ return str_ppid;
}
bool SipStack::isValid()
{
- return (m_pHandle != tsk_null);
+ return (m_pHandle != tsk_null);
}
bool SipStack::stop()
{
- int ret = tsip_stack_stop(m_pHandle);
- return (ret == 0);
+ int ret = tsip_stack_stop(m_pHandle);
+ return (ret == 0);
}
bool SipStack::initialize()
{
- if (!g_bInitialized) {
- int ret;
-
- if((ret = tnet_startup())){
- TSK_DEBUG_ERROR("tnet_startup failed with error code=%d", ret);
- return false;
- }
- if((ret = thttp_startup())){
- TSK_DEBUG_ERROR("thttp_startup failed with error code=%d", ret);
- return false;
- }
- if((ret = tdav_init())){
- TSK_DEBUG_ERROR("tdav_init failed with error code=%d", ret);
- return false;
- }
- g_bInitialized = true;
- }
- return true;
+ if (!g_bInitialized) {
+ int ret;
+
+ if((ret = tnet_startup())) {
+ TSK_DEBUG_ERROR("tnet_startup failed with error code=%d", ret);
+ return false;
+ }
+ if((ret = thttp_startup())) {
+ TSK_DEBUG_ERROR("thttp_startup failed with error code=%d", ret);
+ return false;
+ }
+ if((ret = tdav_init())) {
+ TSK_DEBUG_ERROR("tdav_init failed with error code=%d", ret);
+ return false;
+ }
+ g_bInitialized = true;
+ }
+ return true;
}
bool SipStack::deInitialize()
{
- if (SipStack::g_bInitialized) {
- tdav_deinit();
- thttp_cleanup();
- tnet_cleanup();
- SipStack::g_bInitialized = false;
- }
- return false;
+ if (SipStack::g_bInitialized) {
+ tdav_deinit();
+ thttp_cleanup();
+ tnet_cleanup();
+ SipStack::g_bInitialized = false;
+ }
+ return false;
}
void SipStack::setCodecs(tdav_codec_id_t codecs)
{
- tdav_set_codecs(codecs);
+ tdav_set_codecs(codecs);
}
void SipStack::setCodecs_2(int64_t codecs) // For stupid languages
{
- SipStack::setCodecs((tdav_codec_id_t)codecs);
+ SipStack::setCodecs((tdav_codec_id_t)codecs);
}
bool SipStack::setCodecPriority(tdav_codec_id_t codec_id, int priority)
{
- return tdav_codec_set_priority(codec_id, priority) == 0;
+ return tdav_codec_set_priority(codec_id, priority) == 0;
}
bool SipStack::setCodecPriority_2(int codec_id, int priority)// For stupid languages
{
- return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
+ return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
}
bool SipStack::isCodecSupported(tdav_codec_id_t codec_id)
{
- return tdav_codec_is_supported(codec_id) ? true : false;
+ return tdav_codec_is_supported(codec_id) ? true : false;
}
bool SipStack::isIPSecSupported()
{
- return tdav_ipsec_is_supported() ? true : false;
+ return tdav_ipsec_is_supported() ? true : false;
}
static int stack_callback(const tsip_event_t *sipevent)
{
- int ret = 0;
- const SipStack* sipStack = tsk_null;
- SipEvent* e = tsk_null;
-
- if(!sipevent){ /* should never happen ...but who know? */
- TSK_DEBUG_WARN("Null SIP event.");
- return -1;
- }
- else {
- if(sipevent->type == tsip_event_stack && sipevent->userdata){
- /* sessionless event */
- sipStack = dyn_cast<const SipStack*>((const SipStack*)sipevent->userdata);
- }
- else {
- const void* userdata;
- /* gets the stack from the session */
- const tsip_stack_handle_t* stack_handle = tsip_ssession_get_stack(sipevent->ss);
- if(stack_handle && (userdata = tsip_stack_get_userdata(stack_handle))){
- sipStack = dyn_cast<const SipStack*>((const SipStack*)userdata);
- }
- }
- }
-
- if(!sipStack){
- TSK_DEBUG_WARN("Invalid SIP event (Stack is Null).");
- return -2;
- }
-
- sipStack->Lock();
-
- switch(sipevent->type){
- case tsip_event_register:
- { /* REGISTER */
- if(sipStack->getCallback()){
- e = new RegistrationEvent(sipevent);
- sipStack->getCallback()->OnRegistrationEvent((const RegistrationEvent*)e);
- }
- break;
- }
- case tsip_event_invite:
- { /* INVITE */
- if(sipStack->getCallback()){
- e = new InviteEvent(sipevent);
- sipStack->getCallback()->OnInviteEvent((const InviteEvent*)e);
- }
- break;
- }
- case tsip_event_message:
- { /* MESSAGE */
- if(sipStack->getCallback()){
- e = new MessagingEvent(sipevent);
- sipStack->getCallback()->OnMessagingEvent((const MessagingEvent*)e);
- }
- break;
- }
- case tsip_event_info:
- { /* INFO */
- if(sipStack->getCallback()){
- e = new InfoEvent(sipevent);
- sipStack->getCallback()->OnInfoEvent((const InfoEvent*)e);
- }
- break;
- }
- case tsip_event_options:
- { /* OPTIONS */
- if(sipStack->getCallback()){
- e = new OptionsEvent(sipevent);
- sipStack->getCallback()->OnOptionsEvent((const OptionsEvent*)e);
- }
- break;
- }
- case tsip_event_publish:
- { /* PUBLISH */
- if(sipStack->getCallback()){
- e = new PublicationEvent(sipevent);
- sipStack->getCallback()->OnPublicationEvent((const PublicationEvent*)e);
- }
- break;
- }
- case tsip_event_subscribe:
- { /* SUBSCRIBE */
- if(sipStack->getCallback()){
- e = new SubscriptionEvent(sipevent);
- sipStack->getCallback()->OnSubscriptionEvent((const SubscriptionEvent*)e);
- }
- break;
- }
-
- case tsip_event_dialog:
- { /* Common to all dialogs */
- if(sipStack->getCallback()){
- e = new DialogEvent(sipevent);
- sipStack->getCallback()->OnDialogEvent((const DialogEvent*)e);
- }
- break;
- }
-
- case tsip_event_stack:
- { /* Stack event */
- if(sipStack->getCallback()){
- e = new StackEvent(sipevent);
- sipStack->getCallback()->OnStackEvent((const StackEvent*)e);
- }
- break;
- }
-
- default:
- { /* Unsupported */
- TSK_DEBUG_WARN("%d not supported as SIP event.", sipevent->type);
- ret = -3;
- break;
- }
- }
-
- sipStack->UnLock();
-
- if(e){
- delete e;
- }
-
- return ret;
+ int ret = 0;
+ const SipStack* sipStack = tsk_null;
+ SipEvent* e = tsk_null;
+
+ if(!sipevent) { /* should never happen ...but who know? */
+ TSK_DEBUG_WARN("Null SIP event.");
+ return -1;
+ }
+ else {
+ if(sipevent->type == tsip_event_stack && sipevent->userdata) {
+ /* sessionless event */
+ sipStack = dyn_cast<const SipStack*>((const SipStack*)sipevent->userdata);
+ }
+ else {
+ const void* userdata;
+ /* gets the stack from the session */
+ const tsip_stack_handle_t* stack_handle = tsip_ssession_get_stack(sipevent->ss);
+ if(stack_handle && (userdata = tsip_stack_get_userdata(stack_handle))) {
+ sipStack = dyn_cast<const SipStack*>((const SipStack*)userdata);
+ }
+ }
+ }
+
+ if(!sipStack) {
+ TSK_DEBUG_WARN("Invalid SIP event (Stack is Null).");
+ return -2;
+ }
+
+ sipStack->Lock();
+
+ switch(sipevent->type) {
+ case tsip_event_register: {
+ /* REGISTER */
+ if(sipStack->getCallback()) {
+ e = new RegistrationEvent(sipevent);
+ sipStack->getCallback()->OnRegistrationEvent((const RegistrationEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_invite: {
+ /* INVITE */
+ if(sipStack->getCallback()) {
+ e = new InviteEvent(sipevent);
+ sipStack->getCallback()->OnInviteEvent((const InviteEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_message: {
+ /* MESSAGE */
+ if(sipStack->getCallback()) {
+ e = new MessagingEvent(sipevent);
+ sipStack->getCallback()->OnMessagingEvent((const MessagingEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_info: {
+ /* INFO */
+ if(sipStack->getCallback()) {
+ e = new InfoEvent(sipevent);
+ sipStack->getCallback()->OnInfoEvent((const InfoEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_options: {
+ /* OPTIONS */
+ if(sipStack->getCallback()) {
+ e = new OptionsEvent(sipevent);
+ sipStack->getCallback()->OnOptionsEvent((const OptionsEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_publish: {
+ /* PUBLISH */
+ if(sipStack->getCallback()) {
+ e = new PublicationEvent(sipevent);
+ sipStack->getCallback()->OnPublicationEvent((const PublicationEvent*)e);
+ }
+ break;
+ }
+ case tsip_event_subscribe: {
+ /* SUBSCRIBE */
+ if(sipStack->getCallback()) {
+ e = new SubscriptionEvent(sipevent);
+ sipStack->getCallback()->OnSubscriptionEvent((const SubscriptionEvent*)e);
+ }
+ break;
+ }
+
+ case tsip_event_dialog: {
+ /* Common to all dialogs */
+ if(sipStack->getCallback()) {
+ e = new DialogEvent(sipevent);
+ sipStack->getCallback()->OnDialogEvent((const DialogEvent*)e);
+ }
+ break;
+ }
+
+ case tsip_event_stack: {
+ /* Stack event */
+ if(sipStack->getCallback()) {
+ e = new StackEvent(sipevent);
+ sipStack->getCallback()->OnStackEvent((const StackEvent*)e);
+ }
+ break;
+ }
+
+ default: {
+ /* Unsupported */
+ TSK_DEBUG_WARN("%d not supported as SIP event.", sipevent->type);
+ ret = -3;
+ break;
+ }
+ }
+
+ sipStack->UnLock();
+
+ if(e) {
+ delete e;
+ }
+
+ return ret;
}
diff --git a/bindings/_common/SipStack.h b/bindings/_common/SipStack.h
index 1f41096..d7b8cdc 100755
--- a/bindings/_common/SipStack.h
+++ b/bindings/_common/SipStack.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -36,88 +36,88 @@ class DDebugCallback;
class TINYWRAP_API SipStack: public SafeObject
{
public: /* ctor() and dtor() */
- SipStack(SipCallback* pCallback, const char* realm_uri, const char* impi_uri, const char* impu_uri);
+ SipStack(SipCallback* pCallback, const char* realm_uri, const char* impi_uri, const char* impu_uri);
~SipStack();
public: /* API functions */
- bool start();
- bool setDebugCallback(DDebugCallback* pCallback);
- bool setDisplayName(const char* display_name);
- bool setRealm(const char* realm_uri);
- bool setIMPI(const char* impi);
- bool setIMPU(const char* impu_uri);
- bool setPassword(const char* password);
- bool setAMF(const char* amf);
- bool setOperatorId(const char* opid);
- bool setProxyCSCF(const char* fqdn, unsigned short port, const char* transport, const char* ipversion);
- bool setLocalIP(const char* ip, const char* transport=tsk_null);
- bool setLocalPort(unsigned short port, const char* transport=tsk_null);
- bool setEarlyIMS(bool enabled);
- bool addHeader(const char* name, const char* value);
- bool removeHeader(const char* name);
- bool addDnsServer(const char* ip);
- bool setDnsDiscovery(bool enabled);
- bool setAoR(const char* ip, int port);
+ bool start();
+ bool setDebugCallback(DDebugCallback* pCallback);
+ bool setDisplayName(const char* display_name);
+ bool setRealm(const char* realm_uri);
+ bool setIMPI(const char* impi);
+ bool setIMPU(const char* impu_uri);
+ bool setPassword(const char* password);
+ bool setAMF(const char* amf);
+ bool setOperatorId(const char* opid);
+ bool setProxyCSCF(const char* fqdn, unsigned short port, const char* transport, const char* ipversion);
+ bool setLocalIP(const char* ip, const char* transport=tsk_null);
+ bool setLocalPort(unsigned short port, const char* transport=tsk_null);
+ bool setEarlyIMS(bool enabled);
+ bool addHeader(const char* name, const char* value);
+ bool removeHeader(const char* name);
+ bool addDnsServer(const char* ip);
+ bool setDnsDiscovery(bool enabled);
+ bool setAoR(const char* ip, int port);
#if !defined(SWIG)
- bool setMode(enum tsip_stack_mode_e mode);
+ bool setMode(enum tsip_stack_mode_e mode);
#endif
- bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
- bool addSigCompCompartment(const char* compId);
- bool removeSigCompCompartment(const char* compId);
-
- bool setSTUNEnabledForICE(bool enabled); // @deprecated
- bool setSTUNServer(const char* hostname, unsigned short port); // @deprecated
- bool setSTUNCred(const char* login, const char* password); // @deprecated
- bool setSTUNEnabled(bool enabled);
-
- bool setTLSSecAgree(bool enabled);
- bool setSSLCertificates(const char* privKey, const char* pubKey, const char* caKey, bool verify = false);
- bool setSSLCretificates(const char* privKey, const char* pubKey, const char* caKey, bool verify = false); /*@deprecated: typo */
- bool setIPSecSecAgree(bool enabled);
- bool setIPSecParameters(const char* algo, const char* ealgo, const char* mode, const char* proto);
-
- char* dnsENUM(const char* service, const char* e164num, const char* domain);
- char* dnsNaptrSrv(const char* domain, const char* service, unsigned short *OUTPUT);
- char* dnsSrv(const char* service, unsigned short* OUTPUT);
-
- bool setMaxFDs(unsigned max_fds);
-
- char* getLocalIPnPort(const char* protocol, unsigned short* OUTPUT);
-
- char* getPreferredIdentity();
-
- bool isValid();
- bool stop();
-
- static bool initialize();
- static bool deInitialize();
- static void setCodecs(tdav_codec_id_t codecs);
- static void setCodecs_2(int64_t codecs); // For stupid languages
- static bool setCodecPriority(tdav_codec_id_t codec_id, int priority);
- static bool setCodecPriority_2(int codec, int priority);// For stupid languages
- static bool isCodecSupported(tdav_codec_id_t codec_id);
- static bool isIPSecSupported();
+ bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
+ bool addSigCompCompartment(const char* compId);
+ bool removeSigCompCompartment(const char* compId);
+
+ bool setSTUNEnabledForICE(bool enabled); // @deprecated
+ bool setSTUNServer(const char* hostname, unsigned short port); // @deprecated
+ bool setSTUNCred(const char* login, const char* password); // @deprecated
+ bool setSTUNEnabled(bool enabled);
+
+ bool setTLSSecAgree(bool enabled);
+ bool setSSLCertificates(const char* privKey, const char* pubKey, const char* caKey, bool verify = false);
+ bool setSSLCretificates(const char* privKey, const char* pubKey, const char* caKey, bool verify = false); /*@deprecated: typo */
+ bool setIPSecSecAgree(bool enabled);
+ bool setIPSecParameters(const char* algo, const char* ealgo, const char* mode, const char* proto);
+
+ char* dnsENUM(const char* service, const char* e164num, const char* domain);
+ char* dnsNaptrSrv(const char* domain, const char* service, unsigned short *OUTPUT);
+ char* dnsSrv(const char* service, unsigned short* OUTPUT);
+
+ bool setMaxFDs(unsigned max_fds);
+
+ char* getLocalIPnPort(const char* protocol, unsigned short* OUTPUT);
+
+ char* getPreferredIdentity();
+
+ bool isValid();
+ bool stop();
+
+ static bool initialize();
+ static bool deInitialize();
+ static void setCodecs(tdav_codec_id_t codecs);
+ static void setCodecs_2(int64_t codecs); // For stupid languages
+ static bool setCodecPriority(tdav_codec_id_t codec_id, int priority);
+ static bool setCodecPriority_2(int codec, int priority);// For stupid languages
+ static bool isCodecSupported(tdav_codec_id_t codec_id);
+ static bool isIPSecSupported();
public: /* Public helper function */
#if !defined(SWIG)
- inline tsip_stack_handle_t* getHandle()const{
- return m_pHandle;
- }
- inline SipCallback* getCallback()const{
- return m_pCallback;
- }
- inline DDebugCallback* getDebugCallback() const{
- return m_pDebugCallback;
- }
+ inline tsip_stack_handle_t* getHandle()const {
+ return m_pHandle;
+ }
+ inline SipCallback* getCallback()const {
+ return m_pCallback;
+ }
+ inline DDebugCallback* getDebugCallback() const {
+ return m_pDebugCallback;
+ }
#endif
private:
- SipCallback* m_pCallback;
- DDebugCallback* m_pDebugCallback;
- tsip_stack_handle_t* m_pHandle;
+ SipCallback* m_pCallback;
+ DDebugCallback* m_pDebugCallback;
+ tsip_stack_handle_t* m_pHandle;
- static bool g_bInitialized;
+ static bool g_bInitialized;
};
#endif /* TINYWRAP_SIPSTACK_H */
diff --git a/bindings/_common/SipUri.cxx b/bindings/_common/SipUri.cxx
index eaddf55..a55488e 100755
--- a/bindings/_common/SipUri.cxx
+++ b/bindings/_common/SipUri.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -23,80 +23,80 @@
SipUri::SipUri(const char* uriString, const char* displayName/*=tsk_null*/)
{
- if((m_pUri = tsip_uri_parse(uriString, (tsk_size_t)tsk_strlen(uriString))) && displayName){
- m_pUri->display_name = tsk_strdup(displayName);
- }
+ if((m_pUri = tsip_uri_parse(uriString, (tsk_size_t)tsk_strlen(uriString))) && displayName) {
+ m_pUri->display_name = tsk_strdup(displayName);
+ }
}
SipUri::~SipUri()
{
- TSK_OBJECT_SAFE_FREE(m_pUri);
+ TSK_OBJECT_SAFE_FREE(m_pUri);
}
bool SipUri::isValid(const char* uriString)
{
- tsip_uri_t* uri;
- bool ret = false;
+ tsip_uri_t* uri;
+ bool ret = false;
- if((uri = tsip_uri_parse(uriString, (tsk_size_t)tsk_strlen(uriString)))){
- ret = (uri->type != uri_unknown)
- && (!tsk_strnullORempty(uri->host));
- TSK_OBJECT_SAFE_FREE(uri);
- }
- return ret;
+ if((uri = tsip_uri_parse(uriString, (tsk_size_t)tsk_strlen(uriString)))) {
+ ret = (uri->type != uri_unknown)
+ && (!tsk_strnullORempty(uri->host));
+ TSK_OBJECT_SAFE_FREE(uri);
+ }
+ return ret;
}
bool SipUri::isValid()
{
- return (m_pUri != tsk_null);
+ return (m_pUri != tsk_null);
}
const char* SipUri::getScheme()
{
- if(m_pUri){
- return m_pUri->scheme;
- }
- return tsk_null;
+ if(m_pUri) {
+ return m_pUri->scheme;
+ }
+ return tsk_null;
}
const char* SipUri::getHost()
{
- return m_pUri ? m_pUri->host : tsk_null;
+ return m_pUri ? m_pUri->host : tsk_null;
}
unsigned short SipUri::getPort()
{
- return m_pUri ? m_pUri->port : 0;
+ return m_pUri ? m_pUri->port : 0;
}
const char* SipUri::getUserName()
{
- return m_pUri ? m_pUri->user_name : tsk_null;
+ return m_pUri ? m_pUri->user_name : tsk_null;
}
const char* SipUri::getPassword()
{
- return m_pUri ? m_pUri->password : tsk_null;
+ return m_pUri ? m_pUri->password : tsk_null;
}
const char* SipUri::getDisplayName()
{
- return m_pUri ? m_pUri->display_name : tsk_null;
+ return m_pUri ? m_pUri->display_name : tsk_null;
}
void SipUri::setDisplayName(const char* displayName)
{
- if(m_pUri){
- tsk_strupdate(&m_pUri->display_name, displayName);
- }
+ if(m_pUri) {
+ tsk_strupdate(&m_pUri->display_name, displayName);
+ }
}
const char* SipUri::getParamValue(const char* pname)
{
- if(m_pUri && m_pUri->params){
- const char* pvalue = tsk_params_get_param_value(m_pUri->params, pname);
- return pvalue;
- }
- return tsk_null;
+ if(m_pUri && m_pUri->params) {
+ const char* pvalue = tsk_params_get_param_value(m_pUri->params, pname);
+ return pvalue;
+ }
+ return tsk_null;
}
diff --git a/bindings/_common/SipUri.h b/bindings/_common/SipUri.h
index 9e2d15c..7baac53 100755
--- a/bindings/_common/SipUri.h
+++ b/bindings/_common/SipUri.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -29,29 +29,29 @@
class TINYWRAP_API SipUri
{
public:
- SipUri(const char* uriString, const char* displayName=tsk_null);
- ~SipUri();
+ SipUri(const char* uriString, const char* displayName=tsk_null);
+ ~SipUri();
public:
- static bool isValid(const char*);
+ static bool isValid(const char*);
- bool isValid();
- const char* getScheme();
- const char* getHost();
- unsigned short getPort();
- const char* getUserName();
- const char* getPassword();
- const char* getDisplayName();
- const char* getParamValue(const char* pname);
- void setDisplayName(const char* displayName);
+ bool isValid();
+ const char* getScheme();
+ const char* getHost();
+ unsigned short getPort();
+ const char* getUserName();
+ const char* getPassword();
+ const char* getDisplayName();
+ const char* getParamValue(const char* pname);
+ void setDisplayName(const char* displayName);
#if !defined(SWIG)
- inline const tsip_uri_t* getWrappedUri()const{
- return m_pUri;
- }
+ inline const tsip_uri_t* getWrappedUri()const {
+ return m_pUri;
+ }
#endif
private:
- tsip_uri_t* m_pUri;
+ tsip_uri_t* m_pUri;
};
#endif /* TINYWRAP_SIPURI_H */
diff --git a/bindings/_common/Xcap.cxx b/bindings/_common/Xcap.cxx
index adb5609..510cb99 100755
--- a/bindings/_common/Xcap.cxx
+++ b/bindings/_common/Xcap.cxx
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -29,241 +29,239 @@ unsigned XcapStack::count = 0;
static int stack_callback(const thttp_event_t *httpevent);
/* =================================== XCAP Event ==================================== */
-typedef enum twrap_xcap_step_type_e
-{
- txst_name,
- txst_pos,
- txst_att,
- txst_pos_n_att,
- txst_ns
+typedef enum twrap_xcap_step_type_e {
+ txst_name,
+ txst_pos,
+ txst_att,
+ txst_pos_n_att,
+ txst_ns
}
twrap_xcap_step_type_t;
-typedef struct twrap_xcap_step_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct twrap_xcap_step_s {
+ TSK_DECLARE_OBJECT;
- twrap_xcap_step_type_t type;
- char* qname;
- char* att_qname;
- char* att_value;
- unsigned pos;
- struct{
- char* prefix;
- char* value;
- } ns;
+ twrap_xcap_step_type_t type;
+ char* qname;
+ char* att_qname;
+ char* att_value;
+ unsigned pos;
+ struct {
+ char* prefix;
+ char* value;
+ } ns;
}
twrap_xcap_step_t;
static tsk_object_t* twrap_xcap_step_ctor(tsk_object_t * self, va_list * app)
{
- twrap_xcap_step_t *step = (twrap_xcap_step_t *)self;
- if(step){
- }
- return self;
+ twrap_xcap_step_t *step = (twrap_xcap_step_t *)self;
+ if(step) {
+ }
+ return self;
}
static tsk_object_t* twrap_xcap_step_dtor(tsk_object_t * self)
-{
- twrap_xcap_step_t *step = (twrap_xcap_step_t *)self;
- if(step){
- TSK_FREE(step->qname);
- TSK_FREE(step->att_qname);
- TSK_FREE(step->att_value);
- TSK_FREE(step->ns.prefix);
- TSK_FREE(step->ns.value);
- }
+{
+ twrap_xcap_step_t *step = (twrap_xcap_step_t *)self;
+ if(step) {
+ TSK_FREE(step->qname);
+ TSK_FREE(step->att_qname);
+ TSK_FREE(step->att_value);
+ TSK_FREE(step->ns.prefix);
+ TSK_FREE(step->ns.value);
+ }
- return self;
+ return self;
}
-static const tsk_object_def_t twrap_xcap_step_def_s =
-{
- sizeof(twrap_xcap_step_t),
- twrap_xcap_step_ctor,
- twrap_xcap_step_dtor,
- tsk_null,
+static const tsk_object_def_t twrap_xcap_step_def_s = {
+ sizeof(twrap_xcap_step_t),
+ twrap_xcap_step_ctor,
+ twrap_xcap_step_dtor,
+ tsk_null,
};
const tsk_object_def_t *twrap_xcap_step_def_t = &twrap_xcap_step_def_s;
-twrap_xcap_step_t* twrap_xcap_step_create(twrap_xcap_step_type_t type){
- twrap_xcap_step_t* step;
- if((step = (twrap_xcap_step_t*)tsk_object_new(twrap_xcap_step_def_t))){
- step->type = type;
- }
- return step;
+twrap_xcap_step_t* twrap_xcap_step_create(twrap_xcap_step_type_t type)
+{
+ twrap_xcap_step_t* step;
+ if((step = (twrap_xcap_step_t*)tsk_object_new(twrap_xcap_step_def_t))) {
+ step->type = type;
+ }
+ return step;
}
XcapSelector::XcapSelector(XcapStack* stack)
-: auid(tsk_null)
+ : auid(tsk_null)
{
- if(stack){
- this->stack_handle = tsk_object_ref(stack->getHandle());
- }
- this->steps = tsk_list_create();
+ if(stack) {
+ this->stack_handle = tsk_object_ref(stack->getHandle());
+ }
+ this->steps = tsk_list_create();
}
XcapSelector* XcapSelector::setAUID(const char* auid)
{
- tsk_strupdate(&this->auid, auid);
- return this;
+ tsk_strupdate(&this->auid, auid);
+ return this;
}
XcapSelector* XcapSelector::setName(const char* qname)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_name))){
- step->qname = tsk_strdup(qname);
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_name))) {
+ step->qname = tsk_strdup(qname);
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
XcapSelector* XcapSelector::setAttribute(const char* qname, const char* att_qname, const char* att_value)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_att))){
- step->qname = tsk_strdup(qname);
- step->att_qname = tsk_strdup(att_qname);
- step->att_value = tsk_strdup(att_value);
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_att))) {
+ step->qname = tsk_strdup(qname);
+ step->att_qname = tsk_strdup(att_qname);
+ step->att_value = tsk_strdup(att_value);
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
XcapSelector* XcapSelector::setPos(const char* qname, unsigned pos)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_pos))){
- step->qname = tsk_strdup(qname);
- step->pos = pos;
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_pos))) {
+ step->qname = tsk_strdup(qname);
+ step->pos = pos;
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
XcapSelector* XcapSelector::setPosAttribute(const char* qname, unsigned pos, const char* att_qname, const char* att_value)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_pos))){
- step->qname = tsk_strdup(qname);
- step->pos = pos;
- step->att_qname = tsk_strdup(att_qname);
- step->att_value = tsk_strdup(att_value);
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_pos))) {
+ step->qname = tsk_strdup(qname);
+ step->pos = pos;
+ step->att_qname = tsk_strdup(att_qname);
+ step->att_value = tsk_strdup(att_value);
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
XcapSelector* XcapSelector::setNamespace(const char* prefix, const char* value)
{
- twrap_xcap_step_t* step;
- if((step = twrap_xcap_step_create(txst_ns))){
- step->ns.prefix = tsk_strdup(prefix);
- step->ns.value = tsk_strdup(value);
- tsk_list_push_back_data(this->steps, (void**)&step);
- }
- return this;
+ twrap_xcap_step_t* step;
+ if((step = twrap_xcap_step_create(txst_ns))) {
+ step->ns.prefix = tsk_strdup(prefix);
+ step->ns.value = tsk_strdup(value);
+ tsk_list_push_back_data(this->steps, (void**)&step);
+ }
+ return this;
}
/* From tinyXCAP::txcap_selector_get_node_2() */
char* XcapSelector::getString()
{
- char* node = tsk_null;
- char* temp = tsk_null;
- char* _namespace = tsk_null;
- tsk_buffer_t* buffer = tsk_buffer_create_null();
- const tsk_list_item_t* item;
- const twrap_xcap_step_t* step;
-
- /* Node */
- tsk_list_foreach(item, this->steps){
- step = (twrap_xcap_step_t*)item->data;
- switch(step->type){
- case txst_name:
- if(tsk_buffer_append_2(buffer, "/%s", step->qname)){
- goto bail;
- }
- break;
-
- case txst_pos:
- tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D",
- step->att_qname, step->pos);
- break;
-
- case txst_att:
- tsk_buffer_append_2(buffer, "/%s%%5B@%s=%%22%s%%22%%5D",
- step->qname, step->att_qname, step->att_value);
- break;
-
- case txst_pos_n_att:
- tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D%%5B@%s=%%22%s%%22%%5D",
- step->qname, step->pos, step->att_qname, step->att_value);
- break;
-
- case txst_ns:
- tsk_sprintf(&temp, "%sxmlns(%s=%%22%s%%22)",
- _namespace?"":"%3F", step->ns.prefix, step->ns.value);
- tsk_strcat(&_namespace, temp);
- TSK_FREE(temp);
- break;
-
-
- } /* switch */
- } /* for */
-
- /* append the namespace */
- if(_namespace){
- tsk_buffer_append(buffer, _namespace, (tsk_size_t)tsk_strlen(_namespace));
- TSK_FREE(_namespace);
- }
+ char* node = tsk_null;
+ char* temp = tsk_null;
+ char* _namespace = tsk_null;
+ tsk_buffer_t* buffer = tsk_buffer_create_null();
+ const tsk_list_item_t* item;
+ const twrap_xcap_step_t* step;
+
+ /* Node */
+ tsk_list_foreach(item, this->steps) {
+ step = (twrap_xcap_step_t*)item->data;
+ switch(step->type) {
+ case txst_name:
+ if(tsk_buffer_append_2(buffer, "/%s", step->qname)) {
+ goto bail;
+ }
+ break;
+
+ case txst_pos:
+ tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D",
+ step->att_qname, step->pos);
+ break;
+
+ case txst_att:
+ tsk_buffer_append_2(buffer, "/%s%%5B@%s=%%22%s%%22%%5D",
+ step->qname, step->att_qname, step->att_value);
+ break;
+
+ case txst_pos_n_att:
+ tsk_buffer_append_2(buffer, "/%s%%5B%u%%5D%%5B@%s=%%22%s%%22%%5D",
+ step->qname, step->pos, step->att_qname, step->att_value);
+ break;
+
+ case txst_ns:
+ tsk_sprintf(&temp, "%sxmlns(%s=%%22%s%%22)",
+ _namespace?"":"%3F", step->ns.prefix, step->ns.value);
+ tsk_strcat(&_namespace, temp);
+ TSK_FREE(temp);
+ break;
+
+
+ } /* switch */
+ } /* for */
+
+ /* append the namespace */
+ if(_namespace) {
+ tsk_buffer_append(buffer, _namespace, (tsk_size_t)tsk_strlen(_namespace));
+ TSK_FREE(_namespace);
+ }
bail:
- if(TSK_BUFFER_DATA(buffer) && TSK_BUFFER_SIZE(buffer)){
- node = tsk_strndup((const char*)TSK_BUFFER_DATA(buffer), TSK_BUFFER_SIZE(buffer));
- }
- TSK_OBJECT_SAFE_FREE(buffer);
-
-
- /* Document */
- if(this->auid){
- char* document;
- if((document = txcap_selector_get_document(this->stack_handle, this->auid))){
- if(node){
- tsk_strcat_2(&document, "/~~/%s%s", this->auid, node);
- TSK_FREE(node);
- }
- return document;
- }
- }
-
- return node;
+ if(TSK_BUFFER_DATA(buffer) && TSK_BUFFER_SIZE(buffer)) {
+ node = tsk_strndup((const char*)TSK_BUFFER_DATA(buffer), TSK_BUFFER_SIZE(buffer));
+ }
+ TSK_OBJECT_SAFE_FREE(buffer);
+
+
+ /* Document */
+ if(this->auid) {
+ char* document;
+ if((document = txcap_selector_get_document(this->stack_handle, this->auid))) {
+ if(node) {
+ tsk_strcat_2(&document, "/~~/%s%s", this->auid, node);
+ TSK_FREE(node);
+ }
+ return document;
+ }
+ }
+
+ return node;
}
void XcapSelector::reset()
{
- TSK_FREE(this->auid);
- tsk_list_clear_items(this->steps);
+ TSK_FREE(this->auid);
+ tsk_list_clear_items(this->steps);
}
XcapSelector::~XcapSelector()
{
- this->reset();
- TSK_OBJECT_SAFE_FREE(this->steps);
-
- tsk_object_unref(this->stack_handle);
+ this->reset();
+ TSK_OBJECT_SAFE_FREE(this->steps);
+
+ tsk_object_unref(this->stack_handle);
}
/* =================================== XCAP Message ==================================== */
XcapMessage::XcapMessage() :
-httpmessage(tsk_null)
+ httpmessage(tsk_null)
{
}
XcapMessage::XcapMessage(const thttp_message_t *_httpmessage)
{
- this->httpmessage = _httpmessage;
+ this->httpmessage = _httpmessage;
}
XcapMessage::~XcapMessage()
@@ -272,87 +270,87 @@ XcapMessage::~XcapMessage()
short XcapMessage::getCode() const
{
- if(this->httpmessage){
- return this->httpmessage->line.response.status_code;
- }
- return 0;
+ if(this->httpmessage) {
+ return this->httpmessage->line.response.status_code;
+ }
+ return 0;
}
const char* XcapMessage::getPhrase() const
{
- if(this->httpmessage){
- return this->httpmessage->line.response.reason_phrase;
- }
- return tsk_null;
+ if(this->httpmessage) {
+ return this->httpmessage->line.response.reason_phrase;
+ }
+ return tsk_null;
}
char* XcapMessage::getXcapHeaderValue(const char* name, unsigned index /*= 0*/)
{
- const thttp_header_t* header;
- if((header = thttp_message_get_headerByName(this->httpmessage, name))){
- return thttp_header_value_tostring(header);
- }
- return tsk_null;
+ const thttp_header_t* header;
+ if((header = thttp_message_get_headerByName(this->httpmessage, name))) {
+ return thttp_header_value_tostring(header);
+ }
+ return tsk_null;
}
char* XcapMessage::getXcapHeaderParamValue(const char* name, const char* pname, unsigned index /*= 0*/)
{
- const thttp_header_t* header;
- if((header = thttp_message_get_headerByName(this->httpmessage, name))){
- const tsk_param_t* param;
- if((param = tsk_params_get_param_by_name(header->params, pname))){
- return tsk_strdup(param->value);
- }
- }
- return tsk_null;
+ const thttp_header_t* header;
+ if((header = thttp_message_get_headerByName(this->httpmessage, name))) {
+ const tsk_param_t* param;
+ if((param = tsk_params_get_param_by_name(header->params, pname))) {
+ return tsk_strdup(param->value);
+ }
+ }
+ return tsk_null;
}
unsigned XcapMessage::getXcapContentLength()
{
- if(this->httpmessage && this->httpmessage->Content){
- return this->httpmessage->Content->size;
- }
- return 0;
+ if(this->httpmessage && this->httpmessage->Content) {
+ return this->httpmessage->Content->size;
+ }
+ return 0;
}
unsigned XcapMessage::getXcapContent(void* output, unsigned maxsize)
{
- unsigned retsize = 0;
- if(output && maxsize && this->httpmessage->Content){
- retsize = (this->httpmessage->Content->size > maxsize) ? maxsize : this->httpmessage->Content->size;
- memcpy(output, this->httpmessage->Content->data, retsize);
- }
- return retsize;
+ unsigned retsize = 0;
+ if(output && maxsize && this->httpmessage->Content) {
+ retsize = (this->httpmessage->Content->size > maxsize) ? maxsize : this->httpmessage->Content->size;
+ memcpy(output, this->httpmessage->Content->data, retsize);
+ }
+ return retsize;
}
/* =================================== XCAP Event ==================================== */
XcapEvent::XcapEvent(const thttp_event_t *_httpevent)
{
- this->httpevent = _httpevent;
- if(_httpevent){
- this->httpmessage = new XcapMessage(_httpevent->message);
- }
- else{
- this->httpmessage = tsk_null;
- }
+ this->httpevent = _httpevent;
+ if(_httpevent) {
+ this->httpmessage = new XcapMessage(_httpevent->message);
+ }
+ else {
+ this->httpmessage = tsk_null;
+ }
}
XcapEvent::~XcapEvent()
{
- if(this->httpmessage){
- delete this->httpmessage;
- }
+ if(this->httpmessage) {
+ delete this->httpmessage;
+ }
}
thttp_event_type_t XcapEvent::getType()
{
- return this->httpevent->type;
+ return this->httpevent->type;
}
const XcapMessage* XcapEvent::getXcapMessage() const
{
- return this->httpmessage;
+ return this->httpmessage;
}
@@ -374,189 +372,189 @@ XcapCallback::~XcapCallback()
/* =================================== XCAP Stack ==================================== */
XcapStack::XcapStack(XcapCallback* _callback, const char* xui, const char* password, const char* xcap_root)
{
- /* Initialize network layer */
- if(XcapStack::count == 0){
- tnet_startup();
- }
+ /* Initialize network layer */
+ if(XcapStack::count == 0) {
+ tnet_startup();
+ }
- this->callback = _callback;
- this->handle = txcap_stack_create(stack_callback, xui, password, xcap_root,
- TXCAP_STACK_SET_USERDATA(this),
- TXCAP_STACK_SET_NULL());
+ this->callback = _callback;
+ this->handle = txcap_stack_create(stack_callback, xui, password, xcap_root,
+ TXCAP_STACK_SET_USERDATA(this),
+ TXCAP_STACK_SET_NULL());
}
XcapStack::~XcapStack()
{
- TSK_OBJECT_SAFE_FREE(this->handle);
+ TSK_OBJECT_SAFE_FREE(this->handle);
- /* DeInitialize the network layer (only if last stack) */
- if(--XcapStack::count == 0){
- tnet_cleanup();
- }
+ /* DeInitialize the network layer (only if last stack) */
+ if(--XcapStack::count == 0) {
+ tnet_cleanup();
+ }
}
bool XcapStack::registerAUID(const char* id, const char* mime_type, const char* ns, const char* document_name, bool is_global)
{
- txcap_stack_t* stack = (txcap_stack_t*)this->handle;
- if(stack){
- tsk_bool_t _global = is_global?tsk_true:tsk_false; // 32bit <-> 64bit workaround
- return (txcap_auid_register(stack->auids, id, mime_type, ns, document_name, _global) == 0);
- }
- return false;
+ txcap_stack_t* stack = (txcap_stack_t*)this->handle;
+ if(stack) {
+ tsk_bool_t _global = is_global?tsk_true:tsk_false; // 32bit <-> 64bit workaround
+ return (txcap_auid_register(stack->auids, id, mime_type, ns, document_name, _global) == 0);
+ }
+ return false;
}
bool XcapStack::start()
{
- return (txcap_stack_start(this->handle) == 0);
+ return (txcap_stack_start(this->handle) == 0);
}
bool XcapStack::setCredentials(const char* xui, const char* password)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_XUI(xui),
- TXCAP_STACK_SET_PASSWORD(password),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_XUI(xui),
+ TXCAP_STACK_SET_PASSWORD(password),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::setXcapRoot(const char* xcap_root)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_ROOT(xcap_root),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_ROOT(xcap_root),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::setLocalIP(const char* ip)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_LOCAL_IP(ip),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_LOCAL_IP(ip),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::setLocalPort(unsigned port)
{
- tsk_istr_t port_str;
- tsk_itoa(port, &port_str);
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_LOCAL_PORT(port_str),
- TXCAP_STACK_SET_NULL()) == 0;
+ tsk_istr_t port_str;
+ tsk_itoa(port, &port_str);
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_LOCAL_PORT(port_str),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::addHeader(const char* name, const char* value)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_HEADER(name, value),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_HEADER(name, value),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::removeHeader(const char* name)
{
- return txcap_stack_set(this->handle,
- TXCAP_STACK_UNSET_HEADER(name),
- TXCAP_STACK_SET_NULL()) == 0;
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_UNSET_HEADER(name),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::setTimeout(unsigned timeout)
{
- tsk_istr_t timeout_str;
- tsk_itoa(timeout, &timeout_str);
- return txcap_stack_set(this->handle,
- TXCAP_STACK_SET_TIMEOUT(timeout_str),
- TXCAP_STACK_SET_NULL()) == 0;
+ tsk_istr_t timeout_str;
+ tsk_itoa(timeout, &timeout_str);
+ return txcap_stack_set(this->handle,
+ TXCAP_STACK_SET_TIMEOUT(timeout_str),
+ TXCAP_STACK_SET_NULL()) == 0;
}
bool XcapStack::getDocument(const char* url)
{
- return txcap_action_fetch_document(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_fetch_document(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::getElement(const char* url)
{
- return txcap_action_fetch_element(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_fetch_element(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::getAttribute(const char* url)
{
- return txcap_action_fetch_attribute(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_fetch_attribute(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::deleteDocument(const char* url)
{
- return txcap_action_delete_document(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_delete_document(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::deleteElement(const char* url)
{
- return txcap_action_delete_element(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_delete_element(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::deleteAttribute(const char* url)
{
- return txcap_action_delete_attribute(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_delete_attribute(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::putDocument(const char* url, const void* payload, unsigned len, const char* contentType)
{
- return txcap_action_create_document(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_PAYLOAD(payload, len),
- TXCAP_ACTION_SET_HEADER("Content-Type", contentType),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_create_document(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_PAYLOAD(payload, len),
+ TXCAP_ACTION_SET_HEADER("Content-Type", contentType),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::putElement(const char* url, const void* payload, unsigned len)
{
- return txcap_action_create_element(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_PAYLOAD(payload, len),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_create_element(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_PAYLOAD(payload, len),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::putAttribute(const char* url, const void* payload, unsigned len)
{
- return txcap_action_create_attribute(this->handle,
- TXCAP_ACTION_SET_REQUEST_URI(url),
- TXCAP_ACTION_SET_PAYLOAD(payload, len),
- TXCAP_ACTION_SET_NULL()) == 0;
+ return txcap_action_create_attribute(this->handle,
+ TXCAP_ACTION_SET_REQUEST_URI(url),
+ TXCAP_ACTION_SET_PAYLOAD(payload, len),
+ TXCAP_ACTION_SET_NULL()) == 0;
}
bool XcapStack::stop()
{
- return (txcap_stack_stop(this->handle) == 0);
+ return (txcap_stack_stop(this->handle) == 0);
}
int stack_callback(const thttp_event_t *httpevent)
{
- const XcapStack* stack = tsk_null;
- XcapEvent* e = tsk_null;
-
- const txcap_stack_handle_t* stack_handle = thttp_session_get_userdata(httpevent->session);
- if(!stack_handle || !(stack = dyn_cast<const XcapStack*>((const XcapStack*)stack_handle))){
- TSK_DEBUG_ERROR("Invalid user data");
- return -1;
- }
-
- if(stack->getCallback()){
- if((e = new XcapEvent(httpevent))){
- stack->getCallback()->onEvent(e);
- delete e;
- }
- }
- return 0;
+ const XcapStack* stack = tsk_null;
+ XcapEvent* e = tsk_null;
+
+ const txcap_stack_handle_t* stack_handle = thttp_session_get_userdata(httpevent->session);
+ if(!stack_handle || !(stack = dyn_cast<const XcapStack*>((const XcapStack*)stack_handle))) {
+ TSK_DEBUG_ERROR("Invalid user data");
+ return -1;
+ }
+
+ if(stack->getCallback()) {
+ if((e = new XcapEvent(httpevent))) {
+ stack->getCallback()->onEvent(e);
+ delete e;
+ }
+ }
+ return 0;
}
diff --git a/bindings/_common/Xcap.h b/bindings/_common/Xcap.h
index 0d26f2c..59376d6 100755
--- a/bindings/_common/Xcap.h
+++ b/bindings/_common/Xcap.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -34,24 +34,24 @@ typedef tsk_list_t twrap_xcap_steps_L_t;
class XcapSelector
{
public:
- XcapSelector(XcapStack* stack);
- virtual ~XcapSelector();
+ XcapSelector(XcapStack* stack);
+ virtual ~XcapSelector();
public: /* API functions */
- XcapSelector* setAUID(const char* auid);
- XcapSelector* setName(const char* qname);
- XcapSelector* setAttribute(const char* qname, const char* att_qname, const char* att_value);
- XcapSelector* setPos(const char* qname, unsigned pos);
- XcapSelector* setPosAttribute(const char* qname, unsigned pos, const char* att_qname, const char* att_value);
- XcapSelector* setNamespace(const char* prefix, const char* value);
-
- char* getString();// %newobject
- void reset();
+ XcapSelector* setAUID(const char* auid);
+ XcapSelector* setName(const char* qname);
+ XcapSelector* setAttribute(const char* qname, const char* att_qname, const char* att_value);
+ XcapSelector* setPos(const char* qname, unsigned pos);
+ XcapSelector* setPosAttribute(const char* qname, unsigned pos, const char* att_qname, const char* att_value);
+ XcapSelector* setNamespace(const char* prefix, const char* value);
+
+ char* getString();// %newobject
+ void reset();
private:
- txcap_stack_handle_t* stack_handle;
- char* auid;
- twrap_xcap_steps_L_t* steps;
+ txcap_stack_handle_t* stack_handle;
+ char* auid;
+ twrap_xcap_steps_L_t* steps;
};
//
@@ -60,22 +60,22 @@ private:
class XcapMessage
{
public:
- XcapMessage();
+ XcapMessage();
#if !defined(SWIG)
- XcapMessage(const thttp_message_t *httpmessage);
+ XcapMessage(const thttp_message_t *httpmessage);
#endif
- virtual ~XcapMessage();
-
- short getCode() const;
- const char* getPhrase() const;
+ virtual ~XcapMessage();
+
+ short getCode() const;
+ const char* getPhrase() const;
- char* getXcapHeaderValue(const char* name, unsigned index = 0);
- char* getXcapHeaderParamValue(const char* name, const char* param, unsigned index = 0);
- unsigned getXcapContentLength();
- unsigned getXcapContent(void* output, unsigned maxsize);
+ char* getXcapHeaderValue(const char* name, unsigned index = 0);
+ char* getXcapHeaderParamValue(const char* name, const char* param, unsigned index = 0);
+ unsigned getXcapContentLength();
+ unsigned getXcapContent(void* output, unsigned maxsize);
private:
- const thttp_message_t *httpmessage;
+ const thttp_message_t *httpmessage;
};
//
@@ -85,15 +85,15 @@ class XcapEvent
{
public:
#if !defined(SWIG)
- XcapEvent(const thttp_event_t *httpevent);
+ XcapEvent(const thttp_event_t *httpevent);
#endif
- virtual ~XcapEvent();
- thttp_event_type_t getType();
- const XcapMessage* getXcapMessage() const;
+ virtual ~XcapEvent();
+ thttp_event_type_t getType();
+ const XcapMessage* getXcapMessage() const;
private:
- const thttp_event_t *httpevent;
- const XcapMessage* httpmessage;
+ const thttp_event_t *httpevent;
+ const XcapMessage* httpmessage;
};
@@ -103,10 +103,12 @@ private:
class XcapCallback
{
public:
- XcapCallback();
- virtual ~XcapCallback();
+ XcapCallback();
+ virtual ~XcapCallback();
- virtual int onEvent(const XcapEvent* e)const { return -1; }
+ virtual int onEvent(const XcapEvent* e)const {
+ return -1;
+ }
};
@@ -116,49 +118,49 @@ public:
class XcapStack
{
public:
- XcapStack(XcapCallback* callback, const char* xui, const char* password, const char* xcap_root);
- virtual ~XcapStack();
+ XcapStack(XcapCallback* callback, const char* xui, const char* password, const char* xcap_root);
+ virtual ~XcapStack();
public: /* API functions */
- bool registerAUID(const char* id, const char* mime_type, const char* ns, const char* document_name, bool is_global);
- bool start();
- bool setCredentials(const char* xui, const char* password);
- bool setXcapRoot(const char* xcap_root);
- bool setLocalIP(const char* ip);
- bool setLocalPort(unsigned port);
- bool addHeader(const char* name, const char* value);
- bool removeHeader(const char* name);
- bool setTimeout(unsigned timeout);
-
- bool getDocument(const char* url);
- bool getElement(const char* url);
- bool getAttribute(const char* url);
-
- bool deleteDocument(const char* url);
- bool deleteElement(const char* url);
- bool deleteAttribute(const char* url);
-
- bool putDocument(const char* url, const void* payload, unsigned len, const char* contentType);
- bool putElement(const char* url, const void* payload, unsigned len);
- bool putAttribute(const char* url, const void* payload, unsigned len);
-
- bool stop();
+ bool registerAUID(const char* id, const char* mime_type, const char* ns, const char* document_name, bool is_global);
+ bool start();
+ bool setCredentials(const char* xui, const char* password);
+ bool setXcapRoot(const char* xcap_root);
+ bool setLocalIP(const char* ip);
+ bool setLocalPort(unsigned port);
+ bool addHeader(const char* name, const char* value);
+ bool removeHeader(const char* name);
+ bool setTimeout(unsigned timeout);
+
+ bool getDocument(const char* url);
+ bool getElement(const char* url);
+ bool getAttribute(const char* url);
+
+ bool deleteDocument(const char* url);
+ bool deleteElement(const char* url);
+ bool deleteAttribute(const char* url);
+
+ bool putDocument(const char* url, const void* payload, unsigned len, const char* contentType);
+ bool putElement(const char* url, const void* payload, unsigned len);
+ bool putAttribute(const char* url, const void* payload, unsigned len);
+
+ bool stop();
public: /* Public helper function */
#if !defined(SWIG)
- txcap_stack_handle_t* getHandle(){
- return this->handle;
- }
- XcapCallback* getCallback()const{
- return this->callback;
- }
+ txcap_stack_handle_t* getHandle() {
+ return this->handle;
+ }
+ XcapCallback* getCallback()const {
+ return this->callback;
+ }
#endif
private:
- txcap_stack_handle_t* handle;
- XcapCallback* callback;
+ txcap_stack_handle_t* handle;
+ XcapCallback* callback;
- static unsigned count;
+ static unsigned count;
};
diff --git a/bindings/_common/tinyWRAP.i b/bindings/_common/tinyWRAP.i
index 69bdb38..25df7aa 100755
--- a/bindings/_common/tinyWRAP.i
+++ b/bindings/_common/tinyWRAP.i
@@ -33,6 +33,7 @@
%newobject SipStack::getPreferredIdentity;
%newobject SipStack::getLocalIPnPort;
%newobject MediaSessionMgr::producerGetCodec;
+%newobject MediaSessionMgr::sessionGetQoS;
%newobject MessagingEvent::takeSessionOwnership;
%newobject InviteEvent::takeCallSessionOwnership;
diff --git a/bindings/_common/tinyWRAP_config.h b/bindings/_common/tinyWRAP_config.h
index f2531df..16fb4fd 100755
--- a/bindings/_common/tinyWRAP_config.h
+++ b/bindings/_common/tinyWRAP_config.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)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.
*
@@ -46,13 +46,13 @@
# define TINYWRAP_GEXTERN extern
#endif
-/* Guards against C++ name mangling
+/* Guards against C++ name mangling
*/
#ifdef __cplusplus
# define TWRAP_BEGIN_DECLS extern "C" {
# define TWRAP_END_DECLS }
#else
-# define TWRAP_BEGIN_DECLS
+# define TWRAP_BEGIN_DECLS
# define TWRAP_END_DECLS
#endif
@@ -66,7 +66,7 @@
#if HAVE_CONFIG_H
- #include "../config.h"
+#include "../config.h"
#endif
#endif // TINYWRAP_CONFIG_H
diff --git a/bindings/csharp/MediaSessionMgr.cs b/bindings/csharp/MediaSessionMgr.cs
index 8ee9d86..50d95a6 100755
--- a/bindings/csharp/MediaSessionMgr.cs
+++ b/bindings/csharp/MediaSessionMgr.cs
@@ -51,6 +51,12 @@ public class MediaSessionMgr : IDisposable {
return ret;
}
+ public QoS sessionGetQoS(twrap_media_type_t media) {
+ IntPtr cPtr = tinyWRAPPINVOKE.MediaSessionMgr_sessionGetQoS(swigCPtr, (int)media);
+ QoS ret = (cPtr == IntPtr.Zero) ? null : new QoS(cPtr, true);
+ return ret;
+ }
+
public bool consumerSetInt32(twrap_media_type_t media, string key, int value) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_consumerSetInt32(swigCPtr, (int)media, key, value);
return ret;
@@ -149,6 +155,16 @@ public class MediaSessionMgr : IDisposable {
return ret;
}
+ public static bool defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
+ bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange((int)min, (int)max);
+ return ret;
+ }
+
+ public static bool defaultsSetAdaptativeVideoSizeOutEnabled(bool enabled) {
+ bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
+ return ret;
+ }
+
public static bool defaultsSetJbMargin(uint jb_margin_ms) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
return ret;
diff --git a/bindings/csharp/QoS.cs b/bindings/csharp/QoS.cs
new file mode 100644
index 0000000..87aa892
--- /dev/null
+++ b/bindings/csharp/QoS.cs
@@ -0,0 +1,121 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.9
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace org.doubango.tinyWRAP {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class QoS : IDisposable {
+ private HandleRef swigCPtr;
+ protected bool swigCMemOwn;
+
+ internal QoS(IntPtr cPtr, bool cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new HandleRef(this, cPtr);
+ }
+
+ internal static HandleRef getCPtr(QoS obj) {
+ return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ ~QoS() {
+ Dispose();
+ }
+
+ public virtual void Dispose() {
+ lock(this) {
+ if (swigCPtr.Handle != IntPtr.Zero) {
+ if (swigCMemOwn) {
+ swigCMemOwn = false;
+ tinyWRAPPINVOKE.delete_QoS(swigCPtr);
+ }
+ swigCPtr = new HandleRef(null, IntPtr.Zero);
+ }
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ public float getQavg() {
+ float ret = tinyWRAPPINVOKE.QoS_getQavg(swigCPtr);
+ return ret;
+ }
+
+ public float getQ1() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ1(swigCPtr);
+ return ret;
+ }
+
+ public float getQ2() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ2(swigCPtr);
+ return ret;
+ }
+
+ public float getQ3() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ3(swigCPtr);
+ return ret;
+ }
+
+ public float getQ4() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ4(swigCPtr);
+ return ret;
+ }
+
+ public float getQ5() {
+ float ret = tinyWRAPPINVOKE.QoS_getQ5(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoInWidth() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoInWidth(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoOutWidth() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoOutWidth(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoInHeight() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoInHeight(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoOutHeight() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoOutHeight(swigCPtr);
+ return ret;
+ }
+
+ public uint getBandwidthDownKbps() {
+ uint ret = tinyWRAPPINVOKE.QoS_getBandwidthDownKbps(swigCPtr);
+ return ret;
+ }
+
+ public uint getBandwidthUpKbps() {
+ uint ret = tinyWRAPPINVOKE.QoS_getBandwidthUpKbps(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoInAvgFps() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoInAvgFps(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoDecAvgTime() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoDecAvgTime(swigCPtr);
+ return ret;
+ }
+
+ public uint getVideoEncAvgTime() {
+ uint ret = tinyWRAPPINVOKE.QoS_getVideoEncAvgTime(swigCPtr);
+ return ret;
+ }
+
+}
+
+}
diff --git a/bindings/csharp/tinyWRAPPINVOKE.cs b/bindings/csharp/tinyWRAPPINVOKE.cs
index 84f9165..e76ff31 100755
--- a/bindings/csharp/tinyWRAPPINVOKE.cs
+++ b/bindings/csharp/tinyWRAPPINVOKE.cs
@@ -264,6 +264,54 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_ActionConfig_setMediaInt")]
public static extern IntPtr ActionConfig_setMediaInt(HandleRef jarg1, int jarg2, string jarg3, int jarg4);
+ [DllImport("tinyWRAP", EntryPoint="CSharp_delete_QoS")]
+ public static extern void delete_QoS(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQavg")]
+ public static extern float QoS_getQavg(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ1")]
+ public static extern float QoS_getQ1(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ2")]
+ public static extern float QoS_getQ2(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ3")]
+ public static extern float QoS_getQ3(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ4")]
+ public static extern float QoS_getQ4(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getQ5")]
+ public static extern float QoS_getQ5(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInWidth")]
+ public static extern uint QoS_getVideoInWidth(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoOutWidth")]
+ public static extern uint QoS_getVideoOutWidth(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInHeight")]
+ public static extern uint QoS_getVideoInHeight(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoOutHeight")]
+ public static extern uint QoS_getVideoOutHeight(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getBandwidthDownKbps")]
+ public static extern uint QoS_getBandwidthDownKbps(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getBandwidthUpKbps")]
+ public static extern uint QoS_getBandwidthUpKbps(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoInAvgFps")]
+ public static extern uint QoS_getVideoInAvgFps(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoDecAvgTime")]
+ public static extern uint QoS_getVideoDecAvgTime(HandleRef jarg1);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_QoS_getVideoEncAvgTime")]
+ public static extern uint QoS_getVideoEncAvgTime(HandleRef jarg1);
+
[DllImport("tinyWRAP", EntryPoint="CSharp_delete_Codec")]
public static extern void delete_Codec(HandleRef jarg1);
@@ -297,6 +345,9 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_sessionGetInt32")]
public static extern int MediaSessionMgr_sessionGetInt32(HandleRef jarg1, int jarg2, string jarg3);
+ [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_sessionGetQoS")]
+ public static extern IntPtr MediaSessionMgr_sessionGetQoS(HandleRef jarg1, int jarg2);
+
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_consumerSetInt32")]
public static extern bool MediaSessionMgr_consumerSetInt32(HandleRef jarg1, int jarg2, string jarg3, int jarg4);
@@ -354,6 +405,12 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetPrefVideoSize")]
public static extern bool MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
+ [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange")]
+ public static extern bool MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
+
+ [DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled")]
+ public static extern bool MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(bool jarg1);
+
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetJbMargin")]
public static extern bool MediaSessionMgr_defaultsSetJbMargin(uint jarg1);
diff --git a/bindings/csharp/tinyWRAP_wrap.cxx b/bindings/csharp/tinyWRAP_wrap.cxx
index d2c8e32..5b7d245 100755
--- a/bindings/csharp/tinyWRAP_wrap.cxx
+++ b/bindings/csharp/tinyWRAP_wrap.cxx
@@ -1488,6 +1488,194 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ActionConfig_setMediaInt(void * jarg1, int
}
+SWIGEXPORT void SWIGSTDCALL CSharp_delete_QoS(void * jarg1) {
+ QoS *arg1 = (QoS *) 0 ;
+
+ arg1 = (QoS *)jarg1;
+ delete arg1;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQavg(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQavg();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ1(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ1();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ2(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ2();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ3(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ3();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ4(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ4();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT float SWIGSTDCALL CSharp_QoS_getQ5(void * jarg1) {
+ float jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ arg1 = (QoS *)jarg1;
+ result = (float)(arg1)->getQ5();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInWidth(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoOutWidth(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInHeight(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoOutHeight(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getBandwidthDownKbps(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getBandwidthUpKbps(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoInAvgFps(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoDecAvgTime(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_QoS_getVideoEncAvgTime(void * jarg1) {
+ unsigned int jresult ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ arg1 = (QoS *)jarg1;
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT void SWIGSTDCALL CSharp_delete_Codec(void * jarg1) {
Codec *arg1 = (Codec *) 0 ;
@@ -1622,6 +1810,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MediaSessionMgr_sessionGetInt32(void * jarg1,
}
+SWIGEXPORT void * SWIGSTDCALL CSharp_MediaSessionMgr_sessionGetQoS(void * jarg1, int jarg2) {
+ void * jresult ;
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ QoS *result = 0 ;
+
+ arg1 = (MediaSessionMgr *)jarg1;
+ arg2 = (twrap_media_type_t)jarg2;
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_consumerSetInt32(void * jarg1, int jarg2, char * jarg3, int jarg4) {
unsigned int jresult ;
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -1878,6 +2080,32 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetPrefVideoS
}
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2) {
+ unsigned int jresult ;
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ bool result;
+
+ arg1 = (tmedia_pref_video_size_t)jarg1;
+ arg2 = (tmedia_pref_video_size_t)jarg2;
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(unsigned int jarg1) {
+ unsigned int jresult ;
+ bool arg1 ;
+ bool result;
+
+ arg1 = jarg1 ? true : false;
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetJbMargin(unsigned int jarg1) {
unsigned int jresult ;
uint32_t arg1 ;
diff --git a/bindings/java/MediaSessionMgr.java b/bindings/java/MediaSessionMgr.java
index f5d0177..8a6b5cf 100755
--- a/bindings/java/MediaSessionMgr.java
+++ b/bindings/java/MediaSessionMgr.java
@@ -43,6 +43,11 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_sessionGetInt32(swigCPtr, this, media.swigValue(), key);
}
+ public QoS sessionGetQoS(twrap_media_type_t media) {
+ long cPtr = tinyWRAPJNI.MediaSessionMgr_sessionGetQoS(swigCPtr, this, media.swigValue());
+ return (cPtr == 0) ? null : new QoS(cPtr, true);
+ }
+
public boolean consumerSetInt32(twrap_media_type_t media, String key, int value) {
return tinyWRAPJNI.MediaSessionMgr_consumerSetInt32(swigCPtr, this, media.swigValue(), key, value);
}
@@ -122,6 +127,14 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSize(pref_video_size.swigValue());
}
+ public static boolean defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
+ return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min.swigValue(), max.swigValue());
+ }
+
+ public static boolean defaultsSetAdaptativeVideoSizeOutEnabled(boolean enabled) {
+ return tinyWRAPJNI.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
+ }
+
public static boolean defaultsSetJbMargin(long jb_margin_ms) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
}
diff --git a/bindings/java/QoS.java b/bindings/java/QoS.java
new file mode 100644
index 0000000..e216f8d
--- /dev/null
+++ b/bindings/java/QoS.java
@@ -0,0 +1,98 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.9
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.doubango.tinyWRAP;
+
+public class QoS {
+ private long swigCPtr;
+ protected boolean swigCMemOwn;
+
+ protected QoS(long cPtr, boolean cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = cPtr;
+ }
+
+ protected static long getCPtr(QoS obj) {
+ return (obj == null) ? 0 : obj.swigCPtr;
+ }
+
+ protected void finalize() {
+ delete();
+ }
+
+ public synchronized void delete() {
+ if (swigCPtr != 0) {
+ if (swigCMemOwn) {
+ swigCMemOwn = false;
+ tinyWRAPJNI.delete_QoS(swigCPtr);
+ }
+ swigCPtr = 0;
+ }
+ }
+
+ public float getQavg() {
+ return tinyWRAPJNI.QoS_getQavg(swigCPtr, this);
+ }
+
+ public float getQ1() {
+ return tinyWRAPJNI.QoS_getQ1(swigCPtr, this);
+ }
+
+ public float getQ2() {
+ return tinyWRAPJNI.QoS_getQ2(swigCPtr, this);
+ }
+
+ public float getQ3() {
+ return tinyWRAPJNI.QoS_getQ3(swigCPtr, this);
+ }
+
+ public float getQ4() {
+ return tinyWRAPJNI.QoS_getQ4(swigCPtr, this);
+ }
+
+ public float getQ5() {
+ return tinyWRAPJNI.QoS_getQ5(swigCPtr, this);
+ }
+
+ public long getVideoInWidth() {
+ return tinyWRAPJNI.QoS_getVideoInWidth(swigCPtr, this);
+ }
+
+ public long getVideoOutWidth() {
+ return tinyWRAPJNI.QoS_getVideoOutWidth(swigCPtr, this);
+ }
+
+ public long getVideoInHeight() {
+ return tinyWRAPJNI.QoS_getVideoInHeight(swigCPtr, this);
+ }
+
+ public long getVideoOutHeight() {
+ return tinyWRAPJNI.QoS_getVideoOutHeight(swigCPtr, this);
+ }
+
+ public long getBandwidthDownKbps() {
+ return tinyWRAPJNI.QoS_getBandwidthDownKbps(swigCPtr, this);
+ }
+
+ public long getBandwidthUpKbps() {
+ return tinyWRAPJNI.QoS_getBandwidthUpKbps(swigCPtr, this);
+ }
+
+ public long getVideoInAvgFps() {
+ return tinyWRAPJNI.QoS_getVideoInAvgFps(swigCPtr, this);
+ }
+
+ public long getVideoDecAvgTime() {
+ return tinyWRAPJNI.QoS_getVideoDecAvgTime(swigCPtr, this);
+ }
+
+ public long getVideoEncAvgTime() {
+ return tinyWRAPJNI.QoS_getVideoEncAvgTime(swigCPtr, this);
+ }
+
+}
diff --git a/bindings/java/android/MediaSessionMgr.java b/bindings/java/android/MediaSessionMgr.java
index f5d0177..8a6b5cf 100755
--- a/bindings/java/android/MediaSessionMgr.java
+++ b/bindings/java/android/MediaSessionMgr.java
@@ -43,6 +43,11 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_sessionGetInt32(swigCPtr, this, media.swigValue(), key);
}
+ public QoS sessionGetQoS(twrap_media_type_t media) {
+ long cPtr = tinyWRAPJNI.MediaSessionMgr_sessionGetQoS(swigCPtr, this, media.swigValue());
+ return (cPtr == 0) ? null : new QoS(cPtr, true);
+ }
+
public boolean consumerSetInt32(twrap_media_type_t media, String key, int value) {
return tinyWRAPJNI.MediaSessionMgr_consumerSetInt32(swigCPtr, this, media.swigValue(), key, value);
}
@@ -122,6 +127,14 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSize(pref_video_size.swigValue());
}
+ public static boolean defaultsSetPrefVideoSizeOutRange(tmedia_pref_video_size_t min, tmedia_pref_video_size_t max) {
+ return tinyWRAPJNI.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min.swigValue(), max.swigValue());
+ }
+
+ public static boolean defaultsSetAdaptativeVideoSizeOutEnabled(boolean enabled) {
+ return tinyWRAPJNI.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);
+ }
+
public static boolean defaultsSetJbMargin(long jb_margin_ms) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetJbMargin(jb_margin_ms);
}
diff --git a/bindings/java/android/QoS.java b/bindings/java/android/QoS.java
new file mode 100644
index 0000000..e216f8d
--- /dev/null
+++ b/bindings/java/android/QoS.java
@@ -0,0 +1,98 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.9
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.doubango.tinyWRAP;
+
+public class QoS {
+ private long swigCPtr;
+ protected boolean swigCMemOwn;
+
+ protected QoS(long cPtr, boolean cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = cPtr;
+ }
+
+ protected static long getCPtr(QoS obj) {
+ return (obj == null) ? 0 : obj.swigCPtr;
+ }
+
+ protected void finalize() {
+ delete();
+ }
+
+ public synchronized void delete() {
+ if (swigCPtr != 0) {
+ if (swigCMemOwn) {
+ swigCMemOwn = false;
+ tinyWRAPJNI.delete_QoS(swigCPtr);
+ }
+ swigCPtr = 0;
+ }
+ }
+
+ public float getQavg() {
+ return tinyWRAPJNI.QoS_getQavg(swigCPtr, this);
+ }
+
+ public float getQ1() {
+ return tinyWRAPJNI.QoS_getQ1(swigCPtr, this);
+ }
+
+ public float getQ2() {
+ return tinyWRAPJNI.QoS_getQ2(swigCPtr, this);
+ }
+
+ public float getQ3() {
+ return tinyWRAPJNI.QoS_getQ3(swigCPtr, this);
+ }
+
+ public float getQ4() {
+ return tinyWRAPJNI.QoS_getQ4(swigCPtr, this);
+ }
+
+ public float getQ5() {
+ return tinyWRAPJNI.QoS_getQ5(swigCPtr, this);
+ }
+
+ public long getVideoInWidth() {
+ return tinyWRAPJNI.QoS_getVideoInWidth(swigCPtr, this);
+ }
+
+ public long getVideoOutWidth() {
+ return tinyWRAPJNI.QoS_getVideoOutWidth(swigCPtr, this);
+ }
+
+ public long getVideoInHeight() {
+ return tinyWRAPJNI.QoS_getVideoInHeight(swigCPtr, this);
+ }
+
+ public long getVideoOutHeight() {
+ return tinyWRAPJNI.QoS_getVideoOutHeight(swigCPtr, this);
+ }
+
+ public long getBandwidthDownKbps() {
+ return tinyWRAPJNI.QoS_getBandwidthDownKbps(swigCPtr, this);
+ }
+
+ public long getBandwidthUpKbps() {
+ return tinyWRAPJNI.QoS_getBandwidthUpKbps(swigCPtr, this);
+ }
+
+ public long getVideoInAvgFps() {
+ return tinyWRAPJNI.QoS_getVideoInAvgFps(swigCPtr, this);
+ }
+
+ public long getVideoDecAvgTime() {
+ return tinyWRAPJNI.QoS_getVideoDecAvgTime(swigCPtr, this);
+ }
+
+ public long getVideoEncAvgTime() {
+ return tinyWRAPJNI.QoS_getVideoEncAvgTime(swigCPtr, this);
+ }
+
+}
diff --git a/bindings/java/android/tinyWRAPJNI.java b/bindings/java/android/tinyWRAPJNI.java
index e7e86fc..4e02d2b 100755
--- a/bindings/java/android/tinyWRAPJNI.java
+++ b/bindings/java/android/tinyWRAPJNI.java
@@ -35,6 +35,22 @@ public class tinyWRAPJNI {
public final static native long ActionConfig_setResponseLine(long jarg1, ActionConfig jarg1_, short jarg2, String jarg3);
public final static native long ActionConfig_setMediaString(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, String jarg4);
public final static native long ActionConfig_setMediaInt(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, int jarg4);
+ public final static native void delete_QoS(long jarg1);
+ public final static native float QoS_getQavg(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ1(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ2(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ3(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ4(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ5(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInWidth(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoOutWidth(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInHeight(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoOutHeight(long jarg1, QoS jarg1_);
+ public final static native long QoS_getBandwidthDownKbps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getBandwidthUpKbps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInAvgFps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoDecAvgTime(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoEncAvgTime(long jarg1, QoS jarg1_);
public final static native void delete_Codec(long jarg1);
public final static native int Codec_getMediaType(long jarg1, Codec jarg1_);
public final static native String Codec_getName(long jarg1, Codec jarg1_);
@@ -46,6 +62,7 @@ public class tinyWRAPJNI {
public final static native void delete_MediaSessionMgr(long jarg1);
public final static native boolean MediaSessionMgr_sessionSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
public final static native int MediaSessionMgr_sessionGetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3);
+ public final static native long MediaSessionMgr_sessionGetQoS(long jarg1, MediaSessionMgr jarg1_, int jarg2);
public final static native boolean MediaSessionMgr_consumerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
public final static native boolean MediaSessionMgr_consumerSetInt64(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, long jarg4);
public final static native boolean MediaSessionMgr_producerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
@@ -65,6 +82,8 @@ public class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoUploadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
+ public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
+ public final static native boolean MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsSetJbMargin(long jarg1);
public final static native boolean MediaSessionMgr_defaultsSetJbMaxLateRate(long jarg1);
public final static native boolean MediaSessionMgr_defaultsSetEchoTail(long jarg1);
diff --git a/bindings/java/android/tinyWRAP_wrap.cxx b/bindings/java/android/tinyWRAP_wrap.cxx
index e68ff27..4ea8812 100755
--- a/bindings/java/android/tinyWRAP_wrap.cxx
+++ b/bindings/java/android/tinyWRAP_wrap.cxx
@@ -2407,6 +2407,241 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ActionConfig_1se
}
+SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1QoS(JNIEnv *jenv, jclass jcls, jlong jarg1) {
+ QoS *arg1 = (QoS *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = *(QoS **)&jarg1;
+ delete arg1;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQavg(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQavg();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ1();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ2(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ2();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ3(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ3();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ4(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ4();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ5(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ5();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthDownKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthUpKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInAvgFps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoDecAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoEncAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1Codec(JNIEnv *jenv, jclass jcls, jlong jarg1) {
Codec *arg1 = (Codec *) 0 ;
@@ -2582,6 +2817,23 @@ SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1
}
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1sessionGetQoS(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
+ jlong jresult = 0 ;
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ QoS *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(MediaSessionMgr **)&jarg1;
+ arg2 = (twrap_media_type_t)jarg2;
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ *(QoS **)&jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1consumerSetInt32(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jint jarg4) {
jboolean jresult = 0 ;
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -2925,6 +3177,36 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
}
+SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetPrefVideoSizeOutRange(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
+ jboolean jresult = 0 ;
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ bool result;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = (tmedia_pref_video_size_t)jarg1;
+ arg2 = (tmedia_pref_video_size_t)jarg2;
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ jresult = (jboolean)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAdaptativeVideoSizeOutEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
+ jboolean jresult = 0 ;
+ bool arg1 ;
+ bool result;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = jarg1 ? true : false;
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ jresult = (jboolean)result;
+ return jresult;
+}
+
+
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetJbMargin(JNIEnv *jenv, jclass jcls, jlong jarg1) {
jboolean jresult = 0 ;
uint32_t arg1 ;
diff --git a/bindings/java/tinyWRAPJNI.java b/bindings/java/tinyWRAPJNI.java
index e7e86fc..4e02d2b 100755
--- a/bindings/java/tinyWRAPJNI.java
+++ b/bindings/java/tinyWRAPJNI.java
@@ -35,6 +35,22 @@ public class tinyWRAPJNI {
public final static native long ActionConfig_setResponseLine(long jarg1, ActionConfig jarg1_, short jarg2, String jarg3);
public final static native long ActionConfig_setMediaString(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, String jarg4);
public final static native long ActionConfig_setMediaInt(long jarg1, ActionConfig jarg1_, int jarg2, String jarg3, int jarg4);
+ public final static native void delete_QoS(long jarg1);
+ public final static native float QoS_getQavg(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ1(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ2(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ3(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ4(long jarg1, QoS jarg1_);
+ public final static native float QoS_getQ5(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInWidth(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoOutWidth(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInHeight(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoOutHeight(long jarg1, QoS jarg1_);
+ public final static native long QoS_getBandwidthDownKbps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getBandwidthUpKbps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoInAvgFps(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoDecAvgTime(long jarg1, QoS jarg1_);
+ public final static native long QoS_getVideoEncAvgTime(long jarg1, QoS jarg1_);
public final static native void delete_Codec(long jarg1);
public final static native int Codec_getMediaType(long jarg1, Codec jarg1_);
public final static native String Codec_getName(long jarg1, Codec jarg1_);
@@ -46,6 +62,7 @@ public class tinyWRAPJNI {
public final static native void delete_MediaSessionMgr(long jarg1);
public final static native boolean MediaSessionMgr_sessionSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
public final static native int MediaSessionMgr_sessionGetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3);
+ public final static native long MediaSessionMgr_sessionGetQoS(long jarg1, MediaSessionMgr jarg1_, int jarg2);
public final static native boolean MediaSessionMgr_consumerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
public final static native boolean MediaSessionMgr_consumerSetInt64(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, long jarg4);
public final static native boolean MediaSessionMgr_producerSetInt32(long jarg1, MediaSessionMgr jarg1_, int jarg2, String jarg3, int jarg4);
@@ -65,6 +82,8 @@ public class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoUploadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSize(int jarg1);
+ public final static native boolean MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(int jarg1, int jarg2);
+ public final static native boolean MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsSetJbMargin(long jarg1);
public final static native boolean MediaSessionMgr_defaultsSetJbMaxLateRate(long jarg1);
public final static native boolean MediaSessionMgr_defaultsSetEchoTail(long jarg1);
diff --git a/bindings/java/tinyWRAP_wrap.cxx b/bindings/java/tinyWRAP_wrap.cxx
index 4845801..1ee74bf 100755
--- a/bindings/java/tinyWRAP_wrap.cxx
+++ b/bindings/java/tinyWRAP_wrap.cxx
@@ -2407,6 +2407,241 @@ SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ActionConfig_1se
}
+SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1QoS(JNIEnv *jenv, jclass jcls, jlong jarg1) {
+ QoS *arg1 = (QoS *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = *(QoS **)&jarg1;
+ delete arg1;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQavg(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQavg();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ1();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ2(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ2();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ3(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ3();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ4(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ4();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jfloat JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getQ5(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jfloat jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ float result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (float)(arg1)->getQ5();
+ jresult = (jfloat)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoOutHeight(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthDownKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getBandwidthUpKbps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoInAvgFps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoDecAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_QoS_1getVideoEncAvgTime(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+ jlong jresult = 0 ;
+ QoS *arg1 = (QoS *) 0 ;
+ unsigned int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(QoS **)&jarg1;
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ jresult = (jlong)result;
+ return jresult;
+}
+
+
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1Codec(JNIEnv *jenv, jclass jcls, jlong jarg1) {
Codec *arg1 = (Codec *) 0 ;
@@ -2582,6 +2817,23 @@ SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1
}
+SWIGEXPORT jlong JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1sessionGetQoS(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
+ jlong jresult = 0 ;
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ QoS *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(MediaSessionMgr **)&jarg1;
+ arg2 = (twrap_media_type_t)jarg2;
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ *(QoS **)&jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1consumerSetInt32(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jint jarg4) {
jboolean jresult = 0 ;
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -2925,6 +3177,36 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
}
+SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetPrefVideoSizeOutRange(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
+ jboolean jresult = 0 ;
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ bool result;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = (tmedia_pref_video_size_t)jarg1;
+ arg2 = (tmedia_pref_video_size_t)jarg2;
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ jresult = (jboolean)result;
+ return jresult;
+}
+
+
+SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAdaptativeVideoSizeOutEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
+ jboolean jresult = 0 ;
+ bool arg1 ;
+ bool result;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = jarg1 ? true : false;
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ jresult = (jboolean)result;
+ return jresult;
+}
+
+
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetJbMargin(JNIEnv *jenv, jclass jcls, jlong jarg1) {
jboolean jresult = 0 ;
uint32_t arg1 ;
diff --git a/bindings/perl/tinyWRAP.pm b/bindings/perl/tinyWRAP.pm
index a41bdee..3437a02 100755
--- a/bindings/perl/tinyWRAP.pm
+++ b/bindings/perl/tinyWRAP.pm
@@ -175,6 +175,52 @@ sub ACQUIRE {
}
+############# Class : tinyWRAP::QoS ##############
+
+package tinyWRAP::QoS;
+use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
+@ISA = qw( tinyWRAP );
+%OWNER = ();
+%ITERATORS = ();
+sub DESTROY {
+ return unless $_[0]->isa('HASH');
+ my $self = tied(%{$_[0]});
+ return unless defined $self;
+ delete $ITERATORS{$self};
+ if (exists $OWNER{$self}) {
+ tinyWRAPc::delete_QoS($self);
+ delete $OWNER{$self};
+ }
+}
+
+*getQavg = *tinyWRAPc::QoS_getQavg;
+*getQ1 = *tinyWRAPc::QoS_getQ1;
+*getQ2 = *tinyWRAPc::QoS_getQ2;
+*getQ3 = *tinyWRAPc::QoS_getQ3;
+*getQ4 = *tinyWRAPc::QoS_getQ4;
+*getQ5 = *tinyWRAPc::QoS_getQ5;
+*getVideoInWidth = *tinyWRAPc::QoS_getVideoInWidth;
+*getVideoOutWidth = *tinyWRAPc::QoS_getVideoOutWidth;
+*getVideoInHeight = *tinyWRAPc::QoS_getVideoInHeight;
+*getVideoOutHeight = *tinyWRAPc::QoS_getVideoOutHeight;
+*getBandwidthDownKbps = *tinyWRAPc::QoS_getBandwidthDownKbps;
+*getBandwidthUpKbps = *tinyWRAPc::QoS_getBandwidthUpKbps;
+*getVideoInAvgFps = *tinyWRAPc::QoS_getVideoInAvgFps;
+*getVideoDecAvgTime = *tinyWRAPc::QoS_getVideoDecAvgTime;
+*getVideoEncAvgTime = *tinyWRAPc::QoS_getVideoEncAvgTime;
+sub DISOWN {
+ my $self = shift;
+ my $ptr = tied(%$self);
+ delete $OWNER{$ptr};
+}
+
+sub ACQUIRE {
+ my $self = shift;
+ my $ptr = tied(%$self);
+ $OWNER{$ptr} = 1;
+}
+
+
############# Class : tinyWRAP::Codec ##############
package tinyWRAP::Codec;
@@ -233,6 +279,7 @@ sub DESTROY {
*sessionSetInt32 = *tinyWRAPc::MediaSessionMgr_sessionSetInt32;
*sessionGetInt32 = *tinyWRAPc::MediaSessionMgr_sessionGetInt32;
+*sessionGetQoS = *tinyWRAPc::MediaSessionMgr_sessionGetQoS;
*consumerSetInt32 = *tinyWRAPc::MediaSessionMgr_consumerSetInt32;
*consumerSetInt64 = *tinyWRAPc::MediaSessionMgr_consumerSetInt64;
*producerSetInt32 = *tinyWRAPc::MediaSessionMgr_producerSetInt32;
@@ -252,6 +299,8 @@ sub DESTROY {
*defaultsSetBandwidthVideoUploadMax = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoUploadMax;
*defaultsSetBandwidthVideoDownloadMax = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax;
*defaultsSetPrefVideoSize = *tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSize;
+*defaultsSetPrefVideoSizeOutRange = *tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSizeOutRange;
+*defaultsSetAdaptativeVideoSizeOutEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled;
*defaultsSetJbMargin = *tinyWRAPc::MediaSessionMgr_defaultsSetJbMargin;
*defaultsSetJbMaxLateRate = *tinyWRAPc::MediaSessionMgr_defaultsSetJbMaxLateRate;
*defaultsSetEchoTail = *tinyWRAPc::MediaSessionMgr_defaultsSetEchoTail;
diff --git a/bindings/perl/tinyWRAP_wrap.cxx b/bindings/perl/tinyWRAP_wrap.cxx
index b968123..96b411f 100755
--- a/bindings/perl/tinyWRAP_wrap.cxx
+++ b/bindings/perl/tinyWRAP_wrap.cxx
@@ -1549,70 +1549,71 @@ SWIG_Perl_SetModule(swig_module_info *module) {
#define SWIGTYPE_p_ProxyVideoProducerCallback swig_types[32]
#define SWIGTYPE_p_PublicationEvent swig_types[33]
#define SWIGTYPE_p_PublicationSession swig_types[34]
-#define SWIGTYPE_p_RPMessage swig_types[35]
-#define SWIGTYPE_p_RegistrationEvent swig_types[36]
-#define SWIGTYPE_p_RegistrationSession swig_types[37]
-#define SWIGTYPE_p_SMSData swig_types[38]
-#define SWIGTYPE_p_SMSEncoder swig_types[39]
-#define SWIGTYPE_p_SafeObject swig_types[40]
-#define SWIGTYPE_p_SdpMessage swig_types[41]
-#define SWIGTYPE_p_SipCallback swig_types[42]
-#define SWIGTYPE_p_SipEvent swig_types[43]
-#define SWIGTYPE_p_SipMessage swig_types[44]
-#define SWIGTYPE_p_SipSession swig_types[45]
-#define SWIGTYPE_p_SipStack swig_types[46]
-#define SWIGTYPE_p_SipUri swig_types[47]
-#define SWIGTYPE_p_StackEvent swig_types[48]
-#define SWIGTYPE_p_SubscriptionEvent swig_types[49]
-#define SWIGTYPE_p_SubscriptionSession swig_types[50]
-#define SWIGTYPE_p_T140Callback swig_types[51]
-#define SWIGTYPE_p_T140CallbackData swig_types[52]
-#define SWIGTYPE_p_XcapCallback swig_types[53]
-#define SWIGTYPE_p_XcapEvent swig_types[54]
-#define SWIGTYPE_p_XcapMessage swig_types[55]
-#define SWIGTYPE_p_XcapSelector swig_types[56]
-#define SWIGTYPE_p_XcapStack swig_types[57]
-#define SWIGTYPE_p_char swig_types[58]
-#define SWIGTYPE_p_int swig_types[59]
-#define SWIGTYPE_p_long_long swig_types[60]
-#define SWIGTYPE_p_short swig_types[61]
-#define SWIGTYPE_p_signed_char swig_types[62]
-#define SWIGTYPE_p_tdav_codec_id_e swig_types[63]
-#define SWIGTYPE_p_thttp_event_type_e swig_types[64]
-#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[65]
-#define SWIGTYPE_p_tmedia_chroma_e swig_types[66]
-#define SWIGTYPE_p_tmedia_codec_id_e swig_types[67]
-#define SWIGTYPE_p_tmedia_mode_e swig_types[68]
-#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[69]
-#define SWIGTYPE_p_tmedia_profile_e swig_types[70]
-#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[71]
-#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[72]
-#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[73]
-#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[74]
-#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[75]
-#define SWIGTYPE_p_tmsrp_event_type_e swig_types[76]
-#define SWIGTYPE_p_tmsrp_request_type_e swig_types[77]
-#define SWIGTYPE_p_tsip_event_type_e swig_types[78]
-#define SWIGTYPE_p_tsip_info_event_type_e swig_types[79]
-#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[80]
-#define SWIGTYPE_p_tsip_message_event_type_e swig_types[81]
-#define SWIGTYPE_p_tsip_options_event_type_e swig_types[82]
-#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[83]
-#define SWIGTYPE_p_tsip_register_event_type_e swig_types[84]
-#define SWIGTYPE_p_tsip_request_type_e swig_types[85]
-#define SWIGTYPE_p_tsip_stack_mode_e swig_types[86]
-#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[87]
-#define SWIGTYPE_p_tsk_list_t swig_types[88]
-#define SWIGTYPE_p_twrap_media_type_e swig_types[89]
-#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[90]
-#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[91]
-#define SWIGTYPE_p_twrap_sms_type_e swig_types[92]
-#define SWIGTYPE_p_unsigned_char swig_types[93]
-#define SWIGTYPE_p_unsigned_int swig_types[94]
-#define SWIGTYPE_p_unsigned_long_long swig_types[95]
-#define SWIGTYPE_p_unsigned_short swig_types[96]
-static swig_type_info *swig_types[98];
-static swig_module_info swig_module = {swig_types, 97, 0, 0, 0, 0};
+#define SWIGTYPE_p_QoS swig_types[35]
+#define SWIGTYPE_p_RPMessage swig_types[36]
+#define SWIGTYPE_p_RegistrationEvent swig_types[37]
+#define SWIGTYPE_p_RegistrationSession swig_types[38]
+#define SWIGTYPE_p_SMSData swig_types[39]
+#define SWIGTYPE_p_SMSEncoder swig_types[40]
+#define SWIGTYPE_p_SafeObject swig_types[41]
+#define SWIGTYPE_p_SdpMessage swig_types[42]
+#define SWIGTYPE_p_SipCallback swig_types[43]
+#define SWIGTYPE_p_SipEvent swig_types[44]
+#define SWIGTYPE_p_SipMessage swig_types[45]
+#define SWIGTYPE_p_SipSession swig_types[46]
+#define SWIGTYPE_p_SipStack swig_types[47]
+#define SWIGTYPE_p_SipUri swig_types[48]
+#define SWIGTYPE_p_StackEvent swig_types[49]
+#define SWIGTYPE_p_SubscriptionEvent swig_types[50]
+#define SWIGTYPE_p_SubscriptionSession swig_types[51]
+#define SWIGTYPE_p_T140Callback swig_types[52]
+#define SWIGTYPE_p_T140CallbackData swig_types[53]
+#define SWIGTYPE_p_XcapCallback swig_types[54]
+#define SWIGTYPE_p_XcapEvent swig_types[55]
+#define SWIGTYPE_p_XcapMessage swig_types[56]
+#define SWIGTYPE_p_XcapSelector swig_types[57]
+#define SWIGTYPE_p_XcapStack swig_types[58]
+#define SWIGTYPE_p_char swig_types[59]
+#define SWIGTYPE_p_int swig_types[60]
+#define SWIGTYPE_p_long_long swig_types[61]
+#define SWIGTYPE_p_short swig_types[62]
+#define SWIGTYPE_p_signed_char swig_types[63]
+#define SWIGTYPE_p_tdav_codec_id_e swig_types[64]
+#define SWIGTYPE_p_thttp_event_type_e swig_types[65]
+#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[66]
+#define SWIGTYPE_p_tmedia_chroma_e swig_types[67]
+#define SWIGTYPE_p_tmedia_codec_id_e swig_types[68]
+#define SWIGTYPE_p_tmedia_mode_e swig_types[69]
+#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[70]
+#define SWIGTYPE_p_tmedia_profile_e swig_types[71]
+#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[72]
+#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[73]
+#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[74]
+#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[75]
+#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[76]
+#define SWIGTYPE_p_tmsrp_event_type_e swig_types[77]
+#define SWIGTYPE_p_tmsrp_request_type_e swig_types[78]
+#define SWIGTYPE_p_tsip_event_type_e swig_types[79]
+#define SWIGTYPE_p_tsip_info_event_type_e swig_types[80]
+#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[81]
+#define SWIGTYPE_p_tsip_message_event_type_e swig_types[82]
+#define SWIGTYPE_p_tsip_options_event_type_e swig_types[83]
+#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[84]
+#define SWIGTYPE_p_tsip_register_event_type_e swig_types[85]
+#define SWIGTYPE_p_tsip_request_type_e swig_types[86]
+#define SWIGTYPE_p_tsip_stack_mode_e swig_types[87]
+#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[88]
+#define SWIGTYPE_p_tsk_list_t swig_types[89]
+#define SWIGTYPE_p_twrap_media_type_e swig_types[90]
+#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[91]
+#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[92]
+#define SWIGTYPE_p_twrap_sms_type_e swig_types[93]
+#define SWIGTYPE_p_unsigned_char swig_types[94]
+#define SWIGTYPE_p_unsigned_int swig_types[95]
+#define SWIGTYPE_p_unsigned_long_long swig_types[96]
+#define SWIGTYPE_p_unsigned_short swig_types[97]
+static swig_type_info *swig_types[99];
+static swig_module_info swig_module = {swig_types, 98, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@@ -1996,6 +1997,20 @@ SWIG_AsVal_short SWIG_PERL_DECL_ARGS_2(SV * obj, short *val)
SWIGINTERNINLINE SV *
+SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value)
+{
+ return sv_2mortal(newSVnv(value));
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_float SWIG_PERL_DECL_ARGS_1(float value)
+{
+ return SWIG_From_double SWIG_PERL_CALL_ARGS_1(value);
+}
+
+
+SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
SV *obj = sv_newmortal();
@@ -2149,20 +2164,6 @@ SWIG_AsVal_float SWIG_PERL_DECL_ARGS_2(SV * obj, float *val)
}
-SWIGINTERNINLINE SV *
-SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value)
-{
- return sv_2mortal(newSVnv(value));
-}
-
-
-SWIGINTERNINLINE SV *
-SWIG_From_float SWIG_PERL_DECL_ARGS_1(float value)
-{
- return SWIG_From_double SWIG_PERL_CALL_ARGS_1(value);
-}
-
-
SWIGINTERN int
SWIG_AsVal_unsigned_SS_short SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned short *val)
{
@@ -3110,6 +3111,453 @@ XS(_wrap_ActionConfig_setMediaInt) {
}
+XS(_wrap_delete_QoS) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: delete_QoS(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_QoS" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ delete arg1;
+ ST(argvi) = sv_newmortal();
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQavg) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQavg(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQavg" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQavg();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ1) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ1(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ1" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ1();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ2) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ2(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ2" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ2();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ3) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ3(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ3" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ3();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ4) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ4(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ4" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ4();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getQ5) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ float result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getQ5(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ5" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ5();
+ ST(argvi) = SWIG_From_float SWIG_PERL_CALL_ARGS_1(static_cast< float >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoInWidth) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoInWidth(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInWidth" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoOutWidth) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoOutWidth(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutWidth" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoInHeight) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoInHeight(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInHeight" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoOutHeight) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoOutHeight(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutHeight" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getBandwidthDownKbps) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getBandwidthDownKbps(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthDownKbps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getBandwidthUpKbps) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getBandwidthUpKbps(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthUpKbps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoInAvgFps) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoInAvgFps(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInAvgFps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoDecAvgTime) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoDecAvgTime(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoDecAvgTime" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_QoS_getVideoEncAvgTime) {
+ {
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ unsigned int result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: QoS_getVideoEncAvgTime(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoEncAvgTime" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1(static_cast< unsigned int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_delete_Codec) {
{
Codec *arg1 = (Codec *) 0 ;
@@ -3468,6 +3916,44 @@ XS(_wrap_MediaSessionMgr_sessionGetInt32) {
}
+XS(_wrap_MediaSessionMgr_sessionGetQoS) {
+ {
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int argvi = 0;
+ QoS *result = 0 ;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: MediaSessionMgr_sessionGetQoS(self,media);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_MediaSessionMgr, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "1"" of type '" "MediaSessionMgr *""'");
+ }
+ arg1 = reinterpret_cast< MediaSessionMgr * >(argp1);
+ ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "2"" of type '" "twrap_media_type_t""'");
+ }
+ arg2 = static_cast< twrap_media_type_t >(val2);
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_QoS, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_MediaSessionMgr_consumerSetInt32) {
{
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -4145,6 +4631,72 @@ XS(_wrap_MediaSessionMgr_defaultsSetPrefVideoSize) {
}
+XS(_wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange) {
+ {
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int argvi = 0;
+ bool result;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(min,max);");
+ }
+ ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "1"" of type '" "tmedia_pref_video_size_t""'");
+ }
+ arg1 = static_cast< tmedia_pref_video_size_t >(val1);
+ ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "2"" of type '" "tmedia_pref_video_size_t""'");
+ }
+ arg2 = static_cast< tmedia_pref_video_size_t >(val2);
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled) {
+ {
+ bool arg1 ;
+ bool val1 ;
+ int ecode1 = 0 ;
+ int argvi = 0;
+ bool result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(enabled);");
+ }
+ ecode1 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled" "', argument " "1"" of type '" "bool""'");
+ }
+ arg1 = static_cast< bool >(val1);
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_MediaSessionMgr_defaultsSetJbMargin) {
{
uint32_t arg1 ;
@@ -27523,6 +28075,7 @@ static swig_type_info _swigt__p_ProxyVideoProducer = {"_p_ProxyVideoProducer", "
static swig_type_info _swigt__p_ProxyVideoProducerCallback = {"_p_ProxyVideoProducerCallback", "ProxyVideoProducerCallback *", 0, 0, (void*)"tinyWRAP::ProxyVideoProducerCallback", 0};
static swig_type_info _swigt__p_PublicationEvent = {"_p_PublicationEvent", "PublicationEvent *", 0, 0, (void*)"tinyWRAP::PublicationEvent", 0};
static swig_type_info _swigt__p_PublicationSession = {"_p_PublicationSession", "PublicationSession *", 0, 0, (void*)"tinyWRAP::PublicationSession", 0};
+static swig_type_info _swigt__p_QoS = {"_p_QoS", "QoS *", 0, 0, (void*)"tinyWRAP::QoS", 0};
static swig_type_info _swigt__p_RPMessage = {"_p_RPMessage", "RPMessage *", 0, 0, (void*)"tinyWRAP::RPMessage", 0};
static swig_type_info _swigt__p_RegistrationEvent = {"_p_RegistrationEvent", "RegistrationEvent *", 0, 0, (void*)"tinyWRAP::RegistrationEvent", 0};
static swig_type_info _swigt__p_RegistrationSession = {"_p_RegistrationSession", "RegistrationSession *", 0, 0, (void*)"tinyWRAP::RegistrationSession", 0};
@@ -27622,6 +28175,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_ProxyVideoProducerCallback,
&_swigt__p_PublicationEvent,
&_swigt__p_PublicationSession,
+ &_swigt__p_QoS,
&_swigt__p_RPMessage,
&_swigt__p_RegistrationEvent,
&_swigt__p_RegistrationSession,
@@ -27721,6 +28275,7 @@ static swig_cast_info _swigc__p_ProxyVideoProducer[] = { {&_swigt__p_ProxyVideo
static swig_cast_info _swigc__p_ProxyVideoProducerCallback[] = { {&_swigt__p_ProxyVideoProducerCallback, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PublicationEvent[] = { {&_swigt__p_PublicationEvent, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PublicationSession[] = { {&_swigt__p_PublicationSession, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_QoS[] = { {&_swigt__p_QoS, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RPMessage[] = { {&_swigt__p_RPMessage, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RegistrationEvent[] = { {&_swigt__p_RegistrationEvent, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RegistrationSession[] = { {&_swigt__p_RegistrationSession, 0, 0, 0},{0, 0, 0, 0}};
@@ -27820,6 +28375,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_ProxyVideoProducerCallback,
_swigc__p_PublicationEvent,
_swigc__p_PublicationSession,
+ _swigc__p_QoS,
_swigc__p_RPMessage,
_swigc__p_RegistrationEvent,
_swigc__p_RegistrationSession,
@@ -27917,6 +28473,22 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::ActionConfig_setResponseLine", _wrap_ActionConfig_setResponseLine},
{"tinyWRAPc::ActionConfig_setMediaString", _wrap_ActionConfig_setMediaString},
{"tinyWRAPc::ActionConfig_setMediaInt", _wrap_ActionConfig_setMediaInt},
+{"tinyWRAPc::delete_QoS", _wrap_delete_QoS},
+{"tinyWRAPc::QoS_getQavg", _wrap_QoS_getQavg},
+{"tinyWRAPc::QoS_getQ1", _wrap_QoS_getQ1},
+{"tinyWRAPc::QoS_getQ2", _wrap_QoS_getQ2},
+{"tinyWRAPc::QoS_getQ3", _wrap_QoS_getQ3},
+{"tinyWRAPc::QoS_getQ4", _wrap_QoS_getQ4},
+{"tinyWRAPc::QoS_getQ5", _wrap_QoS_getQ5},
+{"tinyWRAPc::QoS_getVideoInWidth", _wrap_QoS_getVideoInWidth},
+{"tinyWRAPc::QoS_getVideoOutWidth", _wrap_QoS_getVideoOutWidth},
+{"tinyWRAPc::QoS_getVideoInHeight", _wrap_QoS_getVideoInHeight},
+{"tinyWRAPc::QoS_getVideoOutHeight", _wrap_QoS_getVideoOutHeight},
+{"tinyWRAPc::QoS_getBandwidthDownKbps", _wrap_QoS_getBandwidthDownKbps},
+{"tinyWRAPc::QoS_getBandwidthUpKbps", _wrap_QoS_getBandwidthUpKbps},
+{"tinyWRAPc::QoS_getVideoInAvgFps", _wrap_QoS_getVideoInAvgFps},
+{"tinyWRAPc::QoS_getVideoDecAvgTime", _wrap_QoS_getVideoDecAvgTime},
+{"tinyWRAPc::QoS_getVideoEncAvgTime", _wrap_QoS_getVideoEncAvgTime},
{"tinyWRAPc::delete_Codec", _wrap_delete_Codec},
{"tinyWRAPc::Codec_getMediaType", _wrap_Codec_getMediaType},
{"tinyWRAPc::Codec_getName", _wrap_Codec_getName},
@@ -27928,6 +28500,7 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::delete_MediaSessionMgr", _wrap_delete_MediaSessionMgr},
{"tinyWRAPc::MediaSessionMgr_sessionSetInt32", _wrap_MediaSessionMgr_sessionSetInt32},
{"tinyWRAPc::MediaSessionMgr_sessionGetInt32", _wrap_MediaSessionMgr_sessionGetInt32},
+{"tinyWRAPc::MediaSessionMgr_sessionGetQoS", _wrap_MediaSessionMgr_sessionGetQoS},
{"tinyWRAPc::MediaSessionMgr_consumerSetInt32", _wrap_MediaSessionMgr_consumerSetInt32},
{"tinyWRAPc::MediaSessionMgr_consumerSetInt64", _wrap_MediaSessionMgr_consumerSetInt64},
{"tinyWRAPc::MediaSessionMgr_producerSetInt32", _wrap_MediaSessionMgr_producerSetInt32},
@@ -27947,6 +28520,8 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoUploadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoUploadMax},
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax},
{"tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSize", _wrap_MediaSessionMgr_defaultsSetPrefVideoSize},
+{"tinyWRAPc::MediaSessionMgr_defaultsSetPrefVideoSizeOutRange", _wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange},
+{"tinyWRAPc::MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled", _wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled},
{"tinyWRAPc::MediaSessionMgr_defaultsSetJbMargin", _wrap_MediaSessionMgr_defaultsSetJbMargin},
{"tinyWRAPc::MediaSessionMgr_defaultsSetJbMaxLateRate", _wrap_MediaSessionMgr_defaultsSetJbMaxLateRate},
{"tinyWRAPc::MediaSessionMgr_defaultsSetEchoTail", _wrap_MediaSessionMgr_defaultsSetEchoTail},
@@ -28765,6 +29340,7 @@ XS(SWIG_init) {
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
SWIG_TypeClientData(SWIGTYPE_p_ActionConfig, (void*) "tinyWRAP::ActionConfig");
+ SWIG_TypeClientData(SWIGTYPE_p_QoS, (void*) "tinyWRAP::QoS");
SWIG_TypeClientData(SWIGTYPE_p_Codec, (void*) "tinyWRAP::Codec");
SWIG_TypeClientData(SWIGTYPE_p_MediaSessionMgr, (void*) "tinyWRAP::MediaSessionMgr");
SWIG_TypeClientData(SWIGTYPE_p_MediaContent, (void*) "tinyWRAP::MediaContent");
diff --git a/bindings/python/tinyWRAP.py b/bindings/python/tinyWRAP.py
index f08ac2e..4c45b08 100755
--- a/bindings/python/tinyWRAP.py
+++ b/bindings/python/tinyWRAP.py
@@ -151,6 +151,33 @@ class ActionConfig(_object):
ActionConfig_swigregister = _tinyWRAP.ActionConfig_swigregister
ActionConfig_swigregister(ActionConfig)
+class QoS(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, QoS, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, QoS, name)
+ def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+ __repr__ = _swig_repr
+ __swig_destroy__ = _tinyWRAP.delete_QoS
+ __del__ = lambda self : None;
+ def getQavg(self): return _tinyWRAP.QoS_getQavg(self)
+ def getQ1(self): return _tinyWRAP.QoS_getQ1(self)
+ def getQ2(self): return _tinyWRAP.QoS_getQ2(self)
+ def getQ3(self): return _tinyWRAP.QoS_getQ3(self)
+ def getQ4(self): return _tinyWRAP.QoS_getQ4(self)
+ def getQ5(self): return _tinyWRAP.QoS_getQ5(self)
+ def getVideoInWidth(self): return _tinyWRAP.QoS_getVideoInWidth(self)
+ def getVideoOutWidth(self): return _tinyWRAP.QoS_getVideoOutWidth(self)
+ def getVideoInHeight(self): return _tinyWRAP.QoS_getVideoInHeight(self)
+ def getVideoOutHeight(self): return _tinyWRAP.QoS_getVideoOutHeight(self)
+ def getBandwidthDownKbps(self): return _tinyWRAP.QoS_getBandwidthDownKbps(self)
+ def getBandwidthUpKbps(self): return _tinyWRAP.QoS_getBandwidthUpKbps(self)
+ def getVideoInAvgFps(self): return _tinyWRAP.QoS_getVideoInAvgFps(self)
+ def getVideoDecAvgTime(self): return _tinyWRAP.QoS_getVideoDecAvgTime(self)
+ def getVideoEncAvgTime(self): return _tinyWRAP.QoS_getVideoEncAvgTime(self)
+QoS_swigregister = _tinyWRAP.QoS_swigregister
+QoS_swigregister(QoS)
+
class Codec(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Codec, name, value)
@@ -181,6 +208,7 @@ class MediaSessionMgr(_object):
__del__ = lambda self : None;
def sessionSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_sessionSetInt32(self, *args)
def sessionGetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_sessionGetInt32(self, *args)
+ def sessionGetQoS(self, *args): return _tinyWRAP.MediaSessionMgr_sessionGetQoS(self, *args)
def consumerSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_consumerSetInt32(self, *args)
def consumerSetInt64(self, *args): return _tinyWRAP.MediaSessionMgr_consumerSetInt64(self, *args)
def producerSetInt32(self, *args): return _tinyWRAP.MediaSessionMgr_producerSetInt32(self, *args)
@@ -211,6 +239,10 @@ class MediaSessionMgr(_object):
if _newclass:defaultsSetBandwidthVideoDownloadMax = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax)
__swig_getmethods__["defaultsSetPrefVideoSize"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize
if _newclass:defaultsSetPrefVideoSize = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize)
+ __swig_getmethods__["defaultsSetPrefVideoSizeOutRange"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange
+ if _newclass:defaultsSetPrefVideoSizeOutRange = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange)
+ __swig_getmethods__["defaultsSetAdaptativeVideoSizeOutEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled
+ if _newclass:defaultsSetAdaptativeVideoSizeOutEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled)
__swig_getmethods__["defaultsSetJbMargin"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin
if _newclass:defaultsSetJbMargin = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetJbMargin)
__swig_getmethods__["defaultsSetJbMaxLateRate"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetJbMaxLateRate
@@ -374,6 +406,14 @@ def MediaSessionMgr_defaultsSetPrefVideoSize(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize(*args)
MediaSessionMgr_defaultsSetPrefVideoSize = _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSize
+def MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(*args):
+ return _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(*args)
+MediaSessionMgr_defaultsSetPrefVideoSizeOutRange = _tinyWRAP.MediaSessionMgr_defaultsSetPrefVideoSizeOutRange
+
+def MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(*args):
+ return _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(*args)
+MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled = _tinyWRAP.MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled
+
def MediaSessionMgr_defaultsSetJbMargin(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin(*args)
MediaSessionMgr_defaultsSetJbMargin = _tinyWRAP.MediaSessionMgr_defaultsSetJbMargin
diff --git a/bindings/python/tinyWRAP_wrap.cxx b/bindings/python/tinyWRAP_wrap.cxx
index 1c61908..6adfc9f 100755
--- a/bindings/python/tinyWRAP_wrap.cxx
+++ b/bindings/python/tinyWRAP_wrap.cxx
@@ -3480,70 +3480,71 @@ namespace Swig {
#define SWIGTYPE_p_ProxyVideoProducerCallback swig_types[32]
#define SWIGTYPE_p_PublicationEvent swig_types[33]
#define SWIGTYPE_p_PublicationSession swig_types[34]
-#define SWIGTYPE_p_RPMessage swig_types[35]
-#define SWIGTYPE_p_RegistrationEvent swig_types[36]
-#define SWIGTYPE_p_RegistrationSession swig_types[37]
-#define SWIGTYPE_p_SMSData swig_types[38]
-#define SWIGTYPE_p_SMSEncoder swig_types[39]
-#define SWIGTYPE_p_SafeObject swig_types[40]
-#define SWIGTYPE_p_SdpMessage swig_types[41]
-#define SWIGTYPE_p_SipCallback swig_types[42]
-#define SWIGTYPE_p_SipEvent swig_types[43]
-#define SWIGTYPE_p_SipMessage swig_types[44]
-#define SWIGTYPE_p_SipSession swig_types[45]
-#define SWIGTYPE_p_SipStack swig_types[46]
-#define SWIGTYPE_p_SipUri swig_types[47]
-#define SWIGTYPE_p_StackEvent swig_types[48]
-#define SWIGTYPE_p_SubscriptionEvent swig_types[49]
-#define SWIGTYPE_p_SubscriptionSession swig_types[50]
-#define SWIGTYPE_p_T140Callback swig_types[51]
-#define SWIGTYPE_p_T140CallbackData swig_types[52]
-#define SWIGTYPE_p_XcapCallback swig_types[53]
-#define SWIGTYPE_p_XcapEvent swig_types[54]
-#define SWIGTYPE_p_XcapMessage swig_types[55]
-#define SWIGTYPE_p_XcapSelector swig_types[56]
-#define SWIGTYPE_p_XcapStack swig_types[57]
-#define SWIGTYPE_p_char swig_types[58]
-#define SWIGTYPE_p_int swig_types[59]
-#define SWIGTYPE_p_long_long swig_types[60]
-#define SWIGTYPE_p_short swig_types[61]
-#define SWIGTYPE_p_signed_char swig_types[62]
-#define SWIGTYPE_p_tdav_codec_id_e swig_types[63]
-#define SWIGTYPE_p_thttp_event_type_e swig_types[64]
-#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[65]
-#define SWIGTYPE_p_tmedia_chroma_e swig_types[66]
-#define SWIGTYPE_p_tmedia_codec_id_e swig_types[67]
-#define SWIGTYPE_p_tmedia_mode_e swig_types[68]
-#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[69]
-#define SWIGTYPE_p_tmedia_profile_e swig_types[70]
-#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[71]
-#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[72]
-#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[73]
-#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[74]
-#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[75]
-#define SWIGTYPE_p_tmsrp_event_type_e swig_types[76]
-#define SWIGTYPE_p_tmsrp_request_type_e swig_types[77]
-#define SWIGTYPE_p_tsip_event_type_e swig_types[78]
-#define SWIGTYPE_p_tsip_info_event_type_e swig_types[79]
-#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[80]
-#define SWIGTYPE_p_tsip_message_event_type_e swig_types[81]
-#define SWIGTYPE_p_tsip_options_event_type_e swig_types[82]
-#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[83]
-#define SWIGTYPE_p_tsip_register_event_type_e swig_types[84]
-#define SWIGTYPE_p_tsip_request_type_e swig_types[85]
-#define SWIGTYPE_p_tsip_stack_mode_e swig_types[86]
-#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[87]
-#define SWIGTYPE_p_tsk_list_t swig_types[88]
-#define SWIGTYPE_p_twrap_media_type_e swig_types[89]
-#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[90]
-#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[91]
-#define SWIGTYPE_p_twrap_sms_type_e swig_types[92]
-#define SWIGTYPE_p_unsigned_char swig_types[93]
-#define SWIGTYPE_p_unsigned_int swig_types[94]
-#define SWIGTYPE_p_unsigned_long_long swig_types[95]
-#define SWIGTYPE_p_unsigned_short swig_types[96]
-static swig_type_info *swig_types[98];
-static swig_module_info swig_module = {swig_types, 97, 0, 0, 0, 0};
+#define SWIGTYPE_p_QoS swig_types[35]
+#define SWIGTYPE_p_RPMessage swig_types[36]
+#define SWIGTYPE_p_RegistrationEvent swig_types[37]
+#define SWIGTYPE_p_RegistrationSession swig_types[38]
+#define SWIGTYPE_p_SMSData swig_types[39]
+#define SWIGTYPE_p_SMSEncoder swig_types[40]
+#define SWIGTYPE_p_SafeObject swig_types[41]
+#define SWIGTYPE_p_SdpMessage swig_types[42]
+#define SWIGTYPE_p_SipCallback swig_types[43]
+#define SWIGTYPE_p_SipEvent swig_types[44]
+#define SWIGTYPE_p_SipMessage swig_types[45]
+#define SWIGTYPE_p_SipSession swig_types[46]
+#define SWIGTYPE_p_SipStack swig_types[47]
+#define SWIGTYPE_p_SipUri swig_types[48]
+#define SWIGTYPE_p_StackEvent swig_types[49]
+#define SWIGTYPE_p_SubscriptionEvent swig_types[50]
+#define SWIGTYPE_p_SubscriptionSession swig_types[51]
+#define SWIGTYPE_p_T140Callback swig_types[52]
+#define SWIGTYPE_p_T140CallbackData swig_types[53]
+#define SWIGTYPE_p_XcapCallback swig_types[54]
+#define SWIGTYPE_p_XcapEvent swig_types[55]
+#define SWIGTYPE_p_XcapMessage swig_types[56]
+#define SWIGTYPE_p_XcapSelector swig_types[57]
+#define SWIGTYPE_p_XcapStack swig_types[58]
+#define SWIGTYPE_p_char swig_types[59]
+#define SWIGTYPE_p_int swig_types[60]
+#define SWIGTYPE_p_long_long swig_types[61]
+#define SWIGTYPE_p_short swig_types[62]
+#define SWIGTYPE_p_signed_char swig_types[63]
+#define SWIGTYPE_p_tdav_codec_id_e swig_types[64]
+#define SWIGTYPE_p_thttp_event_type_e swig_types[65]
+#define SWIGTYPE_p_tmedia_bandwidth_level_e swig_types[66]
+#define SWIGTYPE_p_tmedia_chroma_e swig_types[67]
+#define SWIGTYPE_p_tmedia_codec_id_e swig_types[68]
+#define SWIGTYPE_p_tmedia_mode_e swig_types[69]
+#define SWIGTYPE_p_tmedia_pref_video_size_s swig_types[70]
+#define SWIGTYPE_p_tmedia_profile_e swig_types[71]
+#define SWIGTYPE_p_tmedia_qos_strength_e swig_types[72]
+#define SWIGTYPE_p_tmedia_qos_stype_e swig_types[73]
+#define SWIGTYPE_p_tmedia_srtp_mode_e swig_types[74]
+#define SWIGTYPE_p_tmedia_srtp_type_e swig_types[75]
+#define SWIGTYPE_p_tmedia_t140_data_type_e swig_types[76]
+#define SWIGTYPE_p_tmsrp_event_type_e swig_types[77]
+#define SWIGTYPE_p_tmsrp_request_type_e swig_types[78]
+#define SWIGTYPE_p_tsip_event_type_e swig_types[79]
+#define SWIGTYPE_p_tsip_info_event_type_e swig_types[80]
+#define SWIGTYPE_p_tsip_invite_event_type_e swig_types[81]
+#define SWIGTYPE_p_tsip_message_event_type_e swig_types[82]
+#define SWIGTYPE_p_tsip_options_event_type_e swig_types[83]
+#define SWIGTYPE_p_tsip_publish_event_type_e swig_types[84]
+#define SWIGTYPE_p_tsip_register_event_type_e swig_types[85]
+#define SWIGTYPE_p_tsip_request_type_e swig_types[86]
+#define SWIGTYPE_p_tsip_stack_mode_e swig_types[87]
+#define SWIGTYPE_p_tsip_subscribe_event_type_e swig_types[88]
+#define SWIGTYPE_p_tsk_list_t swig_types[89]
+#define SWIGTYPE_p_twrap_media_type_e swig_types[90]
+#define SWIGTYPE_p_twrap_proxy_plugin_type_e swig_types[91]
+#define SWIGTYPE_p_twrap_rpmessage_type_e swig_types[92]
+#define SWIGTYPE_p_twrap_sms_type_e swig_types[93]
+#define SWIGTYPE_p_unsigned_char swig_types[94]
+#define SWIGTYPE_p_unsigned_int swig_types[95]
+#define SWIGTYPE_p_unsigned_long_long swig_types[96]
+#define SWIGTYPE_p_unsigned_short swig_types[97]
+static swig_type_info *swig_types[99];
+static swig_module_info swig_module = {swig_types, 98, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@@ -4030,6 +4031,16 @@ SWIG_AsVal_short (PyObject * obj, short *val)
}
+ #define SWIG_From_double PyFloat_FromDouble
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_float (float value)
+{
+ return SWIG_From_double (value);
+}
+
+
SWIGINTERN int
SWIG_AsVal_long_SS_long (PyObject *obj, long long *val)
{
@@ -4113,16 +4124,6 @@ SWIG_AsVal_float (PyObject * obj, float *val)
}
- #define SWIG_From_double PyFloat_FromDouble
-
-
-SWIGINTERNINLINE PyObject *
-SWIG_From_float (float value)
-{
- return SWIG_From_double (value);
-}
-
-
SWIGINTERN int
SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val)
{
@@ -6273,6 +6274,364 @@ SWIGINTERN PyObject *ActionConfig_swigregister(PyObject *SWIGUNUSEDPARM(self), P
return SWIG_Py_Void();
}
+SWIGINTERN PyObject *_wrap_delete_QoS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_QoS",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_QoS" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ delete arg1;
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQavg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQavg",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQavg" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQavg();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ1",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ1" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ1();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ2",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ2" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ2();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ3",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ3" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ3();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ4",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ4" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ4();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getQ5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ float result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getQ5",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getQ5" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (float)(arg1)->getQ5();
+ resultobj = SWIG_From_float(static_cast< float >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoInWidth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInWidth",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInWidth" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInWidth();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoOutWidth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoOutWidth",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutWidth" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoOutWidth();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoInHeight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInHeight",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInHeight" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInHeight();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoOutHeight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoOutHeight",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoOutHeight" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoOutHeight();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getBandwidthDownKbps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getBandwidthDownKbps",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthDownKbps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getBandwidthDownKbps();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getBandwidthUpKbps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getBandwidthUpKbps",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getBandwidthUpKbps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getBandwidthUpKbps();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoInAvgFps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoInAvgFps",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoInAvgFps" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoInAvgFps();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoDecAvgTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoDecAvgTime",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoDecAvgTime" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoDecAvgTime();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_QoS_getVideoEncAvgTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ QoS *arg1 = (QoS *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:QoS_getVideoEncAvgTime",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_QoS, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "QoS_getVideoEncAvgTime" "', argument " "1"" of type '" "QoS *""'");
+ }
+ arg1 = reinterpret_cast< QoS * >(argp1);
+ result = (unsigned int)(arg1)->getVideoEncAvgTime();
+ resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *QoS_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_QoS, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
SWIGINTERN PyObject *_wrap_delete_Codec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
Codec *arg1 = (Codec *) 0 ;
@@ -6571,6 +6930,37 @@ fail:
}
+SWIGINTERN PyObject *_wrap_MediaSessionMgr_sessionGetQoS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
+ twrap_media_type_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ QoS *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:MediaSessionMgr_sessionGetQoS",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MediaSessionMgr, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "1"" of type '" "MediaSessionMgr *""'");
+ }
+ arg1 = reinterpret_cast< MediaSessionMgr * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_sessionGetQoS" "', argument " "2"" of type '" "twrap_media_type_t""'");
+ }
+ arg2 = static_cast< twrap_media_type_t >(val2);
+ result = (QoS *)(arg1)->sessionGetQoS(arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_QoS, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_MediaSessionMgr_consumerSetInt32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
MediaSessionMgr *arg1 = (MediaSessionMgr *) 0 ;
@@ -7130,6 +7520,59 @@ fail:
}
+SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ tmedia_pref_video_size_t arg1 ;
+ tmedia_pref_video_size_t arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:MediaSessionMgr_defaultsSetPrefVideoSizeOutRange",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "1"" of type '" "tmedia_pref_video_size_t""'");
+ }
+ arg1 = static_cast< tmedia_pref_video_size_t >(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_defaultsSetPrefVideoSizeOutRange" "', argument " "2"" of type '" "tmedia_pref_video_size_t""'");
+ }
+ arg2 = static_cast< tmedia_pref_video_size_t >(val2);
+ result = (bool)MediaSessionMgr::defaultsSetPrefVideoSizeOutRange(arg1,arg2);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ bool arg1 ;
+ bool val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_bool(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled" "', argument " "1"" of type '" "bool""'");
+ }
+ arg1 = static_cast< bool >(val1);
+ result = (bool)MediaSessionMgr::defaultsSetAdaptativeVideoSizeOutEnabled(arg1);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetJbMargin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
uint32_t arg1 ;
@@ -26276,6 +26719,23 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"ActionConfig_setMediaString", _wrap_ActionConfig_setMediaString, METH_VARARGS, NULL},
{ (char *)"ActionConfig_setMediaInt", _wrap_ActionConfig_setMediaInt, METH_VARARGS, NULL},
{ (char *)"ActionConfig_swigregister", ActionConfig_swigregister, METH_VARARGS, NULL},
+ { (char *)"delete_QoS", _wrap_delete_QoS, METH_VARARGS, NULL},
+ { (char *)"QoS_getQavg", _wrap_QoS_getQavg, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ1", _wrap_QoS_getQ1, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ2", _wrap_QoS_getQ2, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ3", _wrap_QoS_getQ3, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ4", _wrap_QoS_getQ4, METH_VARARGS, NULL},
+ { (char *)"QoS_getQ5", _wrap_QoS_getQ5, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoInWidth", _wrap_QoS_getVideoInWidth, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoOutWidth", _wrap_QoS_getVideoOutWidth, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoInHeight", _wrap_QoS_getVideoInHeight, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoOutHeight", _wrap_QoS_getVideoOutHeight, METH_VARARGS, NULL},
+ { (char *)"QoS_getBandwidthDownKbps", _wrap_QoS_getBandwidthDownKbps, METH_VARARGS, NULL},
+ { (char *)"QoS_getBandwidthUpKbps", _wrap_QoS_getBandwidthUpKbps, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoInAvgFps", _wrap_QoS_getVideoInAvgFps, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoDecAvgTime", _wrap_QoS_getVideoDecAvgTime, METH_VARARGS, NULL},
+ { (char *)"QoS_getVideoEncAvgTime", _wrap_QoS_getVideoEncAvgTime, METH_VARARGS, NULL},
+ { (char *)"QoS_swigregister", QoS_swigregister, METH_VARARGS, NULL},
{ (char *)"delete_Codec", _wrap_delete_Codec, METH_VARARGS, NULL},
{ (char *)"Codec_getMediaType", _wrap_Codec_getMediaType, METH_VARARGS, NULL},
{ (char *)"Codec_getName", _wrap_Codec_getName, METH_VARARGS, NULL},
@@ -26288,6 +26748,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"delete_MediaSessionMgr", _wrap_delete_MediaSessionMgr, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_sessionSetInt32", _wrap_MediaSessionMgr_sessionSetInt32, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_sessionGetInt32", _wrap_MediaSessionMgr_sessionGetInt32, METH_VARARGS, NULL},
+ { (char *)"MediaSessionMgr_sessionGetQoS", _wrap_MediaSessionMgr_sessionGetQoS, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_consumerSetInt32", _wrap_MediaSessionMgr_consumerSetInt32, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_consumerSetInt64", _wrap_MediaSessionMgr_consumerSetInt64, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_producerSetInt32", _wrap_MediaSessionMgr_producerSetInt32, METH_VARARGS, NULL},
@@ -26307,6 +26768,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"MediaSessionMgr_defaultsSetBandwidthVideoUploadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoUploadMax, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetPrefVideoSize", _wrap_MediaSessionMgr_defaultsSetPrefVideoSize, METH_VARARGS, NULL},
+ { (char *)"MediaSessionMgr_defaultsSetPrefVideoSizeOutRange", _wrap_MediaSessionMgr_defaultsSetPrefVideoSizeOutRange, METH_VARARGS, NULL},
+ { (char *)"MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled", _wrap_MediaSessionMgr_defaultsSetAdaptativeVideoSizeOutEnabled, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetJbMargin", _wrap_MediaSessionMgr_defaultsSetJbMargin, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetJbMaxLateRate", _wrap_MediaSessionMgr_defaultsSetJbMaxLateRate, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetEchoTail", _wrap_MediaSessionMgr_defaultsSetEchoTail, METH_VARARGS, NULL},
@@ -26957,6 +27420,7 @@ static swig_type_info _swigt__p_ProxyVideoProducer = {"_p_ProxyVideoProducer", "
static swig_type_info _swigt__p_ProxyVideoProducerCallback = {"_p_ProxyVideoProducerCallback", "ProxyVideoProducerCallback *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_PublicationEvent = {"_p_PublicationEvent", "PublicationEvent *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_PublicationSession = {"_p_PublicationSession", "PublicationSession *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_QoS = {"_p_QoS", "QoS *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_RPMessage = {"_p_RPMessage", "RPMessage *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_RegistrationEvent = {"_p_RegistrationEvent", "RegistrationEvent *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_RegistrationSession = {"_p_RegistrationSession", "RegistrationSession *", 0, 0, (void*)0, 0};
@@ -27056,6 +27520,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_ProxyVideoProducerCallback,
&_swigt__p_PublicationEvent,
&_swigt__p_PublicationSession,
+ &_swigt__p_QoS,
&_swigt__p_RPMessage,
&_swigt__p_RegistrationEvent,
&_swigt__p_RegistrationSession,
@@ -27155,6 +27620,7 @@ static swig_cast_info _swigc__p_ProxyVideoProducer[] = { {&_swigt__p_ProxyVideo
static swig_cast_info _swigc__p_ProxyVideoProducerCallback[] = { {&_swigt__p_ProxyVideoProducerCallback, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PublicationEvent[] = { {&_swigt__p_PublicationEvent, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PublicationSession[] = { {&_swigt__p_PublicationSession, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_QoS[] = { {&_swigt__p_QoS, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RPMessage[] = { {&_swigt__p_RPMessage, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RegistrationEvent[] = { {&_swigt__p_RegistrationEvent, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RegistrationSession[] = { {&_swigt__p_RegistrationSession, 0, 0, 0},{0, 0, 0, 0}};
@@ -27254,6 +27720,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_ProxyVideoProducerCallback,
_swigc__p_PublicationEvent,
_swigc__p_PublicationSession,
+ _swigc__p_QoS,
_swigc__p_RPMessage,
_swigc__p_RegistrationEvent,
_swigc__p_RegistrationSession,
diff --git a/bindings/ruby/tinyWRAP_wrap.cxx b/bindings/ruby/tinyWRAP_wrap.cxx
index 4eed3a9..59e5696 100755
--- a/bindings/ruby/tinyWRAP_wrap.cxx
+++ b/bindings/ruby/tinyWRAP_wrap.cxx
@@ -1,11 +1,11 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.40
- *
- * This file is not intended to be easily readable and contains a number of
+ *
+ * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
* ----------------------------------------------------------------------------- */
#define SWIGRUBY
@@ -14,24 +14,43 @@
#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
-template<typename T> class SwigValueWrapper {
- struct SwigMovePointer {
- T *ptr;
- SwigMovePointer(T *p) : ptr(p) { }
- ~SwigMovePointer() { delete ptr; }
- SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
- } pointer;
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
- SwigValueWrapper(const SwigValueWrapper<T>& rhs);
+template<typename T> class SwigValueWrapper
+{
+ struct SwigMovePointer {
+ T *ptr;
+ SwigMovePointer(T *p) : ptr(p) { }
+ ~SwigMovePointer() {
+ delete ptr;
+ }
+ SwigMovePointer& operator=(SwigMovePointer& rhs) {
+ T* oldptr = ptr;
+ ptr = 0;
+ delete oldptr;
+ ptr = rhs.ptr;
+ rhs.ptr = 0;
+ return *this;
+ }
+ } pointer;
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
- SwigValueWrapper() : pointer(0) { }
- SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
- operator T&() const { return *pointer.ptr; }
- T *operator&() { return pointer.ptr; }
+ SwigValueWrapper() : pointer(0) { }
+ SwigValueWrapper& operator=(const T& t) {
+ SwigMovePointer tmp(new T(t));
+ pointer = tmp;
+ return *this;
+ }
+ operator T&() const {
+ return *pointer.ptr;
+ }
+ T *operator&() {
+ return pointer.ptr;
+ }
};
-template <typename T> T SwigValueInit() {
- return T();
+template <typename T> T SwigValueInit()
+{
+ return T();
}
#endif
@@ -66,28 +85,28 @@ template <typename T> T SwigValueInit() {
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
-# define SWIGUNUSED
+# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
-# endif
+# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
@@ -130,7 +149,7 @@ template <typename T> T SwigValueInit() {
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
-# endif
+# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -175,28 +194,28 @@ template <typename T> T SwigValueInit() {
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
+# define SWIGUNUSED __attribute__ ((__unused__))
# else
-# define SWIGUNUSED
+# define SWIGUNUSED
# endif
#endif
#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
-# endif
+# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
@@ -239,7 +258,7 @@ template <typename T> T SwigValueInit() {
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
-# endif
+# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -277,7 +296,7 @@ template <typename T> T SwigValueInit() {
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
creating a static or dynamic library from the SWIG runtime code.
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
-
+
But only do this if strictly necessary, ie, if you have problems
with your compiler or suchlike.
*/
@@ -303,16 +322,16 @@ template <typename T> T SwigValueInit() {
#define SWIG_POINTER_OWN 0x1
-/*
+/*
Flags/methods for returning states.
-
- The SWIG conversion methods, as ConvertPtr, return and integer
+
+ The SWIG conversion methods, as ConvertPtr, return and integer
that tells if the conversion was successful or not. And if not,
an error code can be returned (see swigerrors.swg for the codes).
-
+
Use the following macros/flags to set or process the returning
states.
-
+
In old versions of SWIG, code such as the following was usually written:
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
@@ -345,23 +364,23 @@ template <typename T> T SwigValueInit() {
} else {
// fail code
}
-
+
I.e., now SWIG_ConvertPtr can return new objects and you can
identify the case and take care of the deallocation. Of course that
also requires SWIG_ConvertPtr to return new result values, such as
- int SWIG_ConvertPtr(obj, ptr,...) {
- if (<obj is ok>) {
- if (<need new object>) {
- *ptr = <ptr to new allocated object>;
- return SWIG_NEWOBJ;
- } else {
- *ptr = <ptr to old object>;
- return SWIG_OLDOBJ;
- }
- } else {
- return SWIG_BADOBJ;
- }
+ int SWIG_ConvertPtr(obj, ptr,...) {
+ if (<obj is ok>) {
+ if (<need new object>) {
+ *ptr = <ptr to new allocated object>;
+ return SWIG_NEWOBJ;
+ } else {
+ *ptr = <ptr to old object>;
+ return SWIG_OLDOBJ;
+ }
+ } else {
+ return SWIG_BADOBJ;
+ }
}
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
@@ -375,17 +394,17 @@ template <typename T> T SwigValueInit() {
int fooi(int);
and you call
-
+
food(1) // cast rank '1' (1 -> 1.0)
fooi(1) // cast rank '0'
just use the SWIG_AddCast()/SWIG_CheckState()
*/
-#define SWIG_OK (0)
+#define SWIG_OK (0)
#define SWIG_ERROR (-1)
#define SWIG_IsOK(r) (r >= 0)
-#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
+#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT (1 << 8)
@@ -416,11 +435,13 @@ template <typename T> T SwigValueInit() {
# endif
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
-SWIGINTERNINLINE int SWIG_AddCast(int r) {
- return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+SWIGINTERNINLINE int SWIG_AddCast(int r)
+{
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
-SWIGINTERNINLINE int SWIG_CheckState(int r) {
- return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
+SWIGINTERNINLINE int SWIG_CheckState(int r)
+{
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
}
#else /* no cast-rank mode */
# define SWIG_AddCast
@@ -439,35 +460,35 @@ typedef struct swig_type_info *(*swig_dycast_func)(void **);
/* Structure to store information on one type */
typedef struct swig_type_info {
- const char *name; /* mangled name of this type */
- const char *str; /* human readable name of this type */
- swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
- struct swig_cast_info *cast; /* linked list of types that can cast into this type */
- void *clientdata; /* language specific type data */
- int owndata; /* flag if the structure owns the clientdata */
+ const char *name; /* mangled name of this type */
+ const char *str; /* human readable name of this type */
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
+ void *clientdata; /* language specific type data */
+ int owndata; /* flag if the structure owns the clientdata */
} swig_type_info;
/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
- swig_type_info *type; /* pointer to type that is equivalent to this type */
- swig_converter_func converter; /* function to cast the void pointers */
- struct swig_cast_info *next; /* pointer to next cast in linked list */
- struct swig_cast_info *prev; /* pointer to the previous cast */
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
+ swig_converter_func converter; /* function to cast the void pointers */
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
+ struct swig_cast_info *prev; /* pointer to the previous cast */
} swig_cast_info;
/* Structure used to store module information
* Each module generates one structure like this, and the runtime collects
* all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
- swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
- size_t size; /* Number of types in this module */
- struct swig_module_info *next; /* Pointer to next element in circularly linked list */
- swig_type_info **type_initial; /* Array of initially generated type structures */
- swig_cast_info **cast_initial; /* Array of initially generated casting structures */
- void *clientdata; /* Language specific module data */
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
+ size_t size; /* Number of types in this module */
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
+ swig_type_info **type_initial; /* Array of initially generated type structures */
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
+ void *clientdata; /* Language specific module data */
} swig_module_info;
-/*
+/*
Compare two type names skipping the space characters, therefore
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
@@ -476,13 +497,20 @@ typedef struct swig_module_info {
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
- const char *f2, const char *l2) {
- for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
- while ((*f1 == ' ') && (f1 != l1)) ++f1;
- while ((*f2 == ' ') && (f2 != l2)) ++f2;
- if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
- }
- return (int)((l1 - f1) - (l2 - f2));
+ const char *f2, const char *l2)
+{
+ for (; (f1 != l1) && (f2 != l2); ++f1, ++f2) {
+ while ((*f1 == ' ') && (f1 != l1)) {
+ ++f1;
+ }
+ while ((*f2 == ' ') && (f2 != l2)) {
+ ++f2;
+ }
+ if (*f1 != *f2) {
+ return (*f1 > *f2) ? 1 : -1;
+ }
+ }
+ return (int)((l1 - f1) - (l2 - f2));
}
/*
@@ -490,18 +518,23 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
-SWIG_TypeEquiv(const char *nb, const char *tb) {
- int equiv = 0;
- const char* te = tb + strlen(tb);
- const char* ne = nb;
- while (!equiv && *ne) {
- for (nb = ne; *ne; ++ne) {
- if (*ne == '|') break;
+SWIG_TypeEquiv(const char *nb, const char *tb)
+{
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') {
+ break;
+ }
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) {
+ ++ne;
+ }
}
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
- if (*ne) ++ne;
- }
- return equiv;
+ return equiv;
}
/*
@@ -509,18 +542,23 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
-SWIG_TypeCompare(const char *nb, const char *tb) {
- int equiv = 0;
- const char* te = tb + strlen(tb);
- const char* ne = nb;
- while (!equiv && *ne) {
- for (nb = ne; *ne; ++ne) {
- if (*ne == '|') break;
+SWIG_TypeCompare(const char *nb, const char *tb)
+{
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') {
+ break;
+ }
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) {
+ ++ne;
+ }
}
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
- if (*ne) ++ne;
- }
- return equiv;
+ return equiv;
}
@@ -528,84 +566,101 @@ SWIG_TypeCompare(const char *nb, const char *tb) {
Check the typename
*/
SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheck(const char *c, swig_type_info *ty) {
- if (ty) {
- swig_cast_info *iter = ty->cast;
- while (iter) {
- if (strcmp(iter->type->name, c) == 0) {
- if (iter == ty->cast)
- return iter;
- /* Move iter to the top of the linked list */
- iter->prev->next = iter->next;
- if (iter->next)
- iter->next->prev = iter->prev;
- iter->next = ty->cast;
- iter->prev = 0;
- if (ty->cast) ty->cast->prev = iter;
- ty->cast = iter;
- return iter;
- }
- iter = iter->next;
+SWIG_TypeCheck(const char *c, swig_type_info *ty)
+{
+ if (ty) {
+ swig_cast_info *iter = ty->cast;
+ while (iter) {
+ if (strcmp(iter->type->name, c) == 0) {
+ if (iter == ty->cast) {
+ return iter;
+ }
+ /* Move iter to the top of the linked list */
+ iter->prev->next = iter->next;
+ if (iter->next) {
+ iter->next->prev = iter->prev;
+ }
+ iter->next = ty->cast;
+ iter->prev = 0;
+ if (ty->cast) {
+ ty->cast->prev = iter;
+ }
+ ty->cast = iter;
+ return iter;
+ }
+ iter = iter->next;
+ }
}
- }
- return 0;
+ return 0;
}
-/*
+/*
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
- if (ty) {
- swig_cast_info *iter = ty->cast;
- while (iter) {
- if (iter->type == from) {
- if (iter == ty->cast)
- return iter;
- /* Move iter to the top of the linked list */
- iter->prev->next = iter->next;
- if (iter->next)
- iter->next->prev = iter->prev;
- iter->next = ty->cast;
- iter->prev = 0;
- if (ty->cast) ty->cast->prev = iter;
- ty->cast = iter;
- return iter;
- }
- iter = iter->next;
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
+{
+ if (ty) {
+ swig_cast_info *iter = ty->cast;
+ while (iter) {
+ if (iter->type == from) {
+ if (iter == ty->cast) {
+ return iter;
+ }
+ /* Move iter to the top of the linked list */
+ iter->prev->next = iter->next;
+ if (iter->next) {
+ iter->next->prev = iter->prev;
+ }
+ iter->next = ty->cast;
+ iter->prev = 0;
+ if (ty->cast) {
+ ty->cast->prev = iter;
+ }
+ ty->cast = iter;
+ return iter;
+ }
+ iter = iter->next;
+ }
}
- }
- return 0;
+ return 0;
}
/*
Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
- return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
+{
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}
-/*
+/*
Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
-SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
- swig_type_info *lastty = ty;
- if (!ty || !ty->dcast) return ty;
- while (ty && (ty->dcast)) {
- ty = (*ty->dcast)(ptr);
- if (ty) lastty = ty;
- }
- return lastty;
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
+{
+ swig_type_info *lastty = ty;
+ if (!ty || !ty->dcast) {
+ return ty;
+ }
+ while (ty && (ty->dcast)) {
+ ty = (*ty->dcast)(ptr);
+ if (ty) {
+ lastty = ty;
+ }
+ }
+ return lastty;
}
/*
Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
-SWIG_TypeName(const swig_type_info *ty) {
- return ty->name;
+SWIG_TypeName(const swig_type_info *ty)
+{
+ return ty->name;
}
/*
@@ -613,224 +668,264 @@ SWIG_TypeName(const swig_type_info *ty) {
that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
-SWIG_TypePrettyName(const swig_type_info *type) {
- /* The "str" field contains the equivalent pretty names of the
- type, separated by vertical-bar characters. We choose
- to print the last name, as it is often (?) the most
- specific. */
- if (!type) return NULL;
- if (type->str != NULL) {
- const char *last_name = type->str;
- const char *s;
- for (s = type->str; *s; s++)
- if (*s == '|') last_name = s+1;
- return last_name;
- }
- else
- return type->name;
-}
-
-/*
+SWIG_TypePrettyName(const swig_type_info *type)
+{
+ /* The "str" field contains the equivalent pretty names of the
+ type, separated by vertical-bar characters. We choose
+ to print the last name, as it is often (?) the most
+ specific. */
+ if (!type) {
+ return NULL;
+ }
+ if (type->str != NULL) {
+ const char *last_name = type->str;
+ const char *s;
+ for (s = type->str; *s; s++)
+ if (*s == '|') {
+ last_name = s+1;
+ }
+ return last_name;
+ }
+ else {
+ return type->name;
+ }
+}
+
+/*
Set the clientdata field for a type
*/
SWIGRUNTIME void
-SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
- swig_cast_info *cast = ti->cast;
- /* if (ti->clientdata == clientdata) return; */
- ti->clientdata = clientdata;
-
- while (cast) {
- if (!cast->converter) {
- swig_type_info *tc = cast->type;
- if (!tc->clientdata) {
- SWIG_TypeClientData(tc, clientdata);
- }
- }
- cast = cast->next;
- }
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
+{
+ swig_cast_info *cast = ti->cast;
+ /* if (ti->clientdata == clientdata) return; */
+ ti->clientdata = clientdata;
+
+ while (cast) {
+ if (!cast->converter) {
+ swig_type_info *tc = cast->type;
+ if (!tc->clientdata) {
+ SWIG_TypeClientData(tc, clientdata);
+ }
+ }
+ cast = cast->next;
+ }
}
SWIGRUNTIME void
-SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
- SWIG_TypeClientData(ti, clientdata);
- ti->owndata = 1;
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
+{
+ SWIG_TypeClientData(ti, clientdata);
+ ti->owndata = 1;
}
-
+
/*
Search for a swig_type_info structure only by mangled name
Search is a O(log #types)
-
- We start searching at module start, and finish searching when start == end.
+
+ We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
-SWIG_MangledTypeQueryModule(swig_module_info *start,
- swig_module_info *end,
- const char *name) {
- swig_module_info *iter = start;
- do {
- if (iter->size) {
- register size_t l = 0;
- register size_t r = iter->size - 1;
- do {
- /* since l+r >= 0, we can (>> 1) instead (/ 2) */
- register size_t i = (l + r) >> 1;
- const char *iname = iter->types[i]->name;
- if (iname) {
- register int compare = strcmp(name, iname);
- if (compare == 0) {
- return iter->types[i];
- } else if (compare < 0) {
- if (i) {
- r = i - 1;
- } else {
- break;
- }
- } else if (compare > 0) {
- l = i + 1;
- }
- } else {
- break; /* should never happen */
- }
- } while (l <= r);
- }
- iter = iter->next;
- } while (iter != end);
- return 0;
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name)
+{
+ swig_module_info *iter = start;
+ do {
+ if (iter->size) {
+ register size_t l = 0;
+ register size_t r = iter->size - 1;
+ do {
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+ register size_t i = (l + r) >> 1;
+ const char *iname = iter->types[i]->name;
+ if (iname) {
+ register int compare = strcmp(name, iname);
+ if (compare == 0) {
+ return iter->types[i];
+ }
+ else if (compare < 0) {
+ if (i) {
+ r = i - 1;
+ }
+ else {
+ break;
+ }
+ }
+ else if (compare > 0) {
+ l = i + 1;
+ }
+ }
+ else {
+ break; /* should never happen */
+ }
+ }
+ while (l <= r);
+ }
+ iter = iter->next;
+ }
+ while (iter != end);
+ return 0;
}
/*
Search for a swig_type_info structure for either a mangled name or a human readable name.
It first searches the mangled names of the types, which is a O(log #types)
If a type is not found it then searches the human readable names, which is O(#types).
-
- We start searching at module start, and finish searching when start == end.
+
+ We start searching at module start, and finish searching when start == end.
Note: if start == end at the beginning of the function, we go all the way around
the circular list.
*/
SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryModule(swig_module_info *start,
- swig_module_info *end,
- const char *name) {
- /* STEP 1: Search the name field using binary search */
- swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
- if (ret) {
- return ret;
- } else {
- /* STEP 2: If the type hasn't been found, do a complete search
- of the str field (the human readable name) */
- swig_module_info *iter = start;
- do {
- register size_t i = 0;
- for (; i < iter->size; ++i) {
- if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
- return iter->types[i];
- }
- iter = iter->next;
- } while (iter != end);
- }
-
- /* neither found a match */
- return 0;
+SWIG_TypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name)
+{
+ /* STEP 1: Search the name field using binary search */
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+ if (ret) {
+ return ret;
+ }
+ else {
+ /* STEP 2: If the type hasn't been found, do a complete search
+ of the str field (the human readable name) */
+ swig_module_info *iter = start;
+ do {
+ register size_t i = 0;
+ for (; i < iter->size; ++i) {
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) {
+ return iter->types[i];
+ }
+ }
+ iter = iter->next;
+ }
+ while (iter != end);
+ }
+
+ /* neither found a match */
+ return 0;
}
-/*
+/*
Pack binary data into a string
*/
SWIGRUNTIME char *
-SWIG_PackData(char *c, void *ptr, size_t sz) {
- static const char hex[17] = "0123456789abcdef";
- register const unsigned char *u = (unsigned char *) ptr;
- register const unsigned char *eu = u + sz;
- for (; u != eu; ++u) {
- register unsigned char uu = *u;
- *(c++) = hex[(uu & 0xf0) >> 4];
- *(c++) = hex[uu & 0xf];
- }
- return c;
-}
-
-/*
+SWIG_PackData(char *c, void *ptr, size_t sz)
+{
+ static const char hex[17] = "0123456789abcdef";
+ register const unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register unsigned char uu = *u;
+ *(c++) = hex[(uu & 0xf0) >> 4];
+ *(c++) = hex[uu & 0xf];
+ }
+ return c;
+}
+
+/*
Unpack binary data from a string
*/
SWIGRUNTIME const char *
-SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
- register unsigned char *u = (unsigned char *) ptr;
- register const unsigned char *eu = u + sz;
- for (; u != eu; ++u) {
- register char d = *(c++);
- register unsigned char uu;
- if ((d >= '0') && (d <= '9'))
- uu = ((d - '0') << 4);
- else if ((d >= 'a') && (d <= 'f'))
- uu = ((d - ('a'-10)) << 4);
- else
- return (char *) 0;
- d = *(c++);
- if ((d >= '0') && (d <= '9'))
- uu |= (d - '0');
- else if ((d >= 'a') && (d <= 'f'))
- uu |= (d - ('a'-10));
- else
- return (char *) 0;
- *u = uu;
- }
- return c;
-}
-
-/*
+SWIG_UnpackData(const char *c, void *ptr, size_t sz)
+{
+ register unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register char d = *(c++);
+ register unsigned char uu;
+ if ((d >= '0') && (d <= '9')) {
+ uu = ((d - '0') << 4);
+ }
+ else if ((d >= 'a') && (d <= 'f')) {
+ uu = ((d - ('a'-10)) << 4);
+ }
+ else {
+ return (char *) 0;
+ }
+ d = *(c++);
+ if ((d >= '0') && (d <= '9')) {
+ uu |= (d - '0');
+ }
+ else if ((d >= 'a') && (d <= 'f')) {
+ uu |= (d - ('a'-10));
+ }
+ else {
+ return (char *) 0;
+ }
+ *u = uu;
+ }
+ return c;
+}
+
+/*
Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
-SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
- char *r = buff;
- if ((2*sizeof(void *) + 2) > bsz) return 0;
- *(r++) = '_';
- r = SWIG_PackData(r,&ptr,sizeof(void *));
- if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
- strcpy(r,name);
- return buff;
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
+{
+ char *r = buff;
+ if ((2*sizeof(void *) + 2) > bsz) {
+ return 0;
+ }
+ *(r++) = '_';
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
+ if (strlen(name) + 1 > (bsz - (r - buff))) {
+ return 0;
+ }
+ strcpy(r,name);
+ return buff;
}
SWIGRUNTIME const char *
-SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
- if (*c != '_') {
- if (strcmp(c,"NULL") == 0) {
- *ptr = (void *) 0;
- return name;
- } else {
- return 0;
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
+{
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ *ptr = (void *) 0;
+ return name;
+ }
+ else {
+ return 0;
+ }
}
- }
- return SWIG_UnpackData(++c,ptr,sizeof(void *));
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
}
SWIGRUNTIME char *
-SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
- char *r = buff;
- size_t lname = (name ? strlen(name) : 0);
- if ((2*sz + 2 + lname) > bsz) return 0;
- *(r++) = '_';
- r = SWIG_PackData(r,ptr,sz);
- if (lname) {
- strncpy(r,name,lname+1);
- } else {
- *r = 0;
- }
- return buff;
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
+{
+ char *r = buff;
+ size_t lname = (name ? strlen(name) : 0);
+ if ((2*sz + 2 + lname) > bsz) {
+ return 0;
+ }
+ *(r++) = '_';
+ r = SWIG_PackData(r,ptr,sz);
+ if (lname) {
+ strncpy(r,name,lname+1);
+ }
+ else {
+ *r = 0;
+ }
+ return buff;
}
SWIGRUNTIME const char *
-SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
- if (*c != '_') {
- if (strcmp(c,"NULL") == 0) {
- memset(ptr,0,sz);
- return name;
- } else {
- return 0;
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
+{
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ memset(ptr,0,sz);
+ return name;
+ }
+ else {
+ return 0;
+ }
}
- }
- return SWIG_UnpackData(++c,ptr,sz);
+ return SWIG_UnpackData(++c,ptr,sz);
}
#ifdef __cplusplus
@@ -838,18 +933,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
#endif
/* Errors in SWIG */
-#define SWIG_UnknownError -1
-#define SWIG_IOError -2
-#define SWIG_RuntimeError -3
-#define SWIG_IndexError -4
-#define SWIG_TypeError -5
-#define SWIG_DivisionByZero -6
-#define SWIG_OverflowError -7
-#define SWIG_SyntaxError -8
-#define SWIG_ValueError -9
+#define SWIG_UnknownError -1
+#define SWIG_IOError -2
+#define SWIG_RuntimeError -3
+#define SWIG_IndexError -4
+#define SWIG_TypeError -5
+#define SWIG_DivisionByZero -6
+#define SWIG_OverflowError -7
+#define SWIG_SyntaxError -8
+#define SWIG_ValueError -9
#define SWIG_SystemError -10
#define SWIG_AttributeError -11
-#define SWIG_MemoryError -12
+#define SWIG_MemoryError -12
#define SWIG_NullReferenceError -13
@@ -954,7 +1049,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
* can be passed as an argument to API functions like Data_Wrap_Struct()
* and Data_Make_Struct().
*/
-
+
#ifdef __cplusplus
# ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
# define PROTECTFUNC(f) ((VALUE (*)()) f)
@@ -1016,146 +1111,146 @@ static VALUE _mSWIG = Qnil;
exceptions. Note this only works for C++ since a global cannot be
initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
-SWIGINTERN VALUE
-getNullReferenceError(void) {
- static int init = 0;
- static VALUE rb_eNullReferenceError ;
- if (!init) {
- init = 1;
- rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
- }
- return rb_eNullReferenceError;
-}
-
-SWIGINTERN VALUE
-getObjectPreviouslyDeletedError(void) {
- static int init = 0;
- static VALUE rb_eObjectPreviouslyDeleted ;
- if (!init) {
- init = 1;
- rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
- }
- return rb_eObjectPreviouslyDeleted;
-}
+SWIGINTERN VALUE
+getNullReferenceError(void)
+{
+ static int init = 0;
+ static VALUE rb_eNullReferenceError ;
+ if (!init) {
+ init = 1;
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
+ }
+ return rb_eNullReferenceError;
+}
+
+SWIGINTERN VALUE
+getObjectPreviouslyDeletedError(void)
+{
+ static int init = 0;
+ static VALUE rb_eObjectPreviouslyDeleted ;
+ if (!init) {
+ init = 1;
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
+ }
+ return rb_eObjectPreviouslyDeleted;
+}
SWIGINTERN VALUE
-SWIG_Ruby_ErrorType(int SWIG_code) {
- VALUE type;
- switch (SWIG_code) {
- case SWIG_MemoryError:
- type = rb_eNoMemError;
- break;
- case SWIG_IOError:
- type = rb_eIOError;
- break;
- case SWIG_RuntimeError:
- type = rb_eRuntimeError;
- break;
- case SWIG_IndexError:
- type = rb_eIndexError;
- break;
- case SWIG_TypeError:
- type = rb_eTypeError;
- break;
- case SWIG_DivisionByZero:
- type = rb_eZeroDivError;
- break;
- case SWIG_OverflowError:
- type = rb_eRangeError;
- break;
- case SWIG_SyntaxError:
- type = rb_eSyntaxError;
- break;
- case SWIG_ValueError:
- type = rb_eArgError;
- break;
- case SWIG_SystemError:
- type = rb_eFatal;
- break;
- case SWIG_AttributeError:
- type = rb_eRuntimeError;
- break;
- case SWIG_NullReferenceError:
- type = getNullReferenceError();
- break;
- case SWIG_ObjectPreviouslyDeletedError:
- type = getObjectPreviouslyDeletedError();
- break;
- case SWIG_UnknownError:
- type = rb_eRuntimeError;
- break;
- default:
- type = rb_eRuntimeError;
- }
- return type;
+SWIG_Ruby_ErrorType(int SWIG_code)
+{
+ VALUE type;
+ switch (SWIG_code) {
+ case SWIG_MemoryError:
+ type = rb_eNoMemError;
+ break;
+ case SWIG_IOError:
+ type = rb_eIOError;
+ break;
+ case SWIG_RuntimeError:
+ type = rb_eRuntimeError;
+ break;
+ case SWIG_IndexError:
+ type = rb_eIndexError;
+ break;
+ case SWIG_TypeError:
+ type = rb_eTypeError;
+ break;
+ case SWIG_DivisionByZero:
+ type = rb_eZeroDivError;
+ break;
+ case SWIG_OverflowError:
+ type = rb_eRangeError;
+ break;
+ case SWIG_SyntaxError:
+ type = rb_eSyntaxError;
+ break;
+ case SWIG_ValueError:
+ type = rb_eArgError;
+ break;
+ case SWIG_SystemError:
+ type = rb_eFatal;
+ break;
+ case SWIG_AttributeError:
+ type = rb_eRuntimeError;
+ break;
+ case SWIG_NullReferenceError:
+ type = getNullReferenceError();
+ break;
+ case SWIG_ObjectPreviouslyDeletedError:
+ type = getObjectPreviouslyDeletedError();
+ break;
+ case SWIG_UnknownError:
+ type = rb_eRuntimeError;
+ break;
+ default:
+ type = rb_eRuntimeError;
+ }
+ return type;
}
/* This function is called when a user inputs a wrong argument to
a method.
*/
-SWIGINTERN
+SWIGINTERN
const char* Ruby_Format_TypeError( const char* msg,
- const char* type,
- const char* name,
- const int argn,
- VALUE input )
-{
- char buf[128];
- VALUE str;
- VALUE asStr;
- if ( msg && *msg )
- {
- str = rb_str_new2(msg);
+ const char* type,
+ const char* name,
+ const int argn,
+ VALUE input )
+{
+ char buf[128];
+ VALUE str;
+ VALUE asStr;
+ if ( msg && *msg ) {
+ str = rb_str_new2(msg);
}
- else
- {
- str = rb_str_new(NULL, 0);
- }
-
- str = rb_str_cat2( str, "Expected argument " );
- sprintf( buf, "%d of type ", argn-1 );
- str = rb_str_cat2( str, buf );
- str = rb_str_cat2( str, type );
- str = rb_str_cat2( str, ", but got " );
- str = rb_str_cat2( str, rb_obj_classname(input) );
- str = rb_str_cat2( str, " " );
- asStr = rb_inspect(input);
- if ( RSTRING_LEN(asStr) > 30 )
- {
- str = rb_str_cat( str, StringValuePtr(asStr), 30 );
- str = rb_str_cat2( str, "..." );
+ else {
+ str = rb_str_new(NULL, 0);
}
- else
- {
- str = rb_str_append( str, asStr );
+
+ str = rb_str_cat2( str, "Expected argument " );
+ sprintf( buf, "%d of type ", argn-1 );
+ str = rb_str_cat2( str, buf );
+ str = rb_str_cat2( str, type );
+ str = rb_str_cat2( str, ", but got " );
+ str = rb_str_cat2( str, rb_obj_classname(input) );
+ str = rb_str_cat2( str, " " );
+ asStr = rb_inspect(input);
+ if ( RSTRING_LEN(asStr) > 30 ) {
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
+ str = rb_str_cat2( str, "..." );
+ }
+ else {
+ str = rb_str_append( str, asStr );
}
- if ( name )
- {
- str = rb_str_cat2( str, "\n\tin SWIG method '" );
- str = rb_str_cat2( str, name );
- str = rb_str_cat2( str, "'" );
+ if ( name ) {
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
+ str = rb_str_cat2( str, name );
+ str = rb_str_cat2( str, "'" );
}
- return StringValuePtr( str );
+ return StringValuePtr( str );
}
/* This function is called when an overloaded method fails */
-SWIGINTERN
+SWIGINTERN
void Ruby_Format_OverloadedError(
- const int argc,
- const int maxargs,
- const char* method,
- const char* prototypes
- )
+ const int argc,
+ const int maxargs,
+ const char* method,
+ const char* prototypes
+)
{
- const char* msg = "Wrong # of arguments";
- if ( argc <= maxargs ) msg = "Wrong arguments";
- rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
- "Possible C/C++ prototypes are:\n%s",
- msg, method, prototypes);
+ const char* msg = "Wrong # of arguments";
+ if ( argc <= maxargs ) {
+ msg = "Wrong arguments";
+ }
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
+ "Possible C/C++ prototypes are:\n%s",
+ msg, method, prototypes);
}
/* -----------------------------------------------------------------------------
@@ -1164,7 +1259,7 @@ void Ruby_Format_OverloadedError(
*
* rubytracking.swg
*
- * This file contains support for tracking mappings from
+ * This file contains support for tracking mappings from
* Ruby objects to C++ objects. This functionality is needed
* to implement mark functions for Ruby's mark and sweep
* garbage collector.
@@ -1187,7 +1282,7 @@ extern "C" {
/* Global Ruby hash table to store Trackings from C/C++
- structs to Ruby Objects.
+ structs to Ruby Objects.
*/
static VALUE swig_ruby_trackings = Qnil;
@@ -1196,122 +1291,129 @@ static VALUE swig_ruby_trackings = Qnil;
static ID swig_ruby_hash_delete;
/* Setup a Ruby hash table to store Trackings */
-SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
- /* Create a ruby hash table to store Trackings from C++
- objects to Ruby objects. */
-
- /* Try to see if some other .so has already created a
- tracking hash table, which we keep hidden in an instance var
- in the SWIG module.
- This is done to allow multiple DSOs to share the same
- tracking table.
- */
- ID trackings_id = rb_intern( "@__trackings__" );
- VALUE verbose = rb_gv_get("VERBOSE");
- rb_gv_set("VERBOSE", Qfalse);
- swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
- rb_gv_set("VERBOSE", verbose);
-
- /* No, it hasn't. Create one ourselves */
- if ( swig_ruby_trackings == Qnil )
- {
- swig_ruby_trackings = rb_hash_new();
- rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
+SWIGRUNTIME void SWIG_RubyInitializeTrackings(void)
+{
+ /* Create a ruby hash table to store Trackings from C++
+ objects to Ruby objects. */
+
+ /* Try to see if some other .so has already created a
+ tracking hash table, which we keep hidden in an instance var
+ in the SWIG module.
+ This is done to allow multiple DSOs to share the same
+ tracking table.
+ */
+ ID trackings_id = rb_intern( "@__trackings__" );
+ VALUE verbose = rb_gv_get("VERBOSE");
+ rb_gv_set("VERBOSE", Qfalse);
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
+ rb_gv_set("VERBOSE", verbose);
+
+ /* No, it hasn't. Create one ourselves */
+ if ( swig_ruby_trackings == Qnil ) {
+ swig_ruby_trackings = rb_hash_new();
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
}
- /* Now store a reference to the hash table delete function
- so that we only have to look it up once.*/
- swig_ruby_hash_delete = rb_intern("delete");
+ /* Now store a reference to the hash table delete function
+ so that we only have to look it up once.*/
+ swig_ruby_hash_delete = rb_intern("delete");
}
/* Get a Ruby number to reference a pointer */
-SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
- /* We cast the pointer to an unsigned long
- and then store a reference to it using
- a Ruby number object. */
+SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr)
+{
+ /* We cast the pointer to an unsigned long
+ and then store a reference to it using
+ a Ruby number object. */
- /* Convert the pointer to a Ruby number */
- return SWIG2NUM(ptr);
+ /* Convert the pointer to a Ruby number */
+ return SWIG2NUM(ptr);
}
/* Get a Ruby number to reference an object */
-SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
- /* We cast the object to an unsigned long
- and then store a reference to it using
- a Ruby number object. */
+SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object)
+{
+ /* We cast the object to an unsigned long
+ and then store a reference to it using
+ a Ruby number object. */
- /* Convert the Object to a Ruby number */
- return SWIG2NUM(object);
+ /* Convert the Object to a Ruby number */
+ return SWIG2NUM(object);
}
/* Get a Ruby object from a previously stored reference */
-SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
- /* The provided Ruby number object is a reference
- to the Ruby object we want.*/
+SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference)
+{
+ /* The provided Ruby number object is a reference
+ to the Ruby object we want.*/
- /* Convert the Ruby number to a Ruby object */
- return NUM2SWIG(reference);
+ /* Convert the Ruby number to a Ruby object */
+ return NUM2SWIG(reference);
}
/* Add a Tracking from a C/C++ struct to a Ruby object */
-SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
- /* In a Ruby hash table we store the pointer and
- the associated Ruby object. The trick here is
- that we cannot store the Ruby object directly - if
- we do then it cannot be garbage collected. So
- instead we typecast it as a unsigned long and
- convert it to a Ruby number object.*/
+SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object)
+{
+ /* In a Ruby hash table we store the pointer and
+ the associated Ruby object. The trick here is
+ that we cannot store the Ruby object directly - if
+ we do then it cannot be garbage collected. So
+ instead we typecast it as a unsigned long and
+ convert it to a Ruby number object.*/
- /* Get a reference to the pointer as a Ruby number */
- VALUE key = SWIG_RubyPtrToReference(ptr);
+ /* Get a reference to the pointer as a Ruby number */
+ VALUE key = SWIG_RubyPtrToReference(ptr);
- /* Get a reference to the Ruby object as a Ruby number */
- VALUE value = SWIG_RubyObjectToReference(object);
+ /* Get a reference to the Ruby object as a Ruby number */
+ VALUE value = SWIG_RubyObjectToReference(object);
- /* Store the mapping to the global hash table. */
- rb_hash_aset(swig_ruby_trackings, key, value);
+ /* Store the mapping to the global hash table. */
+ rb_hash_aset(swig_ruby_trackings, key, value);
}
/* Get the Ruby object that owns the specified C/C++ struct */
-SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
- /* Get a reference to the pointer as a Ruby number */
- VALUE key = SWIG_RubyPtrToReference(ptr);
-
- /* Now lookup the value stored in the global hash table */
- VALUE value = rb_hash_aref(swig_ruby_trackings, key);
-
- if (value == Qnil) {
- /* No object exists - return nil. */
- return Qnil;
- }
- else {
- /* Convert this value to Ruby object */
- return SWIG_RubyReferenceToObject(value);
- }
+SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr)
+{
+ /* Get a reference to the pointer as a Ruby number */
+ VALUE key = SWIG_RubyPtrToReference(ptr);
+
+ /* Now lookup the value stored in the global hash table */
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
+
+ if (value == Qnil) {
+ /* No object exists - return nil. */
+ return Qnil;
+ }
+ else {
+ /* Convert this value to Ruby object */
+ return SWIG_RubyReferenceToObject(value);
+ }
}
/* Remove a Tracking from a C/C++ struct to a Ruby object. It
is very important to remove objects once they are destroyed
since the same memory address may be reused later to create
a new object. */
-SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
- /* Get a reference to the pointer as a Ruby number */
- VALUE key = SWIG_RubyPtrToReference(ptr);
+SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr)
+{
+ /* Get a reference to the pointer as a Ruby number */
+ VALUE key = SWIG_RubyPtrToReference(ptr);
- /* Delete the object from the hash table by calling Ruby's
- do this we need to call the Hash.delete method.*/
- rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
+ /* Delete the object from the hash table by calling Ruby's
+ do this we need to call the Hash.delete method.*/
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
}
/* This is a helper method that unlinks a Ruby object from its
underlying C++ object. This is needed if the lifetime of the
Ruby object is longer than the C++ object */
-SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
- VALUE object = SWIG_RubyInstanceFor(ptr);
+SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr)
+{
+ VALUE object = SWIG_RubyInstanceFor(ptr);
- if (object != Qnil) {
- DATA_PTR(object) = 0;
- }
+ if (object != Qnil) {
+ DATA_PTR(object) = 0;
+ }
}
@@ -1328,23 +1430,25 @@ extern "C" {
#endif
SWIGINTERN VALUE
-SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
- if (NIL_P(target)) {
- target = o;
- } else {
- if (TYPE(target) != T_ARRAY) {
- VALUE o2 = target;
- target = rb_ary_new();
- rb_ary_push(target, o2);
+SWIG_Ruby_AppendOutput(VALUE target, VALUE o)
+{
+ if (NIL_P(target)) {
+ target = o;
}
- rb_ary_push(target, o);
- }
- return target;
+ else {
+ if (TYPE(target) != T_ARRAY) {
+ VALUE o2 = target;
+ target = rb_ary_new();
+ rb_ary_push(target, o2);
+ }
+ rb_ary_push(target, o);
+ }
+ return target;
}
/* For ruby1.8.4 and earlier. */
#ifndef RUBY_INIT_STACK
- RUBY_EXTERN void Init_stack(VALUE* addr);
+RUBY_EXTERN void Init_stack(VALUE* addr);
# define RUBY_INIT_STACK \
VALUE variable_in_this_stack_frame; \
Init_stack(&variable_in_this_stack_frame);
@@ -1396,24 +1500,24 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
/* Runtime API */
-#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
+#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
#define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
/* Error manipulation */
-#define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
+#define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
#define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
-#define SWIG_fail goto fail
+#define SWIG_fail goto fail
/* Ruby-specific SWIG API */
-#define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
+#define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
#define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
#define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
-#define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
-#define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
+#define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
+#define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
#include "assert.h"
@@ -1426,11 +1530,11 @@ extern "C" {
#endif
typedef struct {
- VALUE klass;
- VALUE mImpl;
- void (*mark)(void *);
- void (*destroy)(void *);
- int trackObjects;
+ VALUE klass;
+ VALUE mImpl;
+ void (*mark)(void *);
+ void (*destroy)(void *);
+ int trackObjects;
} swig_class;
@@ -1444,9 +1548,9 @@ static ID swig_call_id = 0;
/*
If your swig extension is to be run within an embedded ruby and has
- director callbacks, you should set -DRUBY_EMBEDDED during compilation.
- This will reset ruby's stack frame on each entry point from the main
- program the first time a virtual director function is invoked (in a
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
+ This will reset ruby's stack frame on each entry point from the main
+ program the first time a virtual director function is invoked (in a
non-recursive way).
If this is not done, you run the risk of Ruby trashing the stack.
*/
@@ -1460,7 +1564,7 @@ static ID swig_call_id = 0;
# define Ruby_DirectorTypeMismatchException(x) \
rb_raise( rb_eTypeError, x ); return c_result;
- static unsigned int swig_virtual_calls = 0;
+static unsigned int swig_virtual_calls = 0;
#else /* normal non-embedded extension */
@@ -1472,294 +1576,319 @@ static ID swig_call_id = 0;
#endif /* RUBY_EMBEDDED */
-SWIGRUNTIME VALUE
-getExceptionClass(void) {
- static int init = 0;
- static VALUE rubyExceptionClass ;
- if (!init) {
- init = 1;
- rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
- }
- return rubyExceptionClass;
-}
+SWIGRUNTIME VALUE
+getExceptionClass(void)
+{
+ static int init = 0;
+ static VALUE rubyExceptionClass ;
+ if (!init) {
+ init = 1;
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
+ }
+ return rubyExceptionClass;
+}
/* This code checks to see if the Ruby object being raised as part
of an exception inherits from the Ruby class Exception. If so,
the object is simply returned. If not, then a new Ruby exception
object is created and that will be returned to Ruby.*/
SWIGRUNTIME VALUE
-SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
- VALUE exceptionClass = getExceptionClass();
- if (rb_obj_is_kind_of(obj, exceptionClass)) {
- return obj;
- } else {
- return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
- }
+SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj)
+{
+ VALUE exceptionClass = getExceptionClass();
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
+ return obj;
+ }
+ else {
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
+ }
}
/* Initialize Ruby runtime support */
SWIGRUNTIME void
SWIG_Ruby_InitRuntime(void)
{
- if (_mSWIG == Qnil) {
- _mSWIG = rb_define_module("SWIG");
- swig_call_id = rb_intern("call");
- swig_arity_id = rb_intern("arity");
- }
+ if (_mSWIG == Qnil) {
+ _mSWIG = rb_define_module("SWIG");
+ swig_call_id = rb_intern("call");
+ swig_arity_id = rb_intern("arity");
+ }
}
/* Define Ruby class for C type */
SWIGRUNTIME void
SWIG_Ruby_define_class(swig_type_info *type)
{
- VALUE klass;
- char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
- sprintf(klass_name, "TYPE%s", type->name);
- if (NIL_P(_cSWIG_Pointer)) {
- _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
- rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
- }
- klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
- free((void *) klass_name);
+ VALUE klass;
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
+ sprintf(klass_name, "TYPE%s", type->name);
+ if (NIL_P(_cSWIG_Pointer)) {
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
+ }
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
+ free((void *) klass_name);
}
/* Create a new pointer object */
SWIGRUNTIME VALUE
SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
{
- int own = flags & SWIG_POINTER_OWN;
- int track;
- char *klass_name;
- swig_class *sklass;
- VALUE klass;
- VALUE obj;
-
- if (!ptr)
- return Qnil;
-
- if (type->clientdata) {
- sklass = (swig_class *) type->clientdata;
-
- /* Are we tracking this class and have we already returned this Ruby object? */
- track = sklass->trackObjects;
- if (track) {
- obj = SWIG_RubyInstanceFor(ptr);
-
- /* Check the object's type and make sure it has the correct type.
- It might not in cases where methods do things like
- downcast methods. */
- if (obj != Qnil) {
- VALUE value = rb_iv_get(obj, "@__swigtype__");
- char* type_name = RSTRING_PTR(value);
-
- if (strcmp(type->name, type_name) == 0) {
- return obj;
- }
- }
+ int own = flags & SWIG_POINTER_OWN;
+ int track;
+ char *klass_name;
+ swig_class *sklass;
+ VALUE klass;
+ VALUE obj;
+
+ if (!ptr) {
+ return Qnil;
}
- /* Create a new Ruby object */
- obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
- ( own ? VOIDFUNC(sklass->destroy) :
- (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
- ), ptr);
+ if (type->clientdata) {
+ sklass = (swig_class *) type->clientdata;
+
+ /* Are we tracking this class and have we already returned this Ruby object? */
+ track = sklass->trackObjects;
+ if (track) {
+ obj = SWIG_RubyInstanceFor(ptr);
+
+ /* Check the object's type and make sure it has the correct type.
+ It might not in cases where methods do things like
+ downcast methods. */
+ if (obj != Qnil) {
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
+ char* type_name = RSTRING_PTR(value);
+
+ if (strcmp(type->name, type_name) == 0) {
+ return obj;
+ }
+ }
+ }
+
+ /* Create a new Ruby object */
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
+ ( own ? VOIDFUNC(sklass->destroy) :
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
+ ), ptr);
- /* If tracking is on for this class then track this object. */
- if (track) {
- SWIG_RubyAddTracking(ptr, obj);
+ /* If tracking is on for this class then track this object. */
+ if (track) {
+ SWIG_RubyAddTracking(ptr, obj);
+ }
}
- } else {
- klass_name = (char *) malloc(4 + strlen(type->name) + 1);
- sprintf(klass_name, "TYPE%s", type->name);
- klass = rb_const_get(_mSWIG, rb_intern(klass_name));
- free((void *) klass_name);
- obj = Data_Wrap_Struct(klass, 0, 0, ptr);
- }
- rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
-
- return obj;
+ else {
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
+ sprintf(klass_name, "TYPE%s", type->name);
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
+ free((void *) klass_name);
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
+ }
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
+
+ return obj;
}
/* Create a new class instance (always owned) */
SWIGRUNTIME VALUE
SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
{
- VALUE obj;
- swig_class *sklass = (swig_class *) type->clientdata;
- obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
- rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
- return obj;
+ VALUE obj;
+ swig_class *sklass = (swig_class *) type->clientdata;
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
+ return obj;
}
/* Get type mangle from class name */
SWIGRUNTIMEINLINE char *
SWIG_Ruby_MangleStr(VALUE obj)
{
- VALUE stype = rb_iv_get(obj, "@__swigtype__");
- return StringValuePtr(stype);
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
+ return StringValuePtr(stype);
}
/* Acquire a pointer value */
typedef void (*ruby_owntype)(void*);
SWIGRUNTIME ruby_owntype
-SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
- if (obj) {
- ruby_owntype oldown = RDATA(obj)->dfree;
- RDATA(obj)->dfree = own;
- return oldown;
- } else {
- return 0;
- }
+SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own)
+{
+ if (obj) {
+ ruby_owntype oldown = RDATA(obj)->dfree;
+ RDATA(obj)->dfree = own;
+ return oldown;
+ }
+ else {
+ return 0;
+ }
}
/* Convert a pointer value */
SWIGRUNTIME int
SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
{
- char *c;
- swig_cast_info *tc;
- void *vptr = 0;
+ char *c;
+ swig_cast_info *tc;
+ void *vptr = 0;
- /* Grab the pointer */
- if (NIL_P(obj)) {
- *ptr = 0;
- return SWIG_OK;
- } else {
- if (TYPE(obj) != T_DATA) {
- return SWIG_ERROR;
- }
- Data_Get_Struct(obj, void, vptr);
- }
-
- if (own) *own = RDATA(obj)->dfree;
-
- /* Check to see if the input object is giving up ownership
- of the underlying C struct or C++ object. If so then we
- need to reset the destructor since the Ruby object no
- longer owns the underlying C++ object.*/
- if (flags & SWIG_POINTER_DISOWN) {
- /* Is tracking on for this class? */
- int track = 0;
- if (ty && ty->clientdata) {
- swig_class *sklass = (swig_class *) ty->clientdata;
- track = sklass->trackObjects;
- }
-
- if (track) {
- /* We are tracking objects for this class. Thus we change the destructor
- * to SWIG_RubyRemoveTracking. This allows us to
- * remove the mapping from the C++ to Ruby object
- * when the Ruby object is garbage collected. If we don't
- * do this, then it is possible we will return a reference
- * to a Ruby object that no longer exists thereby crashing Ruby. */
- RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
- } else {
- RDATA(obj)->dfree = 0;
- }
- }
-
- /* Do type-checking if type info was provided */
- if (ty) {
- if (ty->clientdata) {
- if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
- if (vptr == 0) {
- /* The object has already been deleted */
- return SWIG_ObjectPreviouslyDeletedError;
- }
- *ptr = vptr;
+ /* Grab the pointer */
+ if (NIL_P(obj)) {
+ *ptr = 0;
return SWIG_OK;
- }
}
- if ((c = SWIG_MangleStr(obj)) == NULL) {
- return SWIG_ERROR;
+ else {
+ if (TYPE(obj) != T_DATA) {
+ return SWIG_ERROR;
+ }
+ Data_Get_Struct(obj, void, vptr);
}
- tc = SWIG_TypeCheck(c, ty);
- if (!tc) {
- return SWIG_ERROR;
- } else {
- int newmemory = 0;
- *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
- assert(!newmemory); /* newmemory handling not yet implemented */
+
+ if (own) {
+ *own = RDATA(obj)->dfree;
+ }
+
+ /* Check to see if the input object is giving up ownership
+ of the underlying C struct or C++ object. If so then we
+ need to reset the destructor since the Ruby object no
+ longer owns the underlying C++ object.*/
+ if (flags & SWIG_POINTER_DISOWN) {
+ /* Is tracking on for this class? */
+ int track = 0;
+ if (ty && ty->clientdata) {
+ swig_class *sklass = (swig_class *) ty->clientdata;
+ track = sklass->trackObjects;
+ }
+
+ if (track) {
+ /* We are tracking objects for this class. Thus we change the destructor
+ * to SWIG_RubyRemoveTracking. This allows us to
+ * remove the mapping from the C++ to Ruby object
+ * when the Ruby object is garbage collected. If we don't
+ * do this, then it is possible we will return a reference
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
+ }
+ else {
+ RDATA(obj)->dfree = 0;
+ }
+ }
+
+ /* Do type-checking if type info was provided */
+ if (ty) {
+ if (ty->clientdata) {
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
+ if (vptr == 0) {
+ /* The object has already been deleted */
+ return SWIG_ObjectPreviouslyDeletedError;
+ }
+ *ptr = vptr;
+ return SWIG_OK;
+ }
+ }
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
+ return SWIG_ERROR;
+ }
+ tc = SWIG_TypeCheck(c, ty);
+ if (!tc) {
+ return SWIG_ERROR;
+ }
+ else {
+ int newmemory = 0;
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
+ assert(!newmemory); /* newmemory handling not yet implemented */
+ }
}
- } else {
- *ptr = vptr;
- }
-
- return SWIG_OK;
+ else {
+ *ptr = vptr;
+ }
+
+ return SWIG_OK;
}
/* Check convert */
SWIGRUNTIMEINLINE int
SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
{
- char *c = SWIG_MangleStr(obj);
- if (!c) return 0;
- return SWIG_TypeCheck(c,ty) != 0;
+ char *c = SWIG_MangleStr(obj);
+ if (!c) {
+ return 0;
+ }
+ return SWIG_TypeCheck(c,ty) != 0;
}
SWIGRUNTIME VALUE
-SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
- char result[1024];
- char *r = result;
- if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
- *(r++) = '_';
- r = SWIG_PackData(r, ptr, sz);
- strcpy(r, type->name);
- return rb_str_new2(result);
+SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type)
+{
+ char result[1024];
+ char *r = result;
+ if ((2*sz + 1 + strlen(type->name)) > 1000) {
+ return 0;
+ }
+ *(r++) = '_';
+ r = SWIG_PackData(r, ptr, sz);
+ strcpy(r, type->name);
+ return rb_str_new2(result);
}
/* Convert a packed value value */
SWIGRUNTIME int
-SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
- swig_cast_info *tc;
- const char *c;
-
- if (TYPE(obj) != T_STRING) goto type_error;
- c = StringValuePtr(obj);
- /* Pointer values must start with leading underscore */
- if (*c != '_') goto type_error;
- c++;
- c = SWIG_UnpackData(c, ptr, sz);
- if (ty) {
- tc = SWIG_TypeCheck(c, ty);
- if (!tc) goto type_error;
- }
- return SWIG_OK;
-
- type_error:
- return SWIG_ERROR;
+SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty)
+{
+ swig_cast_info *tc;
+ const char *c;
+
+ if (TYPE(obj) != T_STRING) {
+ goto type_error;
+ }
+ c = StringValuePtr(obj);
+ /* Pointer values must start with leading underscore */
+ if (*c != '_') {
+ goto type_error;
+ }
+ c++;
+ c = SWIG_UnpackData(c, ptr, sz);
+ if (ty) {
+ tc = SWIG_TypeCheck(c, ty);
+ if (!tc) {
+ goto type_error;
+ }
+ }
+ return SWIG_OK;
+
+type_error:
+ return SWIG_ERROR;
}
SWIGRUNTIME swig_module_info *
SWIG_Ruby_GetModule(void)
{
- VALUE pointer;
- swig_module_info *ret = 0;
- VALUE verbose = rb_gv_get("VERBOSE");
+ VALUE pointer;
+ swig_module_info *ret = 0;
+ VALUE verbose = rb_gv_get("VERBOSE");
- /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
- rb_gv_set("VERBOSE", Qfalse);
-
- /* first check if pointer already created */
- pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
- if (pointer != Qnil) {
- Data_Get_Struct(pointer, swig_module_info, ret);
- }
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
+ rb_gv_set("VERBOSE", Qfalse);
- /* reinstate warnings */
- rb_gv_set("VERBOSE", verbose);
- return ret;
+ /* first check if pointer already created */
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
+ if (pointer != Qnil) {
+ Data_Get_Struct(pointer, swig_module_info, ret);
+ }
+
+ /* reinstate warnings */
+ rb_gv_set("VERBOSE", verbose);
+ return ret;
}
-SWIGRUNTIME void
+SWIGRUNTIME void
SWIG_Ruby_SetModule(swig_module_info *pointer)
{
- /* register a new class */
- VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
- /* create and store the structure pointer to a global variable */
- swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
- rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
+ /* register a new class */
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
+ /* create and store the structure pointer to a global variable */
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
}
/* This function can be used to check whether a proc or method or similarly
@@ -1772,9 +1901,10 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
SWIGINTERN
int SWIG_Ruby_isCallable( VALUE proc )
{
- if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
- return 1;
- return 0;
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue ) {
+ return 1;
+ }
+ return 0;
}
/* This function can be used to check the arity (number of arguments)
@@ -1785,15 +1915,18 @@ int SWIG_Ruby_isCallable( VALUE proc )
SWIGINTERN
int SWIG_Ruby_arity( VALUE proc, int minimal )
{
- if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
- {
- VALUE num = rb_funcall( proc, swig_arity_id, 0 );
- int arity = NUM2INT(num);
- if ( arity < 0 && (arity+1) < -minimal ) return 1;
- if ( arity == minimal ) return 1;
- return 1;
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue ) {
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
+ int arity = NUM2INT(num);
+ if ( arity < 0 && (arity+1) < -minimal ) {
+ return 1;
+ }
+ if ( arity == minimal ) {
+ return 1;
+ }
+ return 1;
}
- return 0;
+ return 0;
}
@@ -1803,9 +1936,9 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
-#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
-#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
/* -----------------------------------------------------------------------------
@@ -1834,245 +1967,226 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
#include <iostream>
#include <map>
-namespace Swig {
- /* memory handler */
- struct GCItem
- {
- virtual ~GCItem()
- {
+namespace Swig
+{
+/* memory handler */
+struct GCItem {
+ virtual ~GCItem() {
}
- virtual ruby_owntype get_own() const
- {
- return 0;
+ virtual ruby_owntype get_own() const {
+ return 0;
}
- };
-
- struct GCItem_var
- {
- GCItem_var(GCItem *item = 0) : _item(item)
- {
+};
+
+struct GCItem_var {
+ GCItem_var(GCItem *item = 0) : _item(item) {
}
- GCItem_var& operator=(GCItem *item)
- {
- GCItem *tmp = _item;
- _item = item;
- delete tmp;
- return *this;
+ GCItem_var& operator=(GCItem *item) {
+ GCItem *tmp = _item;
+ _item = item;
+ delete tmp;
+ return *this;
}
-
- ~GCItem_var()
- {
- delete _item;
+
+ ~GCItem_var() {
+ delete _item;
}
-
- GCItem * operator->() const
- {
- return _item;
+
+ GCItem * operator->() const {
+ return _item;
}
-
- private:
+
+private:
GCItem *_item;
- };
+};
- template <typename Type>
- struct GCItem_T : GCItem
- {
- GCItem_T(Type *ptr) : _ptr(ptr)
- {
+template <typename Type>
+struct GCItem_T : GCItem {
+ GCItem_T(Type *ptr) : _ptr(ptr) {
}
-
- virtual ~GCItem_T()
- {
- delete _ptr;
+
+ virtual ~GCItem_T() {
+ delete _ptr;
}
-
- private:
+
+private:
Type *_ptr;
- };
+};
- struct GCItem_Object : GCItem
- {
- GCItem_Object(ruby_owntype own) : _own(own)
- {
+struct GCItem_Object : GCItem {
+ GCItem_Object(ruby_owntype own) : _own(own) {
}
-
- virtual ~GCItem_Object()
- {
+
+ virtual ~GCItem_Object() {
}
- ruby_owntype get_own() const
- {
- return _own;
+ ruby_owntype get_own() const {
+ return _own;
}
-
- private:
+
+private:
ruby_owntype _own;
- };
+};
- template <typename Type>
- struct GCArray_T : GCItem
- {
- GCArray_T(Type *ptr) : _ptr(ptr)
- {
+template <typename Type>
+struct GCArray_T : GCItem {
+ GCArray_T(Type *ptr) : _ptr(ptr) {
}
-
- virtual ~GCArray_T()
- {
- delete[] _ptr;
+
+ virtual ~GCArray_T() {
+ delete[] _ptr;
}
-
- private:
+
+private:
Type *_ptr;
- };
+};
- /* body args */
- struct body_args {
+/* body args */
+struct body_args {
VALUE recv;
ID id;
int argc;
VALUE *argv;
- };
-
- /* Base class for director exceptions */
- class DirectorException {
- protected:
+};
+
+/* Base class for director exceptions */
+class DirectorException
+{
+protected:
VALUE swig_error;
std::string swig_msg;
- protected:
+protected:
DirectorException(VALUE error)
- : swig_error(error)
- {
+ : swig_error(error) {
}
-
- DirectorException(VALUE error, const char* hdr, const char* msg ="")
- : swig_error(error), swig_msg(hdr) {
- if (strlen(msg)) {
- swig_msg += " ";
- swig_msg += msg;
- }
- if (swig_msg.size()) {
- VALUE str = rb_str_new(swig_msg.data(), swig_msg.size());
- swig_error = rb_exc_new3(error, str);
- } else {
- swig_error = error;
- }
+
+ DirectorException(VALUE error, const char* hdr, const char* msg ="")
+ : swig_error(error), swig_msg(hdr) {
+ if (strlen(msg)) {
+ swig_msg += " ";
+ swig_msg += msg;
+ }
+ if (swig_msg.size()) {
+ VALUE str = rb_str_new(swig_msg.data(), swig_msg.size());
+ swig_error = rb_exc_new3(error, str);
+ }
+ else {
+ swig_error = error;
+ }
}
- public:
- VALUE getType() const {
- return CLASS_OF(swig_error);
+public:
+ VALUE getType() const {
+ return CLASS_OF(swig_error);
}
VALUE getError() const {
- return swig_error;
+ return swig_error;
}
- const std::string& getMessage() const
- {
- return swig_msg;
+ const std::string& getMessage() const {
+ return swig_msg;
}
-
+
virtual ~DirectorException() {}
- };
-
- /* unknown exception handler */
+};
- class UnknownExceptionHandler
- {
+/* unknown exception handler */
+
+class UnknownExceptionHandler
+{
#ifdef SWIG_DIRECTOR_UEH
static void handler() {
- try {
- throw;
- } catch (DirectorException& e) {
- std::cerr << "Swig Director exception caught:" << std::endl
- << e.getMessage() << std::endl;
- } catch (std::exception& e) {
- std::cerr << "std::exception caught: "<< e.what() << std::endl;
- } catch (...) {
- std::cerr << "Unknown exception caught." << std::endl;
- }
- std::cerr << std::endl
- << "Ruby interpreter traceback:" << std::endl;
- std::cerr << std::endl;
- std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
- << "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
- << std::endl
- << "Exception is being re-thrown, program will like abort/terminate." << std::endl;
- throw;
- }
-
- public:
+ try {
+ throw;
+ }
+ catch (DirectorException& e) {
+ std::cerr << "Swig Director exception caught:" << std::endl
+ << e.getMessage() << std::endl;
+ }
+ catch (std::exception& e) {
+ std::cerr << "std::exception caught: "<< e.what() << std::endl;
+ }
+ catch (...) {
+ std::cerr << "Unknown exception caught." << std::endl;
+ }
+ std::cerr << std::endl
+ << "Ruby interpreter traceback:" << std::endl;
+ std::cerr << std::endl;
+ std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
+ << "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
+ << std::endl
+ << "Exception is being re-thrown, program will like abort/terminate." << std::endl;
+ throw;
+ }
+
+public:
std::unexpected_handler old;
- UnknownExceptionHandler(std::unexpected_handler nh = handler)
- {
- old = std::set_unexpected(nh);
+ UnknownExceptionHandler(std::unexpected_handler nh = handler) {
+ old = std::set_unexpected(nh);
}
- ~UnknownExceptionHandler()
- {
- std::set_unexpected(old);
+ ~UnknownExceptionHandler() {
+ std::set_unexpected(old);
}
#endif
- };
+};
- /* Type mismatch in the return value from a Ruby method call */
- class DirectorTypeMismatchException : public Swig::DirectorException {
- public:
+/* Type mismatch in the return value from a Ruby method call */
+class DirectorTypeMismatchException : public Swig::DirectorException
+{
+public:
DirectorTypeMismatchException(VALUE error, const char *msg="")
- : Swig::DirectorException(error, "Swig director type mismatch", msg)
- {
+ : Swig::DirectorException(error, "Swig director type mismatch", msg) {
}
DirectorTypeMismatchException(const char *msg="")
- : Swig::DirectorException(rb_eTypeError, "Swig director type mismatch", msg)
- {
+ : Swig::DirectorException(rb_eTypeError, "Swig director type mismatch", msg) {
}
static void raise(VALUE error, const char *msg) {
- throw DirectorTypeMismatchException(error, msg);
+ throw DirectorTypeMismatchException(error, msg);
}
static void raise(const char *msg) {
- throw DirectorTypeMismatchException(msg);
+ throw DirectorTypeMismatchException(msg);
}
- };
+};
- /* Any Ruby exception that occurs during a director method call */
- class DirectorMethodException : public Swig::DirectorException {
- public:
- DirectorMethodException(VALUE error)
- : Swig::DirectorException(error) {
+/* Any Ruby exception that occurs during a director method call */
+class DirectorMethodException : public Swig::DirectorException
+{
+public:
+ DirectorMethodException(VALUE error)
+ : Swig::DirectorException(error) {
}
- DirectorMethodException(const char* msg = "")
- : Swig::DirectorException(rb_eRuntimeError, "Swig director method error.", msg) {
+ DirectorMethodException(const char* msg = "")
+ : Swig::DirectorException(rb_eRuntimeError, "Swig director method error.", msg) {
}
-
- static void raise(VALUE error)
- {
- throw DirectorMethodException(error);
- }
- };
- /* Attempted to call a pure virtual method via a director method */
- class DirectorPureVirtualException : public Swig::DirectorException
- {
- public:
- DirectorPureVirtualException(const char* msg = "")
- : DirectorException(rb_eRuntimeError, "Swig director pure virtual method called", msg)
- {
+ static void raise(VALUE error) {
+ throw DirectorMethodException(error);
}
+};
- static void raise(const char *msg)
- {
- throw DirectorPureVirtualException(msg);
+/* Attempted to call a pure virtual method via a director method */
+class DirectorPureVirtualException : public Swig::DirectorException
+{
+public:
+ DirectorPureVirtualException(const char* msg = "")
+ : DirectorException(rb_eRuntimeError, "Swig director pure virtual method called", msg) {
}
- };
- /* Simple thread abstraction for pthreads on win32 */
+ static void raise(const char *msg) {
+ throw DirectorPureVirtualException(msg);
+ }
+};
+
+/* Simple thread abstraction for pthreads on win32 */
#ifdef __THREAD__
# define __PTHREAD__
# if defined(_WIN32) || defined(__WIN32__)
@@ -2082,39 +2196,37 @@ namespace Swig {
# define SWIG_MUTEX_INIT(var) var
# else
# include <pthread.h>
-# define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER
+# define SWIG_MUTEX_INIT(var) var = PTHREAD_MUTEX_INITIALIZER
# endif
#endif
#ifdef __PTHREAD__
- struct Guard
- {
+struct Guard {
pthread_mutex_t *_mutex;
-
- Guard(pthread_mutex_t &mutex) : _mutex(&mutex)
- {
- pthread_mutex_lock(_mutex);
+
+ Guard(pthread_mutex_t &mutex) : _mutex(&mutex) {
+ pthread_mutex_lock(_mutex);
}
-
- ~Guard()
- {
- pthread_mutex_unlock(_mutex);
+
+ ~Guard() {
+ pthread_mutex_unlock(_mutex);
}
- };
+};
# define SWIG_GUARD(mutex) Guard _guard(mutex)
#else
-# define SWIG_GUARD(mutex)
+# define SWIG_GUARD(mutex)
#endif
- /* director base class */
- class Director {
- private:
+/* director base class */
+class Director
+{
+private:
/* pointer to the wrapped Ruby object */
VALUE swig_self;
/* flag indicating whether the object is owned by Ruby or c++ */
mutable bool swig_disown_flag;
- public:
+public:
/* wrap a Ruby object, optionally taking ownership */
Director(VALUE self) : swig_self(self), swig_disown_flag(false) {
}
@@ -2124,67 +2236,63 @@ namespace Swig {
}
/* return a pointer to the wrapped Ruby object */
- VALUE swig_get_self() const {
- return swig_self;
+ VALUE swig_get_self() const {
+ return swig_self;
}
/* acquire ownership of the wrapped Ruby object (the sense of "disown"
* is from Ruby) */
- void swig_disown() const {
- if (!swig_disown_flag) {
- swig_disown_flag = true;
- }
+ void swig_disown() const {
+ if (!swig_disown_flag) {
+ swig_disown_flag = true;
+ }
}
- /* ownership management */
- private:
+ /* ownership management */
+private:
typedef std::map<void*, GCItem_var> ownership_map;
mutable ownership_map owner;
#ifdef __PTHREAD__
static pthread_mutex_t swig_mutex_own;
#endif
- public:
+public:
template <typename Type>
- void swig_acquire_ownership_array(Type *vptr) const
- {
- if (vptr) {
- SWIG_GUARD(swig_mutex_own);
- owner[vptr] = new GCArray_T<Type>(vptr);
- }
+ void swig_acquire_ownership_array(Type *vptr) const {
+ if (vptr) {
+ SWIG_GUARD(swig_mutex_own);
+ owner[vptr] = new GCArray_T<Type>(vptr);
+ }
}
-
+
template <typename Type>
- void swig_acquire_ownership(Type *vptr) const
- {
- if (vptr) {
- SWIG_GUARD(swig_mutex_own);
- owner[vptr] = new GCItem_T<Type>(vptr);
- }
+ void swig_acquire_ownership(Type *vptr) const {
+ if (vptr) {
+ SWIG_GUARD(swig_mutex_own);
+ owner[vptr] = new GCItem_T<Type>(vptr);
+ }
}
- void swig_acquire_ownership_obj(void *vptr, ruby_owntype own) const
- {
- if (vptr && own) {
- SWIG_GUARD(swig_mutex_own);
- owner[vptr] = new GCItem_Object(own);
- }
+ void swig_acquire_ownership_obj(void *vptr, ruby_owntype own) const {
+ if (vptr && own) {
+ SWIG_GUARD(swig_mutex_own);
+ owner[vptr] = new GCItem_Object(own);
+ }
}
-
- ruby_owntype swig_release_ownership(void *vptr) const
- {
- ruby_owntype own = 0;
- if (vptr) {
- SWIG_GUARD(swig_mutex_own);
- ownership_map::iterator iter = owner.find(vptr);
- if (iter != owner.end()) {
- own = iter->second->get_own();
- owner.erase(iter);
- }
- }
- return own;
+
+ ruby_owntype swig_release_ownership(void *vptr) const {
+ ruby_owntype own = 0;
+ if (vptr) {
+ SWIG_GUARD(swig_mutex_own);
+ ownership_map::iterator iter = owner.find(vptr);
+ if (iter != owner.end()) {
+ own = iter->second->get_own();
+ owner.erase(iter);
+ }
+ }
+ return own;
}
- };
+};
}
#endif /* __cplusplus */
@@ -2219,12 +2327,12 @@ static VALUE mTinyWRAP;
#define SWIG_RUBY_THREAD_END_BLOCK
-#define SWIGVERSION 0x010340
+#define SWIGVERSION 0x010340
#define SWIG_VERSION SWIGVERSION
-#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
-#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
+#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
#include <stdexcept>
@@ -2254,215 +2362,240 @@ static VALUE mTinyWRAP;
SWIGINTERN VALUE
SWIG_ruby_failed(void)
{
- return Qnil;
-}
+ return Qnil;
+}
/*@SWIG:C:/msys/1.0/local/share/swig/1.3.40\\ruby\\rubyprimtypes.swg,23,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
{
- VALUE obj = args[0];
- VALUE type = TYPE(obj);
- long *res = (long *)(args[1]);
- *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
- return obj;
+ VALUE obj = args[0];
+ VALUE type = TYPE(obj);
+ long *res = (long *)(args[1]);
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
+ return obj;
}
/*@SWIG@*/
SWIGINTERN int
SWIG_AsVal_long (VALUE obj, long* val)
{
- VALUE type = TYPE(obj);
- if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
- long v;
- VALUE a[2];
- a[0] = obj;
- a[1] = (VALUE)(&v);
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
- if (val) *val = v;
- return SWIG_OK;
+ VALUE type = TYPE(obj);
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
+ long v;
+ VALUE a[2];
+ a[0] = obj;
+ a[1] = (VALUE)(&v);
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+ if (val) {
+ *val = v;
+ }
+ return SWIG_OK;
+ }
}
- }
- return SWIG_TypeError;
+ return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_int (VALUE obj, int *val)
{
- long v;
- int res = SWIG_AsVal_long (obj, &v);
- if (SWIG_IsOK(res)) {
- if ((v < INT_MIN || v > INT_MAX)) {
- return SWIG_OverflowError;
- } else {
- if (val) *val = static_cast< int >(v);
+ long v;
+ int res = SWIG_AsVal_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v < INT_MIN || v > INT_MAX)) {
+ return SWIG_OverflowError;
+ }
+ else {
+ if (val) {
+ *val = static_cast< int >(v);
+ }
+ }
}
- }
- return res;
+ return res;
}
SWIGINTERN int
SWIG_AsVal_short (VALUE obj, short *val)
{
- long v;
- int res = SWIG_AsVal_long (obj, &v);
- if (SWIG_IsOK(res)) {
- if ((v < SHRT_MIN || v > SHRT_MAX)) {
- return SWIG_OverflowError;
- } else {
- if (val) *val = static_cast< short >(v);
+ long v;
+ int res = SWIG_AsVal_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v < SHRT_MIN || v > SHRT_MAX)) {
+ return SWIG_OverflowError;
+ }
+ else {
+ if (val) {
+ *val = static_cast< short >(v);
+ }
+ }
}
- }
- return res;
+ return res;
}
SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
- static int init = 0;
- static swig_type_info* info = 0;
- if (!init) {
- info = SWIG_TypeQuery("_p_char");
- init = 1;
- }
- return info;
+ static int init = 0;
+ static swig_type_info* info = 0;
+ if (!init) {
+ info = SWIG_TypeQuery("_p_char");
+ init = 1;
+ }
+ return info;
}
SWIGINTERN int
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
{
- if (TYPE(obj) == T_STRING) {
- #if defined(StringValuePtr)
- char *cstr = StringValuePtr(obj);
- #else
- char *cstr = STR2CSTR(obj);
- #endif
- size_t size = RSTRING_LEN(obj) + 1;
- if (cptr) {
- if (alloc) {
- if (*alloc == SWIG_NEWOBJ) {
- *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
- } else {
- *cptr = cstr;
- *alloc = SWIG_OLDOBJ;
- }
- }
+ if (TYPE(obj) == T_STRING) {
+#if defined(StringValuePtr)
+ char *cstr = StringValuePtr(obj);
+#else
+ char *cstr = STR2CSTR(obj);
+#endif
+ size_t size = RSTRING_LEN(obj) + 1;
+ if (cptr) {
+ if (alloc) {
+ if (*alloc == SWIG_NEWOBJ) {
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
+ }
+ else {
+ *cptr = cstr;
+ *alloc = SWIG_OLDOBJ;
+ }
+ }
+ }
+ if (psize) {
+ *psize = size;
+ }
+ return SWIG_OK;
}
- if (psize) *psize = size;
- return SWIG_OK;
- } else {
- swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
- if (pchar_descriptor) {
- void* vptr = 0;
- if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
- if (cptr) *cptr = (char *)vptr;
- if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
- if (alloc) *alloc = SWIG_OLDOBJ;
- return SWIG_OK;
- }
+ else {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ if (pchar_descriptor) {
+ void* vptr = 0;
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+ if (cptr) {
+ *cptr = (char *)vptr;
+ }
+ if (psize) {
+ *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
+ }
+ if (alloc) {
+ *alloc = SWIG_OLDOBJ;
+ }
+ return SWIG_OK;
+ }
+ }
}
- }
- return SWIG_TypeError;
+ return SWIG_TypeError;
}
- #define SWIG_From_long LONG2NUM
+#define SWIG_From_long LONG2NUM
SWIGINTERNINLINE VALUE
SWIG_From_short (short value)
-{
- return SWIG_From_long (value);
+{
+ return SWIG_From_long (value);
}
-SWIGINTERNINLINE VALUE
+SWIGINTERNINLINE VALUE
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
- if (carray) {
- if (size > LONG_MAX) {
- swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
- return pchar_descriptor ?
- SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
- } else {
- return rb_str_new(carray, static_cast< long >(size));
+ if (carray) {
+ if (size > LONG_MAX) {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ return pchar_descriptor ?
+ SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
+ }
+ else {
+ return rb_str_new(carray, static_cast< long >(size));
+ }
+ }
+ else {
+ return Qnil;
}
- } else {
- return Qnil;
- }
}
-SWIGINTERNINLINE VALUE
+SWIGINTERNINLINE VALUE
SWIG_FromCharPtr(const char *cptr)
-{
- return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+{
+ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
SWIGINTERNINLINE VALUE
SWIG_From_bool (bool value)
{
- return value ? Qtrue : Qfalse;
+ return value ? Qtrue : Qfalse;
}
/*@SWIG:C:/msys/1.0/local/share/swig/1.3.40\\ruby\\rubyprimtypes.swg,23,%ruby_aux_method@*/
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
{
- VALUE obj = args[0];
- VALUE type = TYPE(obj);
- unsigned long *res = (unsigned long *)(args[1]);
- *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
- return obj;
+ VALUE obj = args[0];
+ VALUE type = TYPE(obj);
+ unsigned long *res = (unsigned long *)(args[1]);
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
+ return obj;
}
/*@SWIG@*/
SWIGINTERN int
-SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
+SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
{
- VALUE type = TYPE(obj);
- if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
- unsigned long v;
- VALUE a[2];
- a[0] = obj;
- a[1] = (VALUE)(&v);
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
- if (val) *val = v;
- return SWIG_OK;
+ VALUE type = TYPE(obj);
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
+ unsigned long v;
+ VALUE a[2];
+ a[0] = obj;
+ a[1] = (VALUE)(&v);
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+ if (val) {
+ *val = v;
+ }
+ return SWIG_OK;
+ }
}
- }
- return SWIG_TypeError;
+ return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
{
- unsigned long v;
- int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
- if (SWIG_IsOK(res)) {
- if ((v > UINT_MAX)) {
- return SWIG_OverflowError;
- } else {
- if (val) *val = static_cast< unsigned int >(v);
+ unsigned long v;
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v > UINT_MAX)) {
+ return SWIG_OverflowError;
+ }
+ else {
+ if (val) {
+ *val = static_cast< unsigned int >(v);
+ }
+ }
}
- }
- return res;
+ return res;
}
SWIGINTERNINLINE VALUE
SWIG_From_int (int value)
-{
- return SWIG_From_long (value);
+{
+ return SWIG_From_long (value);
}
/* ---------------------------------------------------
@@ -2477,227 +2610,250 @@ SWIG_From_int (int value)
#include "Ruby/tinyWRAP_wrap.h"
-SwigDirector_SipCallback::SwigDirector_SipCallback(VALUE self): SipCallback(), Swig::Director(self) {
-
+SwigDirector_SipCallback::SwigDirector_SipCallback(VALUE self): SipCallback(), Swig::Director(self)
+{
+
}
-SwigDirector_SipCallback::~SwigDirector_SipCallback() {
+SwigDirector_SipCallback::~SwigDirector_SipCallback()
+{
}
-int SwigDirector_SipCallback::OnRegistrationChanged(RegistrationEvent const *e) {
- int c_result ;
- VALUE obj0 = Qnil ;
- VALUE result;
-
- obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(e), SWIGTYPE_p_RegistrationEvent, 0 );
- result = rb_funcall(swig_get_self(), rb_intern("OnRegistrationChanged"), 1,obj0);
- int swig_val;
- int swig_res = SWIG_AsVal_int(result, &swig_val);
- if (!SWIG_IsOK(swig_res)) {
- Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""int""'");
- }
- c_result = static_cast< int >(swig_val);
- return (int) c_result;
+int SwigDirector_SipCallback::OnRegistrationChanged(RegistrationEvent const *e)
+{
+ int c_result ;
+ VALUE obj0 = Qnil ;
+ VALUE result;
+
+ obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(e), SWIGTYPE_p_RegistrationEvent, 0 );
+ result = rb_funcall(swig_get_self(), rb_intern("OnRegistrationChanged"), 1,obj0);
+ int swig_val;
+ int swig_res = SWIG_AsVal_int(result, &swig_val);
+ if (!SWIG_IsOK(swig_res)) {
+ Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""int""'");
+ }
+ c_result = static_cast< int >(swig_val);
+ return (int) c_result;
}
swig_class SwigClassSipEvent;
SWIGINTERN VALUE
-_wrap_new_SipEvent__SWIG_0(int argc, VALUE *argv, VALUE self) {
- const char *classname SWIGUNUSED = "TinyWRAP::SipEvent";
- SipEvent *result = 0 ;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- result = (SipEvent *)new SipEvent();
- DATA_PTR(self) = result;
- return self;
+_wrap_new_SipEvent__SWIG_0(int argc, VALUE *argv, VALUE self)
+{
+ const char *classname SWIGUNUSED = "TinyWRAP::SipEvent";
+ SipEvent *result = 0 ;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ result = (SipEvent *)new SipEvent();
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SipEvent_allocate(VALUE self) {
+_wrap_SipEvent_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SipEvent_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SipEvent_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SipEvent);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SipEvent__SWIG_1(int argc, VALUE *argv, VALUE self) {
- tsip_event_type_t arg1 ;
- short arg2 ;
- char *arg3 = (char *) 0 ;
- int val1 ;
- int ecode1 = 0 ;
- short val2 ;
- int ecode2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::SipEvent";
- SipEvent *result = 0 ;
-
- if ((argc < 3) || (argc > 3)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
- }
- ecode1 = SWIG_AsVal_int(argv[0], &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "tsip_event_type_t","SipEvent", 1, argv[0] ));
- }
- arg1 = static_cast< tsip_event_type_t >(val1);
- ecode2 = SWIG_AsVal_short(argv[1], &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "short","SipEvent", 2, argv[1] ));
- }
- arg2 = static_cast< short >(val2);
- res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SipEvent", 3, argv[2] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (SipEvent *)new SipEvent(arg1,arg2,(char const *)arg3);
- DATA_PTR(self) = result;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return self;
+_wrap_new_SipEvent__SWIG_1(int argc, VALUE *argv, VALUE self)
+{
+ tsip_event_type_t arg1 ;
+ short arg2 ;
+ char *arg3 = (char *) 0 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ short val2 ;
+ int ecode2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::SipEvent";
+ SipEvent *result = 0 ;
+
+ if ((argc < 3) || (argc > 3)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
+ SWIG_fail;
+ }
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "tsip_event_type_t","SipEvent", 1, argv[0] ));
+ }
+ arg1 = static_cast< tsip_event_type_t >(val1);
+ ecode2 = SWIG_AsVal_short(argv[1], &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "short","SipEvent", 2, argv[1] ));
+ }
+ arg2 = static_cast< short >(val2);
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SipEvent", 3, argv[2] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ result = (SipEvent *)new SipEvent(arg1,arg2,(char const *)arg3);
+ DATA_PTR(self) = result;
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return self;
fail:
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return Qnil;
-}
-
-
-SWIGINTERN VALUE _wrap_new_SipEvent(int nargs, VALUE *args, VALUE self) {
- int argc;
- VALUE argv[3];
- int ii;
-
- argc = nargs;
- if (argc > 3) SWIG_fail;
- for (ii = 0; (ii < argc); ++ii) {
- argv[ii] = args[ii];
- }
- if (argc == 0) {
- return _wrap_new_SipEvent__SWIG_0(nargs, args, self);
- }
- if (argc == 3) {
- int _v;
- {
- int res = SWIG_AsVal_int(argv[0], NULL);
- _v = SWIG_CheckState(res);
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
}
- if (_v) {
- {
- int res = SWIG_AsVal_short(argv[1], NULL);
- _v = SWIG_CheckState(res);
- }
- if (_v) {
- int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
- _v = SWIG_CheckState(res);
+ return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_SipEvent(int nargs, VALUE *args, VALUE self)
+{
+ int argc;
+ VALUE argv[3];
+ int ii;
+
+ argc = nargs;
+ if (argc > 3) {
+ SWIG_fail;
+ }
+ for (ii = 0; (ii < argc); ++ii) {
+ argv[ii] = args[ii];
+ }
+ if (argc == 0) {
+ return _wrap_new_SipEvent__SWIG_0(nargs, args, self);
+ }
+ if (argc == 3) {
+ int _v;
+ {
+ int res = SWIG_AsVal_int(argv[0], NULL);
+ _v = SWIG_CheckState(res);
+ }
if (_v) {
- return _wrap_new_SipEvent__SWIG_1(nargs, args, self);
+ {
+ int res = SWIG_AsVal_short(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_SipEvent__SWIG_1(nargs, args, self);
+ }
+ }
}
- }
}
- }
-
+
fail:
- Ruby_Format_OverloadedError( argc, 3, "SipEvent.new",
- " SipEvent.new()\n"
- " SipEvent.new(tsip_event_type_t type, short code, char const *phrase)\n");
-
- return Qnil;
+ Ruby_Format_OverloadedError( argc, 3, "SipEvent.new",
+ " SipEvent.new()\n"
+ " SipEvent.new(tsip_event_type_t type, short code, char const *phrase)\n");
+
+ return Qnil;
}
SWIGINTERN void
-free_SipEvent(SipEvent *arg1) {
+free_SipEvent(SipEvent *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SipEvent_getCode(int argc, VALUE *argv, VALUE self) {
- SipEvent *arg1 = (SipEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- short result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getCode", 1, self ));
- }
- arg1 = reinterpret_cast< SipEvent * >(argp1);
- result = (short)((SipEvent const *)arg1)->getCode();
- vresult = SWIG_From_short(static_cast< short >(result));
- return vresult;
+_wrap_SipEvent_getCode(int argc, VALUE *argv, VALUE self)
+{
+ SipEvent *arg1 = (SipEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ short result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getCode", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipEvent * >(argp1);
+ result = (short)((SipEvent const *)arg1)->getCode();
+ vresult = SWIG_From_short(static_cast< short >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipEvent_getPhrase(int argc, VALUE *argv, VALUE self) {
- SipEvent *arg1 = (SipEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- char *result = 0 ;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getPhrase", 1, self ));
- }
- arg1 = reinterpret_cast< SipEvent * >(argp1);
- result = (char *)((SipEvent const *)arg1)->getPhrase();
- vresult = SWIG_FromCharPtr((const char *)result);
- return vresult;
+_wrap_SipEvent_getPhrase(int argc, VALUE *argv, VALUE self)
+{
+ SipEvent *arg1 = (SipEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ char *result = 0 ;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getPhrase", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipEvent * >(argp1);
+ result = (char *)((SipEvent const *)arg1)->getPhrase();
+ vresult = SWIG_FromCharPtr((const char *)result);
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipEvent_getBaseSession(int argc, VALUE *argv, VALUE self) {
- SipEvent *arg1 = (SipEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- SipSession *result = 0 ;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getBaseSession", 1, self ));
- }
- arg1 = reinterpret_cast< SipEvent * >(argp1);
- result = (SipSession *)((SipEvent const *)arg1)->getBaseSession();
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SipSession, 0 | 0 );
- return vresult;
+_wrap_SipEvent_getBaseSession(int argc, VALUE *argv, VALUE self)
+{
+ SipEvent *arg1 = (SipEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ SipSession *result = 0 ;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipEvent const *","getBaseSession", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipEvent * >(argp1);
+ result = (SipSession *)((SipEvent const *)arg1)->getBaseSession();
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SipSession, 0 | 0 );
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
@@ -2705,397 +2861,457 @@ swig_class SwigClassSipSession;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SipSession_allocate(VALUE self) {
+_wrap_SipSession_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SipSession_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SipSession_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SipSession);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SipSession(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::SipSession";
- SipSession *result = 0 ;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","SipSession", 1, argv[0] ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- result = (SipSession *)new SipSession(arg1);
- DATA_PTR(self) = result;
- return self;
+_wrap_new_SipSession(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::SipSession";
+ SipSession *result = 0 ;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","SipSession", 1, argv[0] ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ result = (SipSession *)new SipSession(arg1);
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_SipSession(SipSession *arg1) {
+free_SipSession(SipSession *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SipSession_addHeader(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 2) || (argc > 2)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addHeader", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return vresult;
+_wrap_SipSession_addHeader(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 2) || (argc > 2)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addHeader", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_removeHeader(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","removeHeader", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeHeader", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->removeHeader((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_removeHeader(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","removeHeader", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeHeader", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->removeHeader((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_addCaps__SWIG_0(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 2) || (argc > 2)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addCaps", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addCaps", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addCaps", 3, argv[1] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (bool)(arg1)->addCaps((char const *)arg2,(char const *)arg3);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return vresult;
+_wrap_SipSession_addCaps__SWIG_0(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 2) || (argc > 2)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addCaps", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addCaps", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addCaps", 3, argv[1] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ result = (bool)(arg1)->addCaps((char const *)arg2,(char const *)arg3);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_addCaps__SWIG_1(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addCaps", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addCaps", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->addCaps((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_addCaps__SWIG_1(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","addCaps", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addCaps", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->addCaps((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
-}
-
-
-SWIGINTERN VALUE _wrap_SipSession_addCaps(int nargs, VALUE *args, VALUE self) {
- int argc;
- VALUE argv[4];
- int ii;
-
- argc = nargs + 1;
- argv[0] = self;
- if (argc > 4) SWIG_fail;
- for (ii = 1; (ii < argc); ++ii) {
- argv[ii] = args[ii-1];
- }
- if (argc == 2) {
- int _v;
- void *vptr = 0;
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_SipSession, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- return _wrap_SipSession_addCaps__SWIG_1(nargs, args, self);
- }
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
}
- }
- if (argc == 3) {
- int _v;
- void *vptr = 0;
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_SipSession, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
- _v = SWIG_CheckState(res);
- if (_v) {
- int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+ return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_SipSession_addCaps(int nargs, VALUE *args, VALUE self)
+{
+ int argc;
+ VALUE argv[4];
+ int ii;
+
+ argc = nargs + 1;
+ argv[0] = self;
+ if (argc > 4) {
+ SWIG_fail;
+ }
+ for (ii = 1; (ii < argc); ++ii) {
+ argv[ii] = args[ii-1];
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_SipSession, 0);
_v = SWIG_CheckState(res);
if (_v) {
- return _wrap_SipSession_addCaps__SWIG_0(nargs, args, self);
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_SipSession_addCaps__SWIG_1(nargs, args, self);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_SipSession, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_SipSession_addCaps__SWIG_0(nargs, args, self);
+ }
+ }
}
- }
}
- }
-
+
fail:
- Ruby_Format_OverloadedError( argc, 4, "SipSession.addCaps",
- " bool SipSession.addCaps(char const *name, char const *value)\n"
- " bool SipSession.addCaps(char const *name)\n");
-
- return Qnil;
+ Ruby_Format_OverloadedError( argc, 4, "SipSession.addCaps",
+ " bool SipSession.addCaps(char const *name, char const *value)\n"
+ " bool SipSession.addCaps(char const *name)\n");
+
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_removeCaps(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","removeCaps", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeCaps", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->removeCaps((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_removeCaps(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","removeCaps", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeCaps", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->removeCaps((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_setExpires(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- unsigned int arg2 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- unsigned int val2 ;
- int ecode2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setExpires", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setExpires", 2, argv[0] ));
- }
- arg2 = static_cast< unsigned int >(val2);
- result = (bool)(arg1)->setExpires(arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_SipSession_setExpires(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ unsigned int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ unsigned int val2 ;
+ int ecode2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setExpires", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setExpires", 2, argv[0] ));
+ }
+ arg2 = static_cast< unsigned int >(val2);
+ result = (bool)(arg1)->setExpires(arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_setFromUri(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setFromUri", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setFromUri", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->setFromUri((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_setFromUri(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setFromUri", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setFromUri", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->setFromUri((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipSession_setToUri(int argc, VALUE *argv, VALUE self) {
- SipSession *arg1 = (SipSession *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setToUri", 1, self ));
- }
- arg1 = reinterpret_cast< SipSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setToUri", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->setToUri((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipSession_setToUri(int argc, VALUE *argv, VALUE self)
+{
+ SipSession *arg1 = (SipSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipSession *","setToUri", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setToUri", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->setToUri((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
@@ -3103,87 +3319,96 @@ swig_class SwigClassRegistrationEvent;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_RegistrationEvent_allocate(VALUE self) {
+_wrap_RegistrationEvent_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_RegistrationEvent_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_RegistrationEvent_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_RegistrationEvent);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_RegistrationEvent(int argc, VALUE *argv, VALUE self) {
- const char *classname SWIGUNUSED = "TinyWRAP::RegistrationEvent";
- RegistrationEvent *result = 0 ;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- result = (RegistrationEvent *)new RegistrationEvent();
- DATA_PTR(self) = result;
- return self;
+_wrap_new_RegistrationEvent(int argc, VALUE *argv, VALUE self)
+{
+ const char *classname SWIGUNUSED = "TinyWRAP::RegistrationEvent";
+ RegistrationEvent *result = 0 ;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ result = (RegistrationEvent *)new RegistrationEvent();
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_RegistrationEvent(RegistrationEvent *arg1) {
+free_RegistrationEvent(RegistrationEvent *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_RegistrationEvent_getType(int argc, VALUE *argv, VALUE self) {
- RegistrationEvent *arg1 = (RegistrationEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- tsip_register_event_type_t result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationEvent const *","getType", 1, self ));
- }
- arg1 = reinterpret_cast< RegistrationEvent * >(argp1);
- result = (tsip_register_event_type_t)((RegistrationEvent const *)arg1)->getType();
- vresult = SWIG_From_int(static_cast< int >(result));
- return vresult;
+_wrap_RegistrationEvent_getType(int argc, VALUE *argv, VALUE self)
+{
+ RegistrationEvent *arg1 = (RegistrationEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ tsip_register_event_type_t result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationEvent const *","getType", 1, self ));
+ }
+ arg1 = reinterpret_cast< RegistrationEvent * >(argp1);
+ result = (tsip_register_event_type_t)((RegistrationEvent const *)arg1)->getType();
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_RegistrationEvent_getSession(int argc, VALUE *argv, VALUE self) {
- RegistrationEvent *arg1 = (RegistrationEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- RegistrationSession *result = 0 ;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationEvent const *","getSession", 1, self ));
- }
- arg1 = reinterpret_cast< RegistrationEvent * >(argp1);
- result = (RegistrationSession *)((RegistrationEvent const *)arg1)->getSession();
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RegistrationSession, 0 | 0 );
- return vresult;
+_wrap_RegistrationEvent_getSession(int argc, VALUE *argv, VALUE self)
+{
+ RegistrationEvent *arg1 = (RegistrationEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ RegistrationSession *result = 0 ;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationEvent const *","getSession", 1, self ));
+ }
+ arg1 = reinterpret_cast< RegistrationEvent * >(argp1);
+ result = (RegistrationSession *)((RegistrationEvent const *)arg1)->getSession();
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RegistrationSession, 0 | 0 );
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
@@ -3191,103 +3416,112 @@ swig_class SwigClassRegistrationSession;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_RegistrationSession_allocate(VALUE self) {
+_wrap_RegistrationSession_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_RegistrationSession_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_RegistrationSession_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_RegistrationSession);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_RegistrationSession(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::RegistrationSession";
- RegistrationSession *result = 0 ;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","RegistrationSession", 1, argv[0] ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- result = (RegistrationSession *)new RegistrationSession(arg1);
- DATA_PTR(self) = result;
- return self;
+_wrap_new_RegistrationSession(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::RegistrationSession";
+ RegistrationSession *result = 0 ;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","RegistrationSession", 1, argv[0] ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ result = (RegistrationSession *)new RegistrationSession(arg1);
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_RegistrationSession(RegistrationSession *arg1) {
+free_RegistrationSession(RegistrationSession *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_RegistrationSession_Register(int argc, VALUE *argv, VALUE self) {
- RegistrationSession *arg1 = (RegistrationSession *) 0 ;
- unsigned int arg2 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- unsigned int val2 ;
- int ecode2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationSession *","Register", 1, self ));
- }
- arg1 = reinterpret_cast< RegistrationSession * >(argp1);
- ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Register", 2, argv[0] ));
- }
- arg2 = static_cast< unsigned int >(val2);
- result = (bool)(arg1)->Register(arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_RegistrationSession_Register(int argc, VALUE *argv, VALUE self)
+{
+ RegistrationSession *arg1 = (RegistrationSession *) 0 ;
+ unsigned int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ unsigned int val2 ;
+ int ecode2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationSession *","Register", 1, self ));
+ }
+ arg1 = reinterpret_cast< RegistrationSession * >(argp1);
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","Register", 2, argv[0] ));
+ }
+ arg2 = static_cast< unsigned int >(val2);
+ result = (bool)(arg1)->Register(arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_RegistrationSession_UnRegister(int argc, VALUE *argv, VALUE self) {
- RegistrationSession *arg1 = (RegistrationSession *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationSession *","UnRegister", 1, self ));
- }
- arg1 = reinterpret_cast< RegistrationSession * >(argp1);
- result = (bool)(arg1)->UnRegister();
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_RegistrationSession_UnRegister(int argc, VALUE *argv, VALUE self)
+{
+ RegistrationSession *arg1 = (RegistrationSession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_RegistrationSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "RegistrationSession *","UnRegister", 1, self ));
+ }
+ arg1 = reinterpret_cast< RegistrationSession * >(argp1);
+ result = (bool)(arg1)->UnRegister();
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
@@ -3295,117 +3529,131 @@ swig_class SwigClassSipCallback;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SipCallback_allocate(VALUE self) {
+_wrap_SipCallback_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SipCallback_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SipCallback_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SipCallback);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SipCallback(int argc, VALUE *argv, VALUE self) {
- VALUE arg1 = (VALUE) 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::SipCallback";
- SipCallback *result = 0 ;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- arg1 = self;
- if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
- /* subclassed */
- result = (SipCallback *)new SwigDirector_SipCallback(arg1);
- } else {
- result = (SipCallback *)new SipCallback();
- }
-
- DATA_PTR(self) = result;
- return self;
+_wrap_new_SipCallback(int argc, VALUE *argv, VALUE self)
+{
+ VALUE arg1 = (VALUE) 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::SipCallback";
+ SipCallback *result = 0 ;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ arg1 = self;
+ if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
+ /* subclassed */
+ result = (SipCallback *)new SwigDirector_SipCallback(arg1);
+ }
+ else {
+ result = (SipCallback *)new SipCallback();
+ }
+
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_SipCallback(SipCallback *arg1) {
+free_SipCallback(SipCallback *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SipCallback_OnRegistrationChanged(int argc, VALUE *argv, VALUE self) {
- SipCallback *arg1 = (SipCallback *) 0 ;
- RegistrationEvent *arg2 = (RegistrationEvent *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- void *argp2 = 0 ;
- int res2 = 0 ;
- Swig::Director *director = 0;
- bool upcall = false;
- int result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","OnRegistrationChanged", 1, self ));
- }
- arg1 = reinterpret_cast< SipCallback * >(argp1);
- res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "RegistrationEvent const *","OnRegistrationChanged", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< RegistrationEvent * >(argp2);
- director = dynamic_cast<Swig::Director *>(arg1);
- upcall = (director && (director->swig_get_self() == self));
- try {
- if (upcall) {
- result = (int)(arg1)->SipCallback::OnRegistrationChanged((RegistrationEvent const *)arg2);
- } else {
- result = (int)(arg1)->OnRegistrationChanged((RegistrationEvent const *)arg2);
- }
- } catch (Swig::DirectorException& e) {
- rb_exc_raise(e.getError());
- SWIG_fail;
- }
- vresult = SWIG_From_int(static_cast< int >(result));
- return vresult;
+_wrap_SipCallback_OnRegistrationChanged(int argc, VALUE *argv, VALUE self)
+{
+ SipCallback *arg1 = (SipCallback *) 0 ;
+ RegistrationEvent *arg2 = (RegistrationEvent *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ Swig::Director *director = 0;
+ bool upcall = false;
+ int result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","OnRegistrationChanged", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipCallback * >(argp1);
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_RegistrationEvent, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "RegistrationEvent const *","OnRegistrationChanged", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< RegistrationEvent * >(argp2);
+ director = dynamic_cast<Swig::Director *>(arg1);
+ upcall = (director && (director->swig_get_self() == self));
+ try {
+ if (upcall) {
+ result = (int)(arg1)->SipCallback::OnRegistrationChanged((RegistrationEvent const *)arg2);
+ }
+ else {
+ result = (int)(arg1)->OnRegistrationChanged((RegistrationEvent const *)arg2);
+ }
+ }
+ catch (Swig::DirectorException& e) {
+ rb_exc_raise(e.getError());
+ SWIG_fail;
+ }
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_disown_SipCallback(int argc, VALUE *argv, VALUE self) {
- SipCallback *arg1 = (SipCallback *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","disown_SipCallback", 1, argv[0] ));
- }
- arg1 = reinterpret_cast< SipCallback * >(argp1);
- {
- Swig::Director *director = dynamic_cast<Swig::Director *>(arg1);
- if (director) director->swig_disown();
- }
-
- return Qnil;
+_wrap_disown_SipCallback(int argc, VALUE *argv, VALUE self)
+{
+ SipCallback *arg1 = (SipCallback *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","disown_SipCallback", 1, argv[0] ));
+ }
+ arg1 = reinterpret_cast< SipCallback * >(argp1);
+ {
+ Swig::Director *director = dynamic_cast<Swig::Director *>(arg1);
+ if (director) {
+ director->swig_disown();
+ }
+ }
+
+ return Qnil;
fail:
- return Qnil;
+ return Qnil;
}
@@ -3413,87 +3661,96 @@ swig_class SwigClassSafeObject;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SafeObject_allocate(VALUE self) {
+_wrap_SafeObject_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SafeObject_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SafeObject_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SafeObject);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SafeObject(int argc, VALUE *argv, VALUE self) {
- const char *classname SWIGUNUSED = "TinyWRAP::SafeObject";
- SafeObject *result = 0 ;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- result = (SafeObject *)new SafeObject();
- DATA_PTR(self) = result;
- return self;
+_wrap_new_SafeObject(int argc, VALUE *argv, VALUE self)
+{
+ const char *classname SWIGUNUSED = "TinyWRAP::SafeObject";
+ SafeObject *result = 0 ;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ result = (SafeObject *)new SafeObject();
+ DATA_PTR(self) = result;
+ return self;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN void
-free_SafeObject(SafeObject *arg1) {
+free_SafeObject(SafeObject *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SafeObject_Lock(int argc, VALUE *argv, VALUE self) {
- SafeObject *arg1 = (SafeObject *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SafeObject, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SafeObject *","Lock", 1, self ));
- }
- arg1 = reinterpret_cast< SafeObject * >(argp1);
- result = (int)(arg1)->Lock();
- vresult = SWIG_From_int(static_cast< int >(result));
- return vresult;
+_wrap_SafeObject_Lock(int argc, VALUE *argv, VALUE self)
+{
+ SafeObject *arg1 = (SafeObject *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SafeObject, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SafeObject *","Lock", 1, self ));
+ }
+ arg1 = reinterpret_cast< SafeObject * >(argp1);
+ result = (int)(arg1)->Lock();
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SafeObject_UnLock(int argc, VALUE *argv, VALUE self) {
- SafeObject *arg1 = (SafeObject *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SafeObject, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SafeObject *","UnLock", 1, self ));
- }
- arg1 = reinterpret_cast< SafeObject * >(argp1);
- result = (int)(arg1)->UnLock();
- vresult = SWIG_From_int(static_cast< int >(result));
- return vresult;
+_wrap_SafeObject_UnLock(int argc, VALUE *argv, VALUE self)
+{
+ SafeObject *arg1 = (SafeObject *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SafeObject, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SafeObject *","UnLock", 1, self ));
+ }
+ arg1 = reinterpret_cast< SafeObject * >(argp1);
+ result = (int)(arg1)->UnLock();
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
@@ -3501,389 +3758,457 @@ swig_class SwigClassSipStack;
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
SWIGINTERN VALUE
-_wrap_SipStack_allocate(VALUE self) {
+_wrap_SipStack_allocate(VALUE self)
+{
#else
- SWIGINTERN VALUE
- _wrap_SipStack_allocate(int argc, VALUE *argv, VALUE self) {
+SWIGINTERN VALUE
+_wrap_SipStack_allocate(int argc, VALUE *argv, VALUE self)
+{
#endif
-
-
+
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_SipStack);
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
rb_obj_call_init(vresult, argc, argv);
#endif
return vresult;
- }
-
+}
+
SWIGINTERN VALUE
-_wrap_new_SipStack(int argc, VALUE *argv, VALUE self) {
- SipCallback *arg1 = (SipCallback *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- char *arg4 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- int res4 ;
- char *buf4 = 0 ;
- int alloc4 = 0 ;
- const char *classname SWIGUNUSED = "TinyWRAP::SipStack";
- SipStack *result = 0 ;
-
- if ((argc < 4) || (argc > 4)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","SipStack", 1, argv[0] ));
- }
- arg1 = reinterpret_cast< SipCallback * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SipStack", 2, argv[1] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SipStack", 3, argv[2] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","SipStack", 4, argv[3] ));
- }
- arg4 = reinterpret_cast< char * >(buf4);
- result = (SipStack *)new SipStack(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
- DATA_PTR(self) = result;
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- return self;
+_wrap_new_SipStack(int argc, VALUE *argv, VALUE self)
+{
+ SipCallback *arg1 = (SipCallback *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ const char *classname SWIGUNUSED = "TinyWRAP::SipStack";
+ SipStack *result = 0 ;
+
+ if ((argc < 4) || (argc > 4)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_SipCallback, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipCallback *","SipStack", 1, argv[0] ));
+ }
+ arg1 = reinterpret_cast< SipCallback * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SipStack", 2, argv[1] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SipStack", 3, argv[2] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","SipStack", 4, argv[3] ));
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
+ result = (SipStack *)new SipStack(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
+ DATA_PTR(self) = result;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ if (alloc4 == SWIG_NEWOBJ) {
+ delete[] buf4;
+ }
+ return self;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ if (alloc4 == SWIG_NEWOBJ) {
+ delete[] buf4;
+ }
+ return Qnil;
}
SWIGINTERN void
-free_SipStack(SipStack *arg1) {
+free_SipStack(SipStack *arg1)
+{
delete arg1;
}
SWIGINTERN VALUE
-_wrap_SipStack_Start(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","Start", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- result = (bool)(arg1)->Start();
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_SipStack_Start(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","Start", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ result = (bool)(arg1)->Start();
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_setPassword(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setPassword", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setPassword", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->setPassword((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipStack_setPassword(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setPassword", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setPassword", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->setPassword((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_setProxyCSCF(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- unsigned int arg3 ;
- char *arg4 = (char *) 0 ;
- char *arg5 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- unsigned int val3 ;
- int ecode3 = 0 ;
- int res4 ;
- char *buf4 = 0 ;
- int alloc4 = 0 ;
- int res5 ;
- char *buf5 = 0 ;
- int alloc5 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 4) || (argc > 4)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setProxyCSCF", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","setProxyCSCF", 3, argv[1] ));
- }
- arg3 = static_cast< unsigned int >(val3);
- res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 4, argv[2] ));
- }
- arg4 = reinterpret_cast< char * >(buf4);
- res5 = SWIG_AsCharPtrAndSize(argv[3], &buf5, NULL, &alloc5);
- if (!SWIG_IsOK(res5)) {
- SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 5, argv[3] ));
- }
- arg5 = reinterpret_cast< char * >(buf5);
- result = (bool)(arg1)->setProxyCSCF((char const *)arg2,arg3,(char const *)arg4,(char const *)arg5);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
- return vresult;
+_wrap_SipStack_setProxyCSCF(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ unsigned int arg3 ;
+ char *arg4 = (char *) 0 ;
+ char *arg5 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ unsigned int val3 ;
+ int ecode3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ int res5 ;
+ char *buf5 = 0 ;
+ int alloc5 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 4) || (argc > 4)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setProxyCSCF", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ ecode3 = SWIG_AsVal_unsigned_SS_int(argv[1], &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned int","setProxyCSCF", 3, argv[1] ));
+ }
+ arg3 = static_cast< unsigned int >(val3);
+ res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 4, argv[2] ));
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
+ res5 = SWIG_AsCharPtrAndSize(argv[3], &buf5, NULL, &alloc5);
+ if (!SWIG_IsOK(res5)) {
+ SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char const *","setProxyCSCF", 5, argv[3] ));
+ }
+ arg5 = reinterpret_cast< char * >(buf5);
+ result = (bool)(arg1)->setProxyCSCF((char const *)arg2,arg3,(char const *)arg4,(char const *)arg5);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc4 == SWIG_NEWOBJ) {
+ delete[] buf4;
+ }
+ if (alloc5 == SWIG_NEWOBJ) {
+ delete[] buf5;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
- if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc4 == SWIG_NEWOBJ) {
+ delete[] buf4;
+ }
+ if (alloc5 == SWIG_NEWOBJ) {
+ delete[] buf5;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_setLocalIP(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setLocalIP", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setLocalIP", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->setLocalIP((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipStack_setLocalIP(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setLocalIP", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","setLocalIP", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->setLocalIP((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_setLocalPort(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- unsigned int arg2 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- unsigned int val2 ;
- int ecode2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setLocalPort", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setLocalPort", 2, argv[0] ));
- }
- arg2 = static_cast< unsigned int >(val2);
- result = (bool)(arg1)->setLocalPort(arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_SipStack_setLocalPort(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ unsigned int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ unsigned int val2 ;
+ int ecode2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","setLocalPort", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setLocalPort", 2, argv[0] ));
+ }
+ arg2 = static_cast< unsigned int >(val2);
+ result = (bool)(arg1)->setLocalPort(arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_addHeader(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 2) || (argc > 2)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","addHeader", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
- }
- arg3 = reinterpret_cast< char * >(buf3);
- result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return vresult;
+_wrap_SipStack_addHeader(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 2) || (argc > 2)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","addHeader", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","addHeader", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","addHeader", 3, argv[1] ));
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ if (alloc3 == SWIG_NEWOBJ) {
+ delete[] buf3;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_removeHeader(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- char *arg2 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 1) || (argc > 1)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","removeHeader", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeHeader", 2, argv[0] ));
- }
- arg2 = reinterpret_cast< char * >(buf2);
- result = (bool)(arg1)->removeHeader((char const *)arg2);
- vresult = SWIG_From_bool(static_cast< bool >(result));
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return vresult;
+_wrap_SipStack_removeHeader(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 1) || (argc > 1)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","removeHeader", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","removeHeader", 2, argv[0] ));
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (bool)(arg1)->removeHeader((char const *)arg2);
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return vresult;
fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- return Qnil;
+ if (alloc2 == SWIG_NEWOBJ) {
+ delete[] buf2;
+ }
+ return Qnil;
}
SWIGINTERN VALUE
-_wrap_SipStack_Stop(int argc, VALUE *argv, VALUE self) {
- SipStack *arg1 = (SipStack *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- bool result;
- VALUE vresult = Qnil;
-
- if ((argc < 0) || (argc > 0)) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
- }
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","Stop", 1, self ));
- }
- arg1 = reinterpret_cast< SipStack * >(argp1);
- result = (bool)(arg1)->Stop();
- vresult = SWIG_From_bool(static_cast< bool >(result));
- return vresult;
+_wrap_SipStack_Stop(int argc, VALUE *argv, VALUE self)
+{
+ SipStack *arg1 = (SipStack *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ bool result;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
+ SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_SipStack, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SipStack *","Stop", 1, self ));
+ }
+ arg1 = reinterpret_cast< SipStack * >(argp1);
+ result = (bool)(arg1)->Stop();
+ vresult = SWIG_From_bool(static_cast< bool >(result));
+ return vresult;
fail:
- return Qnil;
+ return Qnil;
}
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
-static void *_p_RegistrationEventTo_p_SipEvent(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+static void *_p_RegistrationEventTo_p_SipEvent(void *x, int *SWIGUNUSEDPARM(newmemory))
+{
return (void *)((SipEvent *) ((RegistrationEvent *) x));
}
-static void *_p_SipStackTo_p_SafeObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+static void *_p_SipStackTo_p_SafeObject(void *x, int *SWIGUNUSEDPARM(newmemory))
+{
return (void *)((SafeObject *) ((SipStack *) x));
}
-static void *_p_RegistrationSessionTo_p_SipSession(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+static void *_p_RegistrationSessionTo_p_SipSession(void *x, int *SWIGUNUSEDPARM(newmemory))
+{
return (void *)((SipSession *) ((RegistrationSession *) x));
}
static swig_type_info _swigt__p_RegistrationEvent = {"_p_RegistrationEvent", "RegistrationEvent *", 0, 0, (void*)0, 0};
@@ -3898,16 +4223,16 @@ static swig_type_info _swigt__p_tsip_event_type_e = {"_p_tsip_event_type_e", "en
static swig_type_info _swigt__p_tsip_register_event_type_e = {"_p_tsip_register_event_type_e", "enum tsip_register_event_type_e *|tsip_register_event_type_t *", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
- &_swigt__p_RegistrationEvent,
- &_swigt__p_RegistrationSession,
- &_swigt__p_SafeObject,
- &_swigt__p_SipCallback,
- &_swigt__p_SipEvent,
- &_swigt__p_SipSession,
- &_swigt__p_SipStack,
- &_swigt__p_char,
- &_swigt__p_tsip_event_type_e,
- &_swigt__p_tsip_register_event_type_e,
+ &_swigt__p_RegistrationEvent,
+ &_swigt__p_RegistrationSession,
+ &_swigt__p_SafeObject,
+ &_swigt__p_SipCallback,
+ &_swigt__p_SipEvent,
+ &_swigt__p_SipSession,
+ &_swigt__p_SipStack,
+ &_swigt__p_char,
+ &_swigt__p_tsip_event_type_e,
+ &_swigt__p_tsip_register_event_type_e,
};
static swig_cast_info _swigc__p_RegistrationEvent[] = { {&_swigt__p_RegistrationEvent, 0, 0, 0},{0, 0, 0, 0}};
@@ -3922,16 +4247,16 @@ static swig_cast_info _swigc__p_tsip_event_type_e[] = { {&_swigt__p_tsip_event_
static swig_cast_info _swigc__p_tsip_register_event_type_e[] = { {&_swigt__p_tsip_register_event_type_e, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
- _swigc__p_RegistrationEvent,
- _swigc__p_RegistrationSession,
- _swigc__p_SafeObject,
- _swigc__p_SipCallback,
- _swigc__p_SipEvent,
- _swigc__p_SipSession,
- _swigc__p_SipStack,
- _swigc__p_char,
- _swigc__p_tsip_event_type_e,
- _swigc__p_tsip_register_event_type_e,
+ _swigc__p_RegistrationEvent,
+ _swigc__p_RegistrationSession,
+ _swigc__p_SafeObject,
+ _swigc__p_SipCallback,
+ _swigc__p_SipEvent,
+ _swigc__p_SipSession,
+ _swigc__p_SipStack,
+ _swigc__p_char,
+ _swigc__p_tsip_event_type_e,
+ _swigc__p_tsip_register_event_type_e,
};
@@ -3939,18 +4264,18 @@ static swig_cast_info *swig_cast_initial[] = {
/* -----------------------------------------------------------------------------
* Type initialization:
- * This problem is tough by the requirement that no dynamic
- * memory is used. Also, since swig_type_info structures store pointers to
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
* swig_cast_info structures and swig_cast_info structures store pointers back
- * to swig_type_info structures, we need some lookup code at initialization.
- * The idea is that swig generates all the structures that are needed.
- * The runtime then collects these partially filled structures.
- * The SWIG_InitializeModule function takes these initial arrays out of
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
* swig_module, and does all the lookup, filling in the swig_module.types
* array with the correct data and linking the correct swig_cast_info
* structures together.
*
- * The generated swig_type_info structures are assigned staticly to an initial
+ * The generated swig_type_info structures are assigned staticly to an initial
* array. We just loop through that array, and handle each type individually.
* First we lookup if this type has been already loaded, and if so, use the
* loaded structure instead of the generated one. Then we have to fill in the
@@ -3960,17 +4285,17 @@ static swig_cast_info *swig_cast_initial[] = {
* a column is one of the swig_cast_info structures for that type.
* The cast_initial array is actually an array of arrays, because each row has
* a variable number of columns. So to actually build the cast linked list,
- * we find the array of casts associated with the type, and loop through it
+ * we find the array of casts associated with the type, and loop through it
* adding the casts to the list. The one last trick we need to do is making
* sure the type pointer in the swig_cast_info struct is correct.
*
- * First off, we lookup the cast->type name to see if it is already loaded.
+ * First off, we lookup the cast->type name to see if it is already loaded.
* There are three cases to handle:
* 1) If the cast->type has already been loaded AND the type we are adding
* casting info to has not been loaded (it is in this module), THEN we
* replace the cast->type pointer with the type pointer that has already
* been loaded.
- * 2) If BOTH types (the one we are adding casting info to, and the
+ * 2) If BOTH types (the one we are adding casting info to, and the
* cast->type) are loaded, THEN the cast info has already been loaded by
* the previous module so we just ignore it.
* 3) Finally, if cast->type has not already been loaded, then we add that
@@ -3991,151 +4316,167 @@ extern "C" {
SWIGRUNTIME void
-SWIG_InitializeModule(void *clientdata) {
- size_t i;
- swig_module_info *module_head, *iter;
- int found, init;
+SWIG_InitializeModule(void *clientdata)
+{
+size_t i;
+swig_module_info *module_head, *iter;
+int found, init;
- clientdata = clientdata;
+clientdata = clientdata;
- /* check to see if the circular list has been setup, if not, set it up */
- if (swig_module.next==0) {
+/* check to see if the circular list has been setup, if not, set it up */
+if (swig_module.next==0) {
/* Initialize the swig_module */
swig_module.type_initial = swig_type_initial;
swig_module.cast_initial = swig_cast_initial;
swig_module.next = &swig_module;
init = 1;
- } else {
+}
+else {
init = 0;
- }
+}
- /* Try and load any already created modules */
- module_head = SWIG_GetModule(clientdata);
- if (!module_head) {
+/* Try and load any already created modules */
+module_head = SWIG_GetModule(clientdata);
+if (!module_head) {
/* This is the first module loaded for this interpreter */
/* so set the swig module into the interpreter */
SWIG_SetModule(clientdata, &swig_module);
module_head = &swig_module;
- } else {
+}
+else {
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
found=0;
iter=module_head;
do {
- if (iter==&swig_module) {
- found=1;
- break;
- }
- iter=iter->next;
- } while (iter!= module_head);
+ if (iter==&swig_module) {
+ found=1;
+ break;
+ }
+ iter=iter->next;
+ }
+ while (iter!= module_head);
/* if the is found in the list, then all is done and we may leave */
- if (found) return;
+ if (found) {
+ return;
+ }
/* otherwise we must add out module into the list */
swig_module.next = module_head->next;
module_head->next = &swig_module;
- }
+}
- /* When multiple interpeters are used, a module could have already been initialized in
- a different interpreter, but not yet have a pointer in this interpreter.
- In this case, we do not want to continue adding types... everything should be
- set up already */
- if (init == 0) return;
+/* When multiple interpeters are used, a module could have already been initialized in
+ a different interpreter, but not yet have a pointer in this interpreter.
+ In this case, we do not want to continue adding types... everything should be
+ set up already */
+if (init == 0) {
+ return;
+}
- /* Now work on filling in swig_module.types */
+/* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
- for (i = 0; i < swig_module.size; ++i) {
+for (i = 0; i < swig_module.size; ++i) {
swig_type_info *type = 0;
swig_type_info *ret;
swig_cast_info *cast;
-
+
#ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif
/* if there is another module already loaded */
if (swig_module.next != &swig_module) {
- type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
}
if (type) {
- /* Overwrite clientdata field */
+ /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: found type %s\n", type->name);
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
- if (swig_module.type_initial[i]->clientdata) {
- type->clientdata = swig_module.type_initial[i]->clientdata;
+ if (swig_module.type_initial[i]->clientdata) {
+ type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
- }
- } else {
- type = swig_module.type_initial[i];
+ }
+ }
+ else {
+ type = swig_module.type_initial[i];
}
/* Insert casting types */
cast = swig_module.cast_initial[i];
while (cast->type) {
-
- /* Don't need to add information already in the list */
- ret = 0;
+
+ /* Don't need to add information already in the list */
+ ret = 0;
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
- if (swig_module.next != &swig_module) {
- ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+ if (swig_module.next != &swig_module) {
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
- if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+ if (ret) {
+ printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+ }
#endif
- }
- if (ret) {
- if (type == swig_module.type_initial[i]) {
+ }
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
- cast->type = ret;
- ret = 0;
- } else {
- /* Check for casting already in the list */
- swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+ cast->type = ret;
+ ret = 0;
+ }
+ else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
- if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+ if (ocast) {
+ printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+ }
#endif
- if (!ocast) ret = 0;
- }
- }
+ if (!ocast) {
+ ret = 0;
+ }
+ }
+ }
- if (!ret) {
+ if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
- printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
- if (type->cast) {
- type->cast->prev = cast;
- cast->next = type->cast;
+ if (type->cast) {
+ type->cast->prev = cast;
+ cast->next = type->cast;
+ }
+ type->cast = cast;
}
- type->cast = cast;
- }
- cast++;
+ cast++;
}
/* Set entry in modules->types array equal to the type */
swig_module.types[i] = type;
- }
- swig_module.types[i] = 0;
+}
+swig_module.types[i] = 0;
#ifdef SWIGRUNTIME_DEBUG
- printf("**** SWIG_InitializeModule: Cast List ******\n");
- for (i = 0; i < swig_module.size; ++i) {
+printf("**** SWIG_InitializeModule: Cast List ******\n");
+for (i = 0; i < swig_module.size; ++i) {
int j = 0;
swig_cast_info *cast = swig_module.cast_initial[i];
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
while (cast->type) {
- printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
- cast++;
- ++j;
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
}
- printf("---- Total casts: %d\n",j);
- }
- printf("**** SWIG_InitializeModule: Cast List ******\n");
+ printf("---- Total casts: %d\n",j);
+}
+printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}
@@ -4145,31 +4486,36 @@ SWIG_InitializeModule(void *clientdata) {
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
-SWIG_PropagateClientData(void) {
- size_t i;
- swig_cast_info *equiv;
- static int init_run = 0;
+SWIG_PropagateClientData(void)
+{
+size_t i;
+swig_cast_info *equiv;
+static int init_run = 0;
- if (init_run) return;
- init_run = 1;
+if (init_run) {
+ return;
+}
+init_run = 1;
- for (i = 0; i < swig_module.size; i++) {
+for (i = 0; i < swig_module.size; i++) {
if (swig_module.types[i]->clientdata) {
- equiv = swig_module.types[i]->cast;
- while (equiv) {
- if (!equiv->converter) {
- if (equiv->type && !equiv->type->clientdata)
- SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ equiv = swig_module.types[i]->cast;
+ while (equiv) {
+ if (!equiv->converter) {
+ if (equiv->type && !equiv->type->clientdata) {
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ }
+ }
+ equiv = equiv->next;
}
- equiv = equiv->next;
- }
}
- }
+}
}
#ifdef __cplusplus
#if 0
-{ /* c-mode */
+{
+ /* c-mode */
#endif
}
#endif
@@ -4180,114 +4526,115 @@ SWIG_PropagateClientData(void) {
#ifdef __cplusplus
extern "C"
#endif
-SWIGEXPORT void Init_tinyWRAP(void) {
- size_t i;
-
- SWIG_InitRuntime();
- mTinyWRAP = rb_define_module("TinyWRAP");
-
- SWIG_InitializeModule(0);
- for (i = 0; i < swig_module.size; i++) {
+SWIGEXPORT void Init_tinyWRAP(void)
+{
+size_t i;
+
+SWIG_InitRuntime();
+mTinyWRAP = rb_define_module("TinyWRAP");
+
+SWIG_InitializeModule(0);
+for (i = 0; i < swig_module.size; i++) {
SWIG_define_class(swig_module.types[i]);
- }
-
- SWIG_RubyInitializeTrackings();
-
- SwigClassSipEvent.klass = rb_define_class_under(mTinyWRAP, "SipEvent", rb_cObject);
- SWIG_TypeClientData(SWIGTYPE_p_SipEvent, (void *) &SwigClassSipEvent);
- rb_define_alloc_func(SwigClassSipEvent.klass, _wrap_SipEvent_allocate);
- rb_define_method(SwigClassSipEvent.klass, "initialize", VALUEFUNC(_wrap_new_SipEvent), -1);
- rb_define_method(SwigClassSipEvent.klass, "getCode", VALUEFUNC(_wrap_SipEvent_getCode), -1);
- rb_define_method(SwigClassSipEvent.klass, "getPhrase", VALUEFUNC(_wrap_SipEvent_getPhrase), -1);
- rb_define_method(SwigClassSipEvent.klass, "getBaseSession", VALUEFUNC(_wrap_SipEvent_getBaseSession), -1);
- SwigClassSipEvent.mark = 0;
- SwigClassSipEvent.destroy = (void (*)(void *)) free_SipEvent;
- SwigClassSipEvent.trackObjects = 0;
-
- SwigClassSipSession.klass = rb_define_class_under(mTinyWRAP, "SipSession", rb_cObject);
- SWIG_TypeClientData(SWIGTYPE_p_SipSession, (void *) &SwigClassSipSession);
- rb_define_alloc_func(SwigClassSipSession.klass, _wrap_SipSession_allocate);
- rb_define_method(SwigClassSipSession.klass, "initialize", VALUEFUNC(_wrap_new_SipSession), -1);
- rb_define_method(SwigClassSipSession.klass, "addHeader", VALUEFUNC(_wrap_SipSession_addHeader), -1);
- rb_define_method(SwigClassSipSession.klass, "removeHeader", VALUEFUNC(_wrap_SipSession_removeHeader), -1);
- rb_define_method(SwigClassSipSession.klass, "addCaps", VALUEFUNC(_wrap_SipSession_addCaps), -1);
- rb_define_method(SwigClassSipSession.klass, "removeCaps", VALUEFUNC(_wrap_SipSession_removeCaps), -1);
- rb_define_method(SwigClassSipSession.klass, "setExpires", VALUEFUNC(_wrap_SipSession_setExpires), -1);
- rb_define_method(SwigClassSipSession.klass, "setFromUri", VALUEFUNC(_wrap_SipSession_setFromUri), -1);
- rb_define_method(SwigClassSipSession.klass, "setToUri", VALUEFUNC(_wrap_SipSession_setToUri), -1);
- SwigClassSipSession.mark = 0;
- SwigClassSipSession.destroy = (void (*)(void *)) free_SipSession;
- SwigClassSipSession.trackObjects = 0;
-
- SwigClassRegistrationEvent.klass = rb_define_class_under(mTinyWRAP, "RegistrationEvent", ((swig_class *) SWIGTYPE_p_SipEvent->clientdata)->klass);
- SWIG_TypeClientData(SWIGTYPE_p_RegistrationEvent, (void *) &SwigClassRegistrationEvent);
- rb_define_alloc_func(SwigClassRegistrationEvent.klass, _wrap_RegistrationEvent_allocate);
- rb_define_method(SwigClassRegistrationEvent.klass, "initialize", VALUEFUNC(_wrap_new_RegistrationEvent), -1);
- rb_define_method(SwigClassRegistrationEvent.klass, "getType", VALUEFUNC(_wrap_RegistrationEvent_getType), -1);
- rb_define_method(SwigClassRegistrationEvent.klass, "getSession", VALUEFUNC(_wrap_RegistrationEvent_getSession), -1);
- SwigClassRegistrationEvent.mark = 0;
- SwigClassRegistrationEvent.destroy = (void (*)(void *)) free_RegistrationEvent;
- SwigClassRegistrationEvent.trackObjects = 0;
-
- SwigClassRegistrationSession.klass = rb_define_class_under(mTinyWRAP, "RegistrationSession", ((swig_class *) SWIGTYPE_p_SipSession->clientdata)->klass);
- SWIG_TypeClientData(SWIGTYPE_p_RegistrationSession, (void *) &SwigClassRegistrationSession);
- rb_define_alloc_func(SwigClassRegistrationSession.klass, _wrap_RegistrationSession_allocate);
- rb_define_method(SwigClassRegistrationSession.klass, "initialize", VALUEFUNC(_wrap_new_RegistrationSession), -1);
- rb_define_method(SwigClassRegistrationSession.klass, "Register", VALUEFUNC(_wrap_RegistrationSession_Register), -1);
- rb_define_method(SwigClassRegistrationSession.klass, "UnRegister", VALUEFUNC(_wrap_RegistrationSession_UnRegister), -1);
- SwigClassRegistrationSession.mark = 0;
- SwigClassRegistrationSession.destroy = (void (*)(void *)) free_RegistrationSession;
- SwigClassRegistrationSession.trackObjects = 0;
- rb_define_module_function(mTinyWRAP, "disown_SipCallback", VALUEFUNC(_wrap_disown_SipCallback), -1);
-
- SwigClassSipCallback.klass = rb_define_class_under(mTinyWRAP, "SipCallback", rb_cObject);
- SWIG_TypeClientData(SWIGTYPE_p_SipCallback, (void *) &SwigClassSipCallback);
- rb_define_alloc_func(SwigClassSipCallback.klass, _wrap_SipCallback_allocate);
- rb_define_method(SwigClassSipCallback.klass, "initialize", VALUEFUNC(_wrap_new_SipCallback), -1);
- rb_define_method(SwigClassSipCallback.klass, "OnRegistrationChanged", VALUEFUNC(_wrap_SipCallback_OnRegistrationChanged), -1);
- SwigClassSipCallback.mark = 0;
- SwigClassSipCallback.destroy = (void (*)(void *)) free_SipCallback;
- SwigClassSipCallback.trackObjects = 0;
-
- SwigClassSafeObject.klass = rb_define_class_under(mTinyWRAP, "SafeObject", rb_cObject);
- SWIG_TypeClientData(SWIGTYPE_p_SafeObject, (void *) &SwigClassSafeObject);
- rb_define_alloc_func(SwigClassSafeObject.klass, _wrap_SafeObject_allocate);
- rb_define_method(SwigClassSafeObject.klass, "initialize", VALUEFUNC(_wrap_new_SafeObject), -1);
- rb_define_method(SwigClassSafeObject.klass, "Lock", VALUEFUNC(_wrap_SafeObject_Lock), -1);
- rb_define_method(SwigClassSafeObject.klass, "UnLock", VALUEFUNC(_wrap_SafeObject_UnLock), -1);
- SwigClassSafeObject.mark = 0;
- SwigClassSafeObject.destroy = (void (*)(void *)) free_SafeObject;
- SwigClassSafeObject.trackObjects = 0;
-
- SwigClassSipStack.klass = rb_define_class_under(mTinyWRAP, "SipStack", ((swig_class *) SWIGTYPE_p_SafeObject->clientdata)->klass);
- SWIG_TypeClientData(SWIGTYPE_p_SipStack, (void *) &SwigClassSipStack);
- rb_define_alloc_func(SwigClassSipStack.klass, _wrap_SipStack_allocate);
- rb_define_method(SwigClassSipStack.klass, "initialize", VALUEFUNC(_wrap_new_SipStack), -1);
- rb_define_method(SwigClassSipStack.klass, "Start", VALUEFUNC(_wrap_SipStack_Start), -1);
- rb_define_method(SwigClassSipStack.klass, "setPassword", VALUEFUNC(_wrap_SipStack_setPassword), -1);
- rb_define_method(SwigClassSipStack.klass, "setProxyCSCF", VALUEFUNC(_wrap_SipStack_setProxyCSCF), -1);
- rb_define_method(SwigClassSipStack.klass, "setLocalIP", VALUEFUNC(_wrap_SipStack_setLocalIP), -1);
- rb_define_method(SwigClassSipStack.klass, "setLocalPort", VALUEFUNC(_wrap_SipStack_setLocalPort), -1);
- rb_define_method(SwigClassSipStack.klass, "addHeader", VALUEFUNC(_wrap_SipStack_addHeader), -1);
- rb_define_method(SwigClassSipStack.klass, "removeHeader", VALUEFUNC(_wrap_SipStack_removeHeader), -1);
- rb_define_method(SwigClassSipStack.klass, "Stop", VALUEFUNC(_wrap_SipStack_Stop), -1);
- SwigClassSipStack.mark = 0;
- SwigClassSipStack.destroy = (void (*)(void *)) free_SipStack;
- SwigClassSipStack.trackObjects = 0;
- rb_define_const(mTinyWRAP, "Tsip_event_invite", SWIG_From_int(static_cast< int >(tsip_event_invite)));
- rb_define_const(mTinyWRAP, "Tsip_event_message", SWIG_From_int(static_cast< int >(tsip_event_message)));
- rb_define_const(mTinyWRAP, "Tsip_event_options", SWIG_From_int(static_cast< int >(tsip_event_options)));
- rb_define_const(mTinyWRAP, "Tsip_event_publish", SWIG_From_int(static_cast< int >(tsip_event_publish)));
- rb_define_const(mTinyWRAP, "Tsip_event_register", SWIG_From_int(static_cast< int >(tsip_event_register)));
- rb_define_const(mTinyWRAP, "Tsip_event_subscribe", SWIG_From_int(static_cast< int >(tsip_event_subscribe)));
- rb_define_const(mTinyWRAP, "Tsip_event_dialog", SWIG_From_int(static_cast< int >(tsip_event_dialog)));
- rb_define_const(mTinyWRAP, "Tsip_i_register", SWIG_From_int(static_cast< int >(tsip_i_register)));
- rb_define_const(mTinyWRAP, "Tsip_ai_register", SWIG_From_int(static_cast< int >(tsip_ai_register)));
- rb_define_const(mTinyWRAP, "Tsip_o_register", SWIG_From_int(static_cast< int >(tsip_o_register)));
- rb_define_const(mTinyWRAP, "Tsip_ao_register", SWIG_From_int(static_cast< int >(tsip_ao_register)));
- rb_define_const(mTinyWRAP, "Tsip_i_unregister", SWIG_From_int(static_cast< int >(tsip_i_unregister)));
- rb_define_const(mTinyWRAP, "Tsip_ai_unregister", SWIG_From_int(static_cast< int >(tsip_ai_unregister)));
- rb_define_const(mTinyWRAP, "Tsip_o_unregister", SWIG_From_int(static_cast< int >(tsip_o_unregister)));
- rb_define_const(mTinyWRAP, "Tsip_ao_unregister", SWIG_From_int(static_cast< int >(tsip_ao_unregister)));
+}
+
+SWIG_RubyInitializeTrackings();
+
+SwigClassSipEvent.klass = rb_define_class_under(mTinyWRAP, "SipEvent", rb_cObject);
+SWIG_TypeClientData(SWIGTYPE_p_SipEvent, (void *) &SwigClassSipEvent);
+rb_define_alloc_func(SwigClassSipEvent.klass, _wrap_SipEvent_allocate);
+rb_define_method(SwigClassSipEvent.klass, "initialize", VALUEFUNC(_wrap_new_SipEvent), -1);
+rb_define_method(SwigClassSipEvent.klass, "getCode", VALUEFUNC(_wrap_SipEvent_getCode), -1);
+rb_define_method(SwigClassSipEvent.klass, "getPhrase", VALUEFUNC(_wrap_SipEvent_getPhrase), -1);
+rb_define_method(SwigClassSipEvent.klass, "getBaseSession", VALUEFUNC(_wrap_SipEvent_getBaseSession), -1);
+SwigClassSipEvent.mark = 0;
+SwigClassSipEvent.destroy = (void (*)(void *)) free_SipEvent;
+SwigClassSipEvent.trackObjects = 0;
+
+SwigClassSipSession.klass = rb_define_class_under(mTinyWRAP, "SipSession", rb_cObject);
+SWIG_TypeClientData(SWIGTYPE_p_SipSession, (void *) &SwigClassSipSession);
+rb_define_alloc_func(SwigClassSipSession.klass, _wrap_SipSession_allocate);
+rb_define_method(SwigClassSipSession.klass, "initialize", VALUEFUNC(_wrap_new_SipSession), -1);
+rb_define_method(SwigClassSipSession.klass, "addHeader", VALUEFUNC(_wrap_SipSession_addHeader), -1);
+rb_define_method(SwigClassSipSession.klass, "removeHeader", VALUEFUNC(_wrap_SipSession_removeHeader), -1);
+rb_define_method(SwigClassSipSession.klass, "addCaps", VALUEFUNC(_wrap_SipSession_addCaps), -1);
+rb_define_method(SwigClassSipSession.klass, "removeCaps", VALUEFUNC(_wrap_SipSession_removeCaps), -1);
+rb_define_method(SwigClassSipSession.klass, "setExpires", VALUEFUNC(_wrap_SipSession_setExpires), -1);
+rb_define_method(SwigClassSipSession.klass, "setFromUri", VALUEFUNC(_wrap_SipSession_setFromUri), -1);
+rb_define_method(SwigClassSipSession.klass, "setToUri", VALUEFUNC(_wrap_SipSession_setToUri), -1);
+SwigClassSipSession.mark = 0;
+SwigClassSipSession.destroy = (void (*)(void *)) free_SipSession;
+SwigClassSipSession.trackObjects = 0;
+
+SwigClassRegistrationEvent.klass = rb_define_class_under(mTinyWRAP, "RegistrationEvent", ((swig_class *) SWIGTYPE_p_SipEvent->clientdata)->klass);
+SWIG_TypeClientData(SWIGTYPE_p_RegistrationEvent, (void *) &SwigClassRegistrationEvent);
+rb_define_alloc_func(SwigClassRegistrationEvent.klass, _wrap_RegistrationEvent_allocate);
+rb_define_method(SwigClassRegistrationEvent.klass, "initialize", VALUEFUNC(_wrap_new_RegistrationEvent), -1);
+rb_define_method(SwigClassRegistrationEvent.klass, "getType", VALUEFUNC(_wrap_RegistrationEvent_getType), -1);
+rb_define_method(SwigClassRegistrationEvent.klass, "getSession", VALUEFUNC(_wrap_RegistrationEvent_getSession), -1);
+SwigClassRegistrationEvent.mark = 0;
+SwigClassRegistrationEvent.destroy = (void (*)(void *)) free_RegistrationEvent;
+SwigClassRegistrationEvent.trackObjects = 0;
+
+SwigClassRegistrationSession.klass = rb_define_class_under(mTinyWRAP, "RegistrationSession", ((swig_class *) SWIGTYPE_p_SipSession->clientdata)->klass);
+SWIG_TypeClientData(SWIGTYPE_p_RegistrationSession, (void *) &SwigClassRegistrationSession);
+rb_define_alloc_func(SwigClassRegistrationSession.klass, _wrap_RegistrationSession_allocate);
+rb_define_method(SwigClassRegistrationSession.klass, "initialize", VALUEFUNC(_wrap_new_RegistrationSession), -1);
+rb_define_method(SwigClassRegistrationSession.klass, "Register", VALUEFUNC(_wrap_RegistrationSession_Register), -1);
+rb_define_method(SwigClassRegistrationSession.klass, "UnRegister", VALUEFUNC(_wrap_RegistrationSession_UnRegister), -1);
+SwigClassRegistrationSession.mark = 0;
+SwigClassRegistrationSession.destroy = (void (*)(void *)) free_RegistrationSession;
+SwigClassRegistrationSession.trackObjects = 0;
+rb_define_module_function(mTinyWRAP, "disown_SipCallback", VALUEFUNC(_wrap_disown_SipCallback), -1);
+
+SwigClassSipCallback.klass = rb_define_class_under(mTinyWRAP, "SipCallback", rb_cObject);
+SWIG_TypeClientData(SWIGTYPE_p_SipCallback, (void *) &SwigClassSipCallback);
+rb_define_alloc_func(SwigClassSipCallback.klass, _wrap_SipCallback_allocate);
+rb_define_method(SwigClassSipCallback.klass, "initialize", VALUEFUNC(_wrap_new_SipCallback), -1);
+rb_define_method(SwigClassSipCallback.klass, "OnRegistrationChanged", VALUEFUNC(_wrap_SipCallback_OnRegistrationChanged), -1);
+SwigClassSipCallback.mark = 0;
+SwigClassSipCallback.destroy = (void (*)(void *)) free_SipCallback;
+SwigClassSipCallback.trackObjects = 0;
+
+SwigClassSafeObject.klass = rb_define_class_under(mTinyWRAP, "SafeObject", rb_cObject);
+SWIG_TypeClientData(SWIGTYPE_p_SafeObject, (void *) &SwigClassSafeObject);
+rb_define_alloc_func(SwigClassSafeObject.klass, _wrap_SafeObject_allocate);
+rb_define_method(SwigClassSafeObject.klass, "initialize", VALUEFUNC(_wrap_new_SafeObject), -1);
+rb_define_method(SwigClassSafeObject.klass, "Lock", VALUEFUNC(_wrap_SafeObject_Lock), -1);
+rb_define_method(SwigClassSafeObject.klass, "UnLock", VALUEFUNC(_wrap_SafeObject_UnLock), -1);
+SwigClassSafeObject.mark = 0;
+SwigClassSafeObject.destroy = (void (*)(void *)) free_SafeObject;
+SwigClassSafeObject.trackObjects = 0;
+
+SwigClassSipStack.klass = rb_define_class_under(mTinyWRAP, "SipStack", ((swig_class *) SWIGTYPE_p_SafeObject->clientdata)->klass);
+SWIG_TypeClientData(SWIGTYPE_p_SipStack, (void *) &SwigClassSipStack);
+rb_define_alloc_func(SwigClassSipStack.klass, _wrap_SipStack_allocate);
+rb_define_method(SwigClassSipStack.klass, "initialize", VALUEFUNC(_wrap_new_SipStack), -1);
+rb_define_method(SwigClassSipStack.klass, "Start", VALUEFUNC(_wrap_SipStack_Start), -1);
+rb_define_method(SwigClassSipStack.klass, "setPassword", VALUEFUNC(_wrap_SipStack_setPassword), -1);
+rb_define_method(SwigClassSipStack.klass, "setProxyCSCF", VALUEFUNC(_wrap_SipStack_setProxyCSCF), -1);
+rb_define_method(SwigClassSipStack.klass, "setLocalIP", VALUEFUNC(_wrap_SipStack_setLocalIP), -1);
+rb_define_method(SwigClassSipStack.klass, "setLocalPort", VALUEFUNC(_wrap_SipStack_setLocalPort), -1);
+rb_define_method(SwigClassSipStack.klass, "addHeader", VALUEFUNC(_wrap_SipStack_addHeader), -1);
+rb_define_method(SwigClassSipStack.klass, "removeHeader", VALUEFUNC(_wrap_SipStack_removeHeader), -1);
+rb_define_method(SwigClassSipStack.klass, "Stop", VALUEFUNC(_wrap_SipStack_Stop), -1);
+SwigClassSipStack.mark = 0;
+SwigClassSipStack.destroy = (void (*)(void *)) free_SipStack;
+SwigClassSipStack.trackObjects = 0;
+rb_define_const(mTinyWRAP, "Tsip_event_invite", SWIG_From_int(static_cast< int >(tsip_event_invite)));
+rb_define_const(mTinyWRAP, "Tsip_event_message", SWIG_From_int(static_cast< int >(tsip_event_message)));
+rb_define_const(mTinyWRAP, "Tsip_event_options", SWIG_From_int(static_cast< int >(tsip_event_options)));
+rb_define_const(mTinyWRAP, "Tsip_event_publish", SWIG_From_int(static_cast< int >(tsip_event_publish)));
+rb_define_const(mTinyWRAP, "Tsip_event_register", SWIG_From_int(static_cast< int >(tsip_event_register)));
+rb_define_const(mTinyWRAP, "Tsip_event_subscribe", SWIG_From_int(static_cast< int >(tsip_event_subscribe)));
+rb_define_const(mTinyWRAP, "Tsip_event_dialog", SWIG_From_int(static_cast< int >(tsip_event_dialog)));
+rb_define_const(mTinyWRAP, "Tsip_i_register", SWIG_From_int(static_cast< int >(tsip_i_register)));
+rb_define_const(mTinyWRAP, "Tsip_ai_register", SWIG_From_int(static_cast< int >(tsip_ai_register)));
+rb_define_const(mTinyWRAP, "Tsip_o_register", SWIG_From_int(static_cast< int >(tsip_o_register)));
+rb_define_const(mTinyWRAP, "Tsip_ao_register", SWIG_From_int(static_cast< int >(tsip_ao_register)));
+rb_define_const(mTinyWRAP, "Tsip_i_unregister", SWIG_From_int(static_cast< int >(tsip_i_unregister)));
+rb_define_const(mTinyWRAP, "Tsip_ai_unregister", SWIG_From_int(static_cast< int >(tsip_ai_unregister)));
+rb_define_const(mTinyWRAP, "Tsip_o_unregister", SWIG_From_int(static_cast< int >(tsip_o_unregister)));
+rb_define_const(mTinyWRAP, "Tsip_ao_unregister", SWIG_From_int(static_cast< int >(tsip_ao_unregister)));
}
diff --git a/bindings/ruby/tinyWRAP_wrap.h b/bindings/ruby/tinyWRAP_wrap.h
index 5320a3f4..3943f13 100755
--- a/bindings/ruby/tinyWRAP_wrap.h
+++ b/bindings/ruby/tinyWRAP_wrap.h
@@ -1,22 +1,24 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.40
- *
- * This file is not intended to be easily readable and contains a number of
+ *
+ * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
- * changes to this file unless you know what you are doing--modify the SWIG
- * interface file instead.
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
* ----------------------------------------------------------------------------- */
#ifndef SWIG_TinyWRAP_WRAP_H_
#define SWIG_TinyWRAP_WRAP_H_
-namespace Swig {
- class Director;
+namespace Swig
+{
+class Director;
}
-class SwigDirector_SipCallback : public SipCallback, public Swig::Director {
+class SwigDirector_SipCallback : public SipCallback, public Swig::Director
+{
public:
SwigDirector_SipCallback(VALUE self);
diff --git a/bindings/winrt/doubango_rt/include/rt_ActionConfig.h b/bindings/winrt/doubango_rt/include/rt_ActionConfig.h
index abafc37..25a5809 100755
--- a/bindings/winrt/doubango_rt/include/rt_ActionConfig.h
+++ b/bindings/winrt/doubango_rt/include/rt_ActionConfig.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -23,31 +23,33 @@ class ActionConfig;
namespace doubango_rt
{
- namespace BackEnd
- {
- public ref class rtActionConfig sealed
- {
- public:
- rtActionConfig();
- virtual ~rtActionConfig();
-
- bool addHeader(Platform::String^ name, Platform::String^ value);
+namespace BackEnd
+{
+public ref class rtActionConfig sealed
+{
+public:
+ rtActionConfig();
+ virtual ~rtActionConfig();
+
+ bool addHeader(Platform::String^ name, Platform::String^ value);
#if COM_VISIBLE
- bool addPayload(Platform::String^ payload);
+ bool addPayload(Platform::String^ payload);
#else
- bool addPayload(Platform::IntPtr payload, unsigned len);
+ bool addPayload(Platform::IntPtr payload, unsigned len);
#endif
- bool setActiveMedia(rt_twrap_media_type_t type);
-
- rtActionConfig^ setResponseLine(short code, Platform::String^ phrase);
- rtActionConfig^ setMediaString(rt_twrap_media_type_t type, Platform::String^ key, Platform::String^ value);
- rtActionConfig^ setMediaInt(rt_twrap_media_type_t type, Platform::String^ key, int value);
+ bool setActiveMedia(rt_twrap_media_type_t type);
+
+ rtActionConfig^ setResponseLine(short code, Platform::String^ phrase);
+ rtActionConfig^ setMediaString(rt_twrap_media_type_t type, Platform::String^ key, Platform::String^ value);
+ rtActionConfig^ setMediaInt(rt_twrap_media_type_t type, Platform::String^ key, int value);
- internal:
- ActionConfig* getWrappedActionConfig(){ return m_pActionConfig; }
+internal:
+ ActionConfig* getWrappedActionConfig() {
+ return m_pActionConfig;
+ }
- private:
- ActionConfig* m_pActionConfig;
- };
- }
+private:
+ ActionConfig* m_pActionConfig;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_Config.h b/bindings/winrt/doubango_rt/include/rt_Config.h
index e8d7dde..d5fb7eb 100755
--- a/bindings/winrt/doubango_rt/include/rt_Config.h
+++ b/bindings/winrt/doubango_rt/include/rt_Config.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -20,7 +20,7 @@
#define rtSafeDelete(ptr) if((ptr)) delete (ptr), (ptr) = nullptr;
#if COM_VISIBLE
-# define OVERRIDE_FUNC(fun)
+# define OVERRIDE_FUNC(fun)
# define VISIBLE_VOID_PTR Platform::String^
# define VISIBLE_VOID_PTR_2_VOID_PTR(ptr) rtString::toUtf8((ptr)).data()
#else
@@ -28,4 +28,3 @@
# define VISIBLE_VOID_PTR Platform::IntPtr
# define VISIBLE_VOID_PTR_2_VOID_PTR(ptr) (void*)((ptr))
#endif
- \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_DDebug.h b/bindings/winrt/doubango_rt/include/rt_DDebug.h
index e4300b5..8973271 100755
--- a/bindings/winrt/doubango_rt/include/rt_DDebug.h
+++ b/bindings/winrt/doubango_rt/include/rt_DDebug.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -24,30 +24,30 @@ class DDebugCallbackProxy;
namespace doubango_rt
{
- namespace BackEnd
- {
- public interface class rtIDDebugCallback
- {
- virtual int OnDebugInfo(Platform::String^ message);
- virtual int OnDebugWarn(Platform::String^ message);
- virtual int OnDebugError(Platform::String^ message);
- virtual int OnDebugFatal(Platform::String^ message);
- };
+namespace BackEnd
+{
+public interface class rtIDDebugCallback
+{
+ virtual int OnDebugInfo(Platform::String^ message);
+ virtual int OnDebugWarn(Platform::String^ message);
+ virtual int OnDebugError(Platform::String^ message);
+ virtual int OnDebugFatal(Platform::String^ message);
+};
+
+public ref class rtDDebugCallback sealed
+{
+internal:
+ rtDDebugCallback(rtIDDebugCallback^ pI);
+public:
+ virtual ~rtDDebugCallback();
+ friend class DDebugCallbackProxy;
- public ref class rtDDebugCallback sealed
- {
- internal:
- rtDDebugCallback(rtIDDebugCallback^ pI);
- public:
- virtual ~rtDDebugCallback();
- friend class DDebugCallbackProxy;
-
- internal:
- const DDebugCallback* getWrappedCallback();
+internal:
+ const DDebugCallback* getWrappedCallback();
- private:
- rtIDDebugCallback^ m_pI;
- DDebugCallbackProxy* m_pCallback;
- };
- }
+private:
+ rtIDDebugCallback^ m_pI;
+ DDebugCallbackProxy* m_pCallback;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_Enums.h b/bindings/winrt/doubango_rt/include/rt_Enums.h
index 78e97bf..843a501 100755
--- a/bindings/winrt/doubango_rt/include/rt_Enums.h
+++ b/bindings/winrt/doubango_rt/include/rt_Enums.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -27,307 +27,308 @@
namespace doubango_rt
{
- namespace BackEnd
- {
- public enum class rtConstants
- {
- rt_tsip_event_code_dialog_transport_error = tsip_event_code_dialog_transport_error,
- rt_tsip_event_code_dialog_global_error = tsip_event_code_dialog_global_error,
- rt_tsip_event_code_dialog_message_error = tsip_event_code_dialog_message_error,
-
- // 8xx ==> success
- rt_tsip_event_code_dialog_request_incoming = tsip_event_code_dialog_request_incoming,
- rt_tsip_event_code_dialog_request_outgoing = tsip_event_code_dialog_request_outgoing,
- rt_tsip_event_code_dialog_request_cancelled = tsip_event_code_dialog_request_cancelled,
- rt_tsip_event_code_dialog_request_sent = tsip_event_code_dialog_request_sent,
-
- // 9xx ==> Informational
- rt_tsip_event_code_dialog_connecting = tsip_event_code_dialog_connecting,
- rt_tsip_event_code_dialog_connected = tsip_event_code_dialog_connected,
- rt_tsip_event_code_dialog_terminating = tsip_event_code_dialog_terminating,
- rt_tsip_event_code_dialog_terminated = tsip_event_code_dialog_terminated,
- rt_tsip_event_code_stack_starting = tsip_event_code_stack_starting,
- rt_tsip_event_code_stack_started = tsip_event_code_stack_started,
- rt_tsip_event_code_stack_stopping = tsip_event_code_stack_stopping,
- rt_tsip_event_code_stack_stopped = tsip_event_code_stack_stopped,
- rt_tsip_event_code_stack_failed_to_start = tsip_event_code_stack_failed_to_start,
- rt_tsip_event_code_stack_failed_to_stop = tsip_event_code_stack_failed_to_stop
- };
-
- public enum class rt_twrap_media_type_t
- {
- twrap_media_none = twrap_media_none,
-
- twrap_media_audio = twrap_media_audio,
- twrap_media_video = twrap_media_video,
- twrap_media_msrp = twrap_media_msrp,
- twrap_media_t140 = twrap_media_t140,
- twrap_media_bfcp = twrap_media_bfcp,
- twrap_media_bfcp_audio = twrap_media_bfcp_audio,
- twrap_media_bfcp_video = twrap_media_bfcp_video,
-
- twrap_media_audiovideo = twrap_media_audiovideo, /* @deprecated */
- twrap_media_audio_video = twrap_media_audio_video,
- };
-
- public enum class rt_tmedia_bandwidth_level_t
- {
- tmedia_bl_low = tmedia_bl_low,
- tmedia_bl_medium = tmedia_bl_medium,
- tmedia_bl_hight = tmedia_bl_hight,
- tmedia_bl_unrestricted = tmedia_bl_unrestricted
- };
-
- public enum class rt_tmedia_pref_video_size_t
- {/* must be sorted like this */
- tmedia_pref_video_size_sqcif = tmedia_pref_video_size_sqcif, // 128 x 98
- tmedia_pref_video_size_qcif = tmedia_pref_video_size_qcif, // 176 x 144
- tmedia_pref_video_size_qvga = tmedia_pref_video_size_qvga, // 320 x 240
- tmedia_pref_video_size_cif = tmedia_pref_video_size_cif, // 352 x 288
- tmedia_pref_video_size_hvga = tmedia_pref_video_size_hvga, // 480 x 320
- tmedia_pref_video_size_vga = tmedia_pref_video_size_vga, // 640 x 480
- tmedia_pref_video_size_4cif = tmedia_pref_video_size_4cif, // 704 x 576
- tmedia_pref_video_size_wvga = tmedia_pref_video_size_wvga, // 800 x 480
- tmedia_pref_video_size_svga = tmedia_pref_video_size_svga, // 800 x 600
- tmedia_pref_video_size_480p = tmedia_pref_video_size_480p, // 852 x 480
- tmedia_pref_video_size_xga = tmedia_pref_video_size_xga, // 1024 x 768
- tmedia_pref_video_size_720p = tmedia_pref_video_size_720p, // 1280 x 720
- tmedia_pref_video_size_16cif = tmedia_pref_video_size_16cif, // 1408 x 1152
- tmedia_pref_video_size_1080p = tmedia_pref_video_size_1080p, // 1920 x 1080
- };
-
- public enum class rt_tmedia_profile_t
- {
- tmedia_profile_default = tmedia_profile_default,
- tmedia_profile_rtcweb = tmedia_profile_rtcweb
- };
-
- public enum class rt_tmedia_qos_strength_t
- {
- tmedia_qos_strength_none = tmedia_qos_strength_none,
- tmedia_qos_strength_failure = tmedia_qos_strength_failure,
- tmedia_qos_strength_unknown = tmedia_qos_strength_unknown,
- tmedia_qos_strength_optional = tmedia_qos_strength_optional,
- tmedia_qos_strength_mandatory = tmedia_qos_strength_mandatory
- };
-
- public enum class rt_tmedia_qos_stype_t
- {
- tmedia_qos_stype_none = tmedia_qos_stype_none,
-
- tmedia_qos_stype_segmented = tmedia_qos_stype_segmented,
- tmedia_qos_stype_e2e = tmedia_qos_stype_e2e,
- };
-
- public enum class rt_tmedia_srtp_mode_t
- {
- tmedia_srtp_mode_none = tmedia_srtp_mode_none,
- tmedia_srtp_mode_optional = tmedia_srtp_mode_optional,
- tmedia_srtp_mode_mandatory = tmedia_srtp_mode_mandatory
- };
-
- public enum class rt_tmedia_srtp_type_t
- {
- tmedia_srtp_type_none = tmedia_srtp_type_none,
- tmedia_srtp_type_sdes = tmedia_srtp_type_sdes,
- tmedia_srtp_type_dtls = tmedia_srtp_type_dtls,
- tmedia_srtp_type_sdes_dtls = tmedia_srtp_type_sdes_dtls
- };
-
- public enum class rt_tmedia_t140_data_type_t
- {
- tmedia_t140_data_type_utf8 = tmedia_t140_data_type_utf8,
- tmedia_t140_data_type_zero_width_no_break_space = tmedia_t140_data_type_zero_width_no_break_space,
- tmedia_t140_data_type_backspace = tmedia_t140_data_type_backspace,
- tmedia_t140_data_type_esc = tmedia_t140_data_type_esc,
- tmedia_t140_data_type_cr = tmedia_t140_data_type_cr,
- tmedia_t140_data_type_lf = tmedia_t140_data_type_lf,
- tmedia_t140_data_type_cr_lf = tmedia_t140_data_type_cr_lf,
- tmedia_t140_data_type_bell = tmedia_t140_data_type_bell,
- tmedia_t140_data_type_sos = tmedia_t140_data_type_sos,
- tmedia_t140_data_type_string_term = tmedia_t140_data_type_string_term,
- tmedia_t140_data_type_graphic_start = tmedia_t140_data_type_graphic_start,
- tmedia_t140_data_type_graphic_end = tmedia_t140_data_type_graphic_end,
- tmedia_t140_data_type_loss_char_char = tmedia_t140_data_type_loss_char_char,
- tmedia_t140_data_type_loss_utf8 = tmedia_t140_data_type_loss_utf8,
- };
-
- public enum class rt_tmedia_type_t
- {
- tmedia_none = tmedia_none,
- tmedia_ghost = tmedia_ghost,
-
- tmedia_audio = tmedia_audio,
- tmedia_video = tmedia_video,
- tmedia_chat = tmedia_chat,
- tmedia_file = tmedia_file,
- tmedia_t38 = tmedia_t38,
- tmedia_t140 = tmedia_t140,
-
- tmedia_msrp = tmedia_msrp,
- tmedia_audiovideo = tmedia_audiovideo,
-
- tmedia_all = tmedia_all
- };
-
- public enum class rt_tmsrp_event_type_t
- {
- tmsrp_event_type_none = tmsrp_event_type_none,
- tmsrp_event_type_connected = tmsrp_event_type_connected,
- tmsrp_event_type_disconnected = tmsrp_event_type_disconnected,
- tmsrp_event_type_message = tmsrp_event_type_message,
- };
-
- public enum class rt_tmsrp_request_type_t
- {
- tmsrp_NONE = tmsrp_NONE,
-
- tmsrp_SEND = tmsrp_SEND,
- tmsrp_REPORT = tmsrp_REPORT,
- tmsrp_AUTH = tmsrp_AUTH
- };
-
- public enum class rt_tsip_info_event_type_t
- {
- tsip_i_info = tsip_i_info,
- tsip_ao_info = tsip_ao_info,
- };
-
- public enum class rt_tsip_invite_event_type_t
- {
- tsip_i_newcall = tsip_i_newcall,
-
- tsip_i_request = tsip_i_request,
- tsip_ao_request = tsip_ao_request,
-
- tsip_o_ect_trying = tsip_o_ect_trying,
- tsip_o_ect_accepted = tsip_o_ect_accepted,
- tsip_o_ect_completed = tsip_o_ect_completed,
- tsip_o_ect_failed = tsip_o_ect_failed,
- tsip_o_ect_notify = tsip_o_ect_notify,
- tsip_i_ect_requested = tsip_i_ect_requested,
- tsip_i_ect_newcall = tsip_i_ect_newcall,
- tsip_i_ect_completed = tsip_i_ect_completed,
- tsip_i_ect_failed = tsip_i_ect_failed,
- tsip_i_ect_notify = tsip_i_ect_notify,
-
- tsip_m_early_media = tsip_m_early_media,
- tsip_m_updating = tsip_m_updating,
- tsip_m_updated = tsip_m_updated,
-
- tsip_m_local_hold_ok = tsip_m_local_hold_ok,
- tsip_m_local_hold_nok = tsip_m_local_hold_nok,
- tsip_m_local_resume_ok = tsip_m_local_resume_ok,
- tsip_m_local_resume_nok = tsip_m_local_resume_nok,
- tsip_m_remote_hold = tsip_m_remote_hold,
- tsip_m_remote_resume = tsip_m_remote_resume,
- };
-
- public enum class rt_tsip_message_event_type_t
- {
- tsip_i_message = tsip_i_message,
- tsip_ao_message = tsip_ao_message,
- };
-
- public enum class rt_tsip_options_event_type_t
- {
- tsip_i_options = tsip_i_options,
- tsip_ao_options = tsip_ao_options,
- };
-
- public enum class rt_tsip_publish_event_type_t
- {
- tsip_i_publish = tsip_i_publish,
- tsip_ao_publish = tsip_ao_publish,
-
- tsip_i_unpublish = tsip_i_unpublish,
- tsip_ao_unpublish = tsip_ao_unpublish
- };
-
- public enum class rt_tsip_register_event_type_t
- {
- tsip_i_newreg = tsip_i_newreg,
-
- tsip_i_register = tsip_i_register,
- tsip_ao_register = tsip_ao_register,
-
- tsip_i_unregister = tsip_i_unregister,
- tsip_ao_unregister = tsip_ao_unregister,
- };
-
- public enum class rt_tsip_request_type_t
- {
- tsip_NONE = tsip_NONE,
-
- tsip_ACK = tsip_ACK,
- tsip_BYE = tsip_BYE,
- tsip_CANCEL = tsip_CANCEL,
- tsip_INVITE = tsip_INVITE,
- tsip_OPTIONS = tsip_OPTIONS,
- tsip_REGISTER = tsip_REGISTER,
- tsip_SUBSCRIBE = tsip_SUBSCRIBE,
- tsip_NOTIFY = tsip_NOTIFY,
- tsip_REFER = tsip_REFER,
- tsip_INFO = tsip_INFO,
- tsip_UPDATE = tsip_UPDATE,
- tsip_MESSAGE = tsip_MESSAGE,
- tsip_PUBLISH = tsip_PUBLISH,
- tsip_PRACK = tsip_PRACK
- };
-
- public enum class rt_tsip_subscribe_event_type_t
- {
- tsip_i_subscribe = tsip_i_subscribe,
- tsip_ao_subscribe = tsip_ao_subscribe,
-
- tsip_i_unsubscribe = tsip_i_unsubscribe,
- tsip_ao_unsubscribe = tsip_ao_unsubscribe,
-
- tsip_i_notify = tsip_i_notify,
- tsip_ao_notify = tsip_ao_notify
- };
-
- public enum class rt_tdav_codec_id_t
- {
- tdav_codec_id_none = tmedia_codec_id_none,
-
- tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
- tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
- tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
- tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
- tdav_codec_id_gsm = tmedia_codec_id_gsm,
- tdav_codec_id_pcma = tmedia_codec_id_pcma,
- tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
- tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
- tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
- tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
- tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
- tdav_codec_id_bv16 = tmedia_codec_id_bv16,
- tdav_codec_id_bv32 = tmedia_codec_id_bv32,
- tdav_codec_id_opus = tmedia_codec_id_opus,
- tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
- tdav_codec_id_g722 = tmedia_codec_id_g722,
-
- tdav_codec_id_h261 = tmedia_codec_id_h261,
- tdav_codec_id_h263 = tmedia_codec_id_h263,
- tdav_codec_id_h263p = tmedia_codec_id_h263p,
- tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
- tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
- tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
- tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
- tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
- tdav_codec_id_theora = tmedia_codec_id_theora,
- tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
- tdav_codec_id_vp8 = tmedia_codec_id_vp8,
-
- tdav_codec_id_t140 = tmedia_codec_id_t140,
+namespace BackEnd
+{
+public enum class rtConstants
+{
+ rt_tsip_event_code_dialog_transport_error = tsip_event_code_dialog_transport_error,
+ rt_tsip_event_code_dialog_global_error = tsip_event_code_dialog_global_error,
+ rt_tsip_event_code_dialog_message_error = tsip_event_code_dialog_message_error,
+
+ // 8xx ==> success
+ rt_tsip_event_code_dialog_request_incoming = tsip_event_code_dialog_request_incoming,
+ rt_tsip_event_code_dialog_request_outgoing = tsip_event_code_dialog_request_outgoing,
+ rt_tsip_event_code_dialog_request_cancelled = tsip_event_code_dialog_request_cancelled,
+ rt_tsip_event_code_dialog_request_sent = tsip_event_code_dialog_request_sent,
+
+ // 9xx ==> Informational
+ rt_tsip_event_code_dialog_connecting = tsip_event_code_dialog_connecting,
+ rt_tsip_event_code_dialog_connected = tsip_event_code_dialog_connected,
+ rt_tsip_event_code_dialog_terminating = tsip_event_code_dialog_terminating,
+ rt_tsip_event_code_dialog_terminated = tsip_event_code_dialog_terminated,
+ rt_tsip_event_code_stack_starting = tsip_event_code_stack_starting,
+ rt_tsip_event_code_stack_started = tsip_event_code_stack_started,
+ rt_tsip_event_code_stack_stopping = tsip_event_code_stack_stopping,
+ rt_tsip_event_code_stack_stopped = tsip_event_code_stack_stopped,
+ rt_tsip_event_code_stack_failed_to_start = tsip_event_code_stack_failed_to_start,
+ rt_tsip_event_code_stack_failed_to_stop = tsip_event_code_stack_failed_to_stop
+};
+
+public enum class rt_twrap_media_type_t
+{
+ twrap_media_none = twrap_media_none,
+
+ twrap_media_audio = twrap_media_audio,
+ twrap_media_video = twrap_media_video,
+ twrap_media_msrp = twrap_media_msrp,
+ twrap_media_t140 = twrap_media_t140,
+ twrap_media_bfcp = twrap_media_bfcp,
+ twrap_media_bfcp_audio = twrap_media_bfcp_audio,
+ twrap_media_bfcp_video = twrap_media_bfcp_video,
+
+ twrap_media_audiovideo = twrap_media_audiovideo, /* @deprecated */
+ twrap_media_audio_video = twrap_media_audio_video,
+};
+
+public enum class rt_tmedia_bandwidth_level_t
+{
+ tmedia_bl_low = tmedia_bl_low,
+ tmedia_bl_medium = tmedia_bl_medium,
+ tmedia_bl_hight = tmedia_bl_hight,
+ tmedia_bl_unrestricted = tmedia_bl_unrestricted
+};
+
+public enum class rt_tmedia_pref_video_size_t
+{
+ /* must be sorted like this */
+ tmedia_pref_video_size_sqcif = tmedia_pref_video_size_sqcif, // 128 x 98
+ tmedia_pref_video_size_qcif = tmedia_pref_video_size_qcif, // 176 x 144
+ tmedia_pref_video_size_qvga = tmedia_pref_video_size_qvga, // 320 x 240
+ tmedia_pref_video_size_cif = tmedia_pref_video_size_cif, // 352 x 288
+ tmedia_pref_video_size_hvga = tmedia_pref_video_size_hvga, // 480 x 320
+ tmedia_pref_video_size_vga = tmedia_pref_video_size_vga, // 640 x 480
+ tmedia_pref_video_size_4cif = tmedia_pref_video_size_4cif, // 704 x 576
+ tmedia_pref_video_size_wvga = tmedia_pref_video_size_wvga, // 800 x 480
+ tmedia_pref_video_size_svga = tmedia_pref_video_size_svga, // 800 x 600
+ tmedia_pref_video_size_480p = tmedia_pref_video_size_480p, // 852 x 480
+ tmedia_pref_video_size_xga = tmedia_pref_video_size_xga, // 1024 x 768
+ tmedia_pref_video_size_720p = tmedia_pref_video_size_720p, // 1280 x 720
+ tmedia_pref_video_size_16cif = tmedia_pref_video_size_16cif, // 1408 x 1152
+ tmedia_pref_video_size_1080p = tmedia_pref_video_size_1080p, // 1920 x 1080
+};
+
+public enum class rt_tmedia_profile_t
+{
+ tmedia_profile_default = tmedia_profile_default,
+ tmedia_profile_rtcweb = tmedia_profile_rtcweb
+};
+
+public enum class rt_tmedia_qos_strength_t
+{
+ tmedia_qos_strength_none = tmedia_qos_strength_none,
+ tmedia_qos_strength_failure = tmedia_qos_strength_failure,
+ tmedia_qos_strength_unknown = tmedia_qos_strength_unknown,
+ tmedia_qos_strength_optional = tmedia_qos_strength_optional,
+ tmedia_qos_strength_mandatory = tmedia_qos_strength_mandatory
+};
+
+public enum class rt_tmedia_qos_stype_t
+{
+ tmedia_qos_stype_none = tmedia_qos_stype_none,
+
+ tmedia_qos_stype_segmented = tmedia_qos_stype_segmented,
+ tmedia_qos_stype_e2e = tmedia_qos_stype_e2e,
+};
+
+public enum class rt_tmedia_srtp_mode_t
+{
+ tmedia_srtp_mode_none = tmedia_srtp_mode_none,
+ tmedia_srtp_mode_optional = tmedia_srtp_mode_optional,
+ tmedia_srtp_mode_mandatory = tmedia_srtp_mode_mandatory
+};
+
+public enum class rt_tmedia_srtp_type_t
+{
+ tmedia_srtp_type_none = tmedia_srtp_type_none,
+ tmedia_srtp_type_sdes = tmedia_srtp_type_sdes,
+ tmedia_srtp_type_dtls = tmedia_srtp_type_dtls,
+ tmedia_srtp_type_sdes_dtls = tmedia_srtp_type_sdes_dtls
+};
+
+public enum class rt_tmedia_t140_data_type_t
+{
+ tmedia_t140_data_type_utf8 = tmedia_t140_data_type_utf8,
+ tmedia_t140_data_type_zero_width_no_break_space = tmedia_t140_data_type_zero_width_no_break_space,
+ tmedia_t140_data_type_backspace = tmedia_t140_data_type_backspace,
+ tmedia_t140_data_type_esc = tmedia_t140_data_type_esc,
+ tmedia_t140_data_type_cr = tmedia_t140_data_type_cr,
+ tmedia_t140_data_type_lf = tmedia_t140_data_type_lf,
+ tmedia_t140_data_type_cr_lf = tmedia_t140_data_type_cr_lf,
+ tmedia_t140_data_type_bell = tmedia_t140_data_type_bell,
+ tmedia_t140_data_type_sos = tmedia_t140_data_type_sos,
+ tmedia_t140_data_type_string_term = tmedia_t140_data_type_string_term,
+ tmedia_t140_data_type_graphic_start = tmedia_t140_data_type_graphic_start,
+ tmedia_t140_data_type_graphic_end = tmedia_t140_data_type_graphic_end,
+ tmedia_t140_data_type_loss_char_char = tmedia_t140_data_type_loss_char_char,
+ tmedia_t140_data_type_loss_utf8 = tmedia_t140_data_type_loss_utf8,
+};
+
+public enum class rt_tmedia_type_t
+{
+ tmedia_none = tmedia_none,
+ tmedia_ghost = tmedia_ghost,
+
+ tmedia_audio = tmedia_audio,
+ tmedia_video = tmedia_video,
+ tmedia_chat = tmedia_chat,
+ tmedia_file = tmedia_file,
+ tmedia_t38 = tmedia_t38,
+ tmedia_t140 = tmedia_t140,
+
+ tmedia_msrp = tmedia_msrp,
+ tmedia_audiovideo = tmedia_audiovideo,
+
+ tmedia_all = tmedia_all
+};
+
+public enum class rt_tmsrp_event_type_t
+{
+ tmsrp_event_type_none = tmsrp_event_type_none,
+ tmsrp_event_type_connected = tmsrp_event_type_connected,
+ tmsrp_event_type_disconnected = tmsrp_event_type_disconnected,
+ tmsrp_event_type_message = tmsrp_event_type_message,
+};
+
+public enum class rt_tmsrp_request_type_t
+{
+ tmsrp_NONE = tmsrp_NONE,
+
+ tmsrp_SEND = tmsrp_SEND,
+ tmsrp_REPORT = tmsrp_REPORT,
+ tmsrp_AUTH = tmsrp_AUTH
+};
+
+public enum class rt_tsip_info_event_type_t
+{
+ tsip_i_info = tsip_i_info,
+ tsip_ao_info = tsip_ao_info,
+};
+
+public enum class rt_tsip_invite_event_type_t
+{
+ tsip_i_newcall = tsip_i_newcall,
+
+ tsip_i_request = tsip_i_request,
+ tsip_ao_request = tsip_ao_request,
+
+ tsip_o_ect_trying = tsip_o_ect_trying,
+ tsip_o_ect_accepted = tsip_o_ect_accepted,
+ tsip_o_ect_completed = tsip_o_ect_completed,
+ tsip_o_ect_failed = tsip_o_ect_failed,
+ tsip_o_ect_notify = tsip_o_ect_notify,
+ tsip_i_ect_requested = tsip_i_ect_requested,
+ tsip_i_ect_newcall = tsip_i_ect_newcall,
+ tsip_i_ect_completed = tsip_i_ect_completed,
+ tsip_i_ect_failed = tsip_i_ect_failed,
+ tsip_i_ect_notify = tsip_i_ect_notify,
+
+ tsip_m_early_media = tsip_m_early_media,
+ tsip_m_updating = tsip_m_updating,
+ tsip_m_updated = tsip_m_updated,
+
+ tsip_m_local_hold_ok = tsip_m_local_hold_ok,
+ tsip_m_local_hold_nok = tsip_m_local_hold_nok,
+ tsip_m_local_resume_ok = tsip_m_local_resume_ok,
+ tsip_m_local_resume_nok = tsip_m_local_resume_nok,
+ tsip_m_remote_hold = tsip_m_remote_hold,
+ tsip_m_remote_resume = tsip_m_remote_resume,
+};
+
+public enum class rt_tsip_message_event_type_t
+{
+ tsip_i_message = tsip_i_message,
+ tsip_ao_message = tsip_ao_message,
+};
+
+public enum class rt_tsip_options_event_type_t
+{
+ tsip_i_options = tsip_i_options,
+ tsip_ao_options = tsip_ao_options,
+};
+
+public enum class rt_tsip_publish_event_type_t
+{
+ tsip_i_publish = tsip_i_publish,
+ tsip_ao_publish = tsip_ao_publish,
+
+ tsip_i_unpublish = tsip_i_unpublish,
+ tsip_ao_unpublish = tsip_ao_unpublish
+};
+
+public enum class rt_tsip_register_event_type_t
+{
+ tsip_i_newreg = tsip_i_newreg,
+
+ tsip_i_register = tsip_i_register,
+ tsip_ao_register = tsip_ao_register,
+
+ tsip_i_unregister = tsip_i_unregister,
+ tsip_ao_unregister = tsip_ao_unregister,
+};
+
+public enum class rt_tsip_request_type_t
+{
+ tsip_NONE = tsip_NONE,
+
+ tsip_ACK = tsip_ACK,
+ tsip_BYE = tsip_BYE,
+ tsip_CANCEL = tsip_CANCEL,
+ tsip_INVITE = tsip_INVITE,
+ tsip_OPTIONS = tsip_OPTIONS,
+ tsip_REGISTER = tsip_REGISTER,
+ tsip_SUBSCRIBE = tsip_SUBSCRIBE,
+ tsip_NOTIFY = tsip_NOTIFY,
+ tsip_REFER = tsip_REFER,
+ tsip_INFO = tsip_INFO,
+ tsip_UPDATE = tsip_UPDATE,
+ tsip_MESSAGE = tsip_MESSAGE,
+ tsip_PUBLISH = tsip_PUBLISH,
+ tsip_PRACK = tsip_PRACK
+};
+
+public enum class rt_tsip_subscribe_event_type_t
+{
+ tsip_i_subscribe = tsip_i_subscribe,
+ tsip_ao_subscribe = tsip_ao_subscribe,
+
+ tsip_i_unsubscribe = tsip_i_unsubscribe,
+ tsip_ao_unsubscribe = tsip_ao_unsubscribe,
+
+ tsip_i_notify = tsip_i_notify,
+ tsip_ao_notify = tsip_ao_notify
+};
+
+public enum class rt_tdav_codec_id_t
+{
+ tdav_codec_id_none = tmedia_codec_id_none,
+
+ tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
+ tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
+ tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
+ tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
+ tdav_codec_id_gsm = tmedia_codec_id_gsm,
+ tdav_codec_id_pcma = tmedia_codec_id_pcma,
+ tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
+ tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
+ tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
+ tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
+ tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
+ tdav_codec_id_bv16 = tmedia_codec_id_bv16,
+ tdav_codec_id_bv32 = tmedia_codec_id_bv32,
+ tdav_codec_id_opus = tmedia_codec_id_opus,
+ tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
+ tdav_codec_id_g722 = tmedia_codec_id_g722,
+
+ tdav_codec_id_h261 = tmedia_codec_id_h261,
+ tdav_codec_id_h263 = tmedia_codec_id_h263,
+ tdav_codec_id_h263p = tmedia_codec_id_h263p,
+ tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
+ tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
+ tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
+ tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
+ tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
+ tdav_codec_id_theora = tmedia_codec_id_theora,
+ tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
+ tdav_codec_id_vp8 = tmedia_codec_id_vp8,
+
+ tdav_codec_id_t140 = tmedia_codec_id_t140,
#if !COM_VISIBLE
- tdav_codec_id_red = tmedia_codec_id_red,
+ tdav_codec_id_red = tmedia_codec_id_red,
#endif
- tdav_codec_id_all = tmedia_codec_id_all,
- };
- }
+ tdav_codec_id_all = tmedia_codec_id_all,
+};
+}
}
diff --git a/bindings/winrt/doubango_rt/include/rt_MediaContent.h b/bindings/winrt/doubango_rt/include/rt_MediaContent.h
index 9385aed..d47a63c 100755
--- a/bindings/winrt/doubango_rt/include/rt_MediaContent.h
+++ b/bindings/winrt/doubango_rt/include/rt_MediaContent.h
@@ -1,17 +1,17 @@
/*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.
*/
diff --git a/bindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h b/bindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h
index 3878667..aeb0337 100755
--- a/bindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h
+++ b/bindings/winrt/doubango_rt/include/rt_MediaSessionMgr.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -25,106 +25,106 @@ struct tmedia_session_mgr_s;
namespace doubango_rt
{
- namespace BackEnd
- {
- enum class rt_twrap_media_type_t;
- enum class rt_tmedia_profile_t;
- enum class rt_tmedia_srtp_mode_t;
- enum class rt_tmedia_srtp_type_t;
- enum class rt_tmedia_profile_t;
- enum class rt_tmedia_pref_video_size_t;
+namespace BackEnd
+{
+enum class rt_twrap_media_type_t;
+enum class rt_tmedia_profile_t;
+enum class rt_tmedia_srtp_mode_t;
+enum class rt_tmedia_srtp_type_t;
+enum class rt_tmedia_profile_t;
+enum class rt_tmedia_pref_video_size_t;
- public ref class rtCodec sealed
- {
- internal:
- rtCodec(struct tmedia_codec_s* pCodec);
- public:
- virtual ~rtCodec();
- enum class rt_twrap_media_type_t getMediaType();
- Platform::String^ getName();
- Platform::String^ getDescription();
- Platform::String^ getNegFormat();
- int getAudioSamplingRate();
- int getAudioChannels();
- int getAudioPTime();
+public ref class rtCodec sealed
+{
+internal:
+ rtCodec(struct tmedia_codec_s* pCodec);
+public:
+ virtual ~rtCodec();
+ enum class rt_twrap_media_type_t getMediaType();
+ Platform::String^ getName();
+ Platform::String^ getDescription();
+ Platform::String^ getNegFormat();
+ int getAudioSamplingRate();
+ int getAudioChannels();
+ int getAudioPTime();
+
+private:
+ Codec* m_pCodec;
+};
- private:
- Codec* m_pCodec;
- };
+public ref class rtMediaSessionMgr sealed
+{
+internal:
+ rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr);
- public ref class rtMediaSessionMgr sealed
- {
- internal:
- rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr);
+public:
+ virtual ~rtMediaSessionMgr();
+ bool sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
+ int32 sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key);
- public:
- virtual ~rtMediaSessionMgr();
- bool sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
- int32 sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key);
+ bool consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
+ bool consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
- bool consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
- bool consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
+ bool producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
+ bool producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
+ rtCodec^ producerGetCodec(rt_twrap_media_type_t media);
- bool producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
- bool producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
- rtCodec^ producerGetCodec(rt_twrap_media_type_t media);
+ static unsigned int registerAudioPluginFromFile(Platform::String^ path);
- static unsigned int registerAudioPluginFromFile(Platform::String^ path);
+ uint64 getSessionId(rt_twrap_media_type_t media);
- uint64 getSessionId(rt_twrap_media_type_t media);
-
- internal: // Must be from SIP service to share same global memory space
- static bool defaultsSetProfile(rt_tmedia_profile_t profile);
- static rt_tmedia_profile_t defaultsGetProfile();
- static bool defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size);
- static bool defaultsSetJbMargin(uint32 jb_margin_ms);
- static bool defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent);
- static bool defaultsSetEchoTail(uint32 echo_tail);
- static uint32 defaultsGetEchoTail();
- static bool defaultsSetEchoSkew(uint32 echo_skew);
- static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
- static bool defaultsGetEchoSuppEnabled();
- static bool defaultsSetAgcEnabled(bool agc_enabled);
- static bool defaultsGetAgcEnabled();
- static bool defaultsSetAgcLevel(float agc_level);
- static float defaultsGetAgcLevel();
- static bool defaultsSetVadEnabled(bool vad_enabled);
- static bool defaultsGetGetVadEnabled();
- static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
- static bool defaultsGetNoiseSuppEnabled();
- static bool defaultsSetNoiseSuppLevel(int32 noise_supp_level);
- static int32 defaultsGetNoiseSuppLevel();
- static bool defaultsSet100relEnabled(bool _100rel_enabled);
- static bool defaultsGet100relEnabled();
- static bool defaultsSetScreenSize(int32 sx, int32 sy);
- static bool defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain);
- static bool defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop);
- static bool defaultsSetRtpSymetricEnabled(bool enabled);
- static bool defaultsSetMediaType(enum class rt_twrap_media_type_t media_type);
- static bool defaultsSetVolume(int32 volume);
- static int32 defaultsGetVolume();
- static bool defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher);
- static bool defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode);
- static enum class rt_tmedia_srtp_mode_t defaultsGetSRtpMode();
- static bool defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type);
- static enum class rt_tmedia_srtp_type_t defaultsGetSRtpType();
- static bool defaultsSetRtcpEnabled(bool enabled);
- static bool defaultsGetRtcpEnabled();
- static bool defaultsSetRtcpMuxEnabled(bool enabled);
- static bool defaultsGetRtcpMuxEnabled();
- static bool defaultsSetIceEnabled(bool ice_enabled);
- static bool defaultsSetByPassEncoding(bool enabled);
- static bool defaultsGetByPassEncoding();
- static bool defaultsSetByPassDecoding(bool enabled);
- static bool defaultsGetByPassDecoding();
- static bool defaultsSetVideoJbEnabled(bool enabled);
- static bool defaultsGetVideoJbEnabled();
- static bool defaultsSetRtpBuffSize(unsigned buffSize);
- static unsigned defaultsGetRtpBuffSize();
- static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
+internal: // Must be from SIP service to share same global memory space
+ static bool defaultsSetProfile(rt_tmedia_profile_t profile);
+ static rt_tmedia_profile_t defaultsGetProfile();
+ static bool defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size);
+ static bool defaultsSetJbMargin(uint32 jb_margin_ms);
+ static bool defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent);
+ static bool defaultsSetEchoTail(uint32 echo_tail);
+ static uint32 defaultsGetEchoTail();
+ static bool defaultsSetEchoSkew(uint32 echo_skew);
+ static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
+ static bool defaultsGetEchoSuppEnabled();
+ static bool defaultsSetAgcEnabled(bool agc_enabled);
+ static bool defaultsGetAgcEnabled();
+ static bool defaultsSetAgcLevel(float agc_level);
+ static float defaultsGetAgcLevel();
+ static bool defaultsSetVadEnabled(bool vad_enabled);
+ static bool defaultsGetGetVadEnabled();
+ static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
+ static bool defaultsGetNoiseSuppEnabled();
+ static bool defaultsSetNoiseSuppLevel(int32 noise_supp_level);
+ static int32 defaultsGetNoiseSuppLevel();
+ static bool defaultsSet100relEnabled(bool _100rel_enabled);
+ static bool defaultsGet100relEnabled();
+ static bool defaultsSetScreenSize(int32 sx, int32 sy);
+ static bool defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain);
+ static bool defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop);
+ static bool defaultsSetRtpSymetricEnabled(bool enabled);
+ static bool defaultsSetMediaType(enum class rt_twrap_media_type_t media_type);
+ static bool defaultsSetVolume(int32 volume);
+ static int32 defaultsGetVolume();
+ static bool defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher);
+ static bool defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode);
+ static enum class rt_tmedia_srtp_mode_t defaultsGetSRtpMode();
+ static bool defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type);
+ static enum class rt_tmedia_srtp_type_t defaultsGetSRtpType();
+ static bool defaultsSetRtcpEnabled(bool enabled);
+ static bool defaultsGetRtcpEnabled();
+ static bool defaultsSetRtcpMuxEnabled(bool enabled);
+ static bool defaultsGetRtcpMuxEnabled();
+ static bool defaultsSetIceEnabled(bool ice_enabled);
+ static bool defaultsSetByPassEncoding(bool enabled);
+ static bool defaultsGetByPassEncoding();
+ static bool defaultsSetByPassDecoding(bool enabled);
+ static bool defaultsGetByPassDecoding();
+ static bool defaultsSetVideoJbEnabled(bool enabled);
+ static bool defaultsGetVideoJbEnabled();
+ static bool defaultsSetRtpBuffSize(unsigned buffSize);
+ static unsigned defaultsGetRtpBuffSize();
+ static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
- private:
- MediaSessionMgr* m_pMediaSessionMgr;
- };
- }
+private:
+ MediaSessionMgr* m_pMediaSessionMgr;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_Msrp.h b/bindings/winrt/doubango_rt/include/rt_Msrp.h
index b0fbe26..399f3b0 100755
--- a/bindings/winrt/doubango_rt/include/rt_Msrp.h
+++ b/bindings/winrt/doubango_rt/include/rt_Msrp.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -25,85 +25,96 @@ class MsrpEvent;
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtMsrpSession;
+namespace BackEnd
+{
+ref class rtMsrpSession;
- public ref class rtMsrpByteRange sealed
- {
- internal:
- rtMsrpByteRange(int64 start, int64 end, int64 total):_start(start),_end(end),_total(total){}
- public:
- property int64 Start{ int64 get() { return _start; }; }
- property int64 End{ int64 get() { return _end; }; }
- property int64 Total{ int64 get() { return _total; }; }
- private:
- int64 _start, _end, _total;
- };
+public ref class rtMsrpByteRange sealed
+{
+internal:
+ rtMsrpByteRange(int64 start, int64 end, int64 total):_start(start),_end(end),_total(total) {}
+public:
+ property int64 Start { int64 get() {
+ return _start;
+ };
+ }
+ property int64 End { int64 get() {
+ return _end;
+ };
+ }
+ property int64 Total { int64 get() {
+ return _total;
+ };
+ }
+private:
+ int64 _start, _end, _total;
+};
- public ref class rtMsrpMessage sealed
- {
- public:
- virtual ~rtMsrpMessage();
- internal:
- rtMsrpMessage(struct tmsrp_message_s *message);
+public ref class rtMsrpMessage sealed
+{
+public:
+ virtual ~rtMsrpMessage();
+internal:
+ rtMsrpMessage(struct tmsrp_message_s *message);
- public:
- bool isRequest();
- short getCode();
- Platform::String^ getPhrase();
- rt_tmsrp_request_type_t getRequestType();
+public:
+ bool isRequest();
+ short getCode();
+ Platform::String^ getPhrase();
+ rt_tmsrp_request_type_t getRequestType();
#if COM_VISIBLE
- rtMsrpByteRange^ getByteRange();
+ rtMsrpByteRange^ getByteRange();
#else
- void getByteRange(Platform::IntPtr start, Platform::IntPtr end, Platform::IntPtr total);
+ void getByteRange(Platform::IntPtr start, Platform::IntPtr end, Platform::IntPtr total);
#endif
- bool isLastChunck();
- bool isFirstChunck();
- bool isSuccessReport();
- Platform::String^ getMsrpHeaderValue(Platform::String^ name);
- Platform::String^ getMsrpHeaderParamValue(Platform::String^ name, Platform::String^ param);
- unsigned getMsrpContentLength();
+ bool isLastChunck();
+ bool isFirstChunck();
+ bool isSuccessReport();
+ Platform::String^ getMsrpHeaderValue(Platform::String^ name);
+ Platform::String^ getMsrpHeaderParamValue(Platform::String^ name, Platform::String^ param);
+ unsigned getMsrpContentLength();
#if COM_VISIBLE
- Platform::String^ getMsrpContent(unsigned maxsize);
+ Platform::String^ getMsrpContent(unsigned maxsize);
#else
- unsigned getMsrpContent(Platform::IntPtr output, unsigned maxsize);
+ unsigned getMsrpContent(Platform::IntPtr output, unsigned maxsize);
#endif
- private:
- MsrpMessage* m_pMsrpMessage;
- };
+private:
+ MsrpMessage* m_pMsrpMessage;
+};
- public ref class rtMsrpEvent sealed
- {
- internal:
- rtMsrpEvent(const struct tmsrp_event_s *event);
- public:
- virtual ~rtMsrpEvent();
+public ref class rtMsrpEvent sealed
+{
+internal:
+ rtMsrpEvent(const struct tmsrp_event_s *event);
+public:
+ virtual ~rtMsrpEvent();
- rt_tmsrp_event_type_t getType();
- rtMsrpSession^ getSipSession();
- rtMsrpMessage^ getMessage();
+ rt_tmsrp_event_type_t getType();
+ rtMsrpSession^ getSipSession();
+ rtMsrpMessage^ getMessage();
- private:
- MsrpEvent* m_pMsrpEvent;
- };
+private:
+ MsrpEvent* m_pMsrpEvent;
+};
- public interface class rtIMsrpCallback
- {
- virtual int OnEvent(rtMsrpEvent^ pEvent);
- };
- public ref class rtMsrpCallback sealed
- {
- internal:
- rtMsrpCallback(rtIMsrpCallback^ pI);
- const MsrpCallback* getWrappedCallback(){ return m_pCallback; }
- public:
- virtual ~rtMsrpCallback();
+public interface class rtIMsrpCallback
+{
+ virtual int OnEvent(rtMsrpEvent^ pEvent);
+};
+public ref class rtMsrpCallback sealed
+{
+internal:
+ rtMsrpCallback(rtIMsrpCallback^ pI);
+ const MsrpCallback* getWrappedCallback() {
+ return m_pCallback;
+ }
+public:
+ virtual ~rtMsrpCallback();
- private:
- MsrpCallback* m_pCallback;
- rtIMsrpCallback^ m_pI;
- };
- }
+private:
+ MsrpCallback* m_pCallback;
+ rtIMsrpCallback^ m_pI;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_SMSEncoder.h b/bindings/winrt/doubango_rt/include/rt_SMSEncoder.h
index 9385aed..d47a63c 100755
--- a/bindings/winrt/doubango_rt/include/rt_SMSEncoder.h
+++ b/bindings/winrt/doubango_rt/include/rt_SMSEncoder.h
@@ -1,17 +1,17 @@
/*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.
*/
diff --git a/bindings/winrt/doubango_rt/include/rt_SipCallback.h b/bindings/winrt/doubango_rt/include/rt_SipCallback.h
index 1f0a9e0..ecd1d54 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipCallback.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipCallback.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -22,49 +22,49 @@ class SipCallbackProxy;
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtDialogEvent;
- ref class rtStackEvent;
+namespace BackEnd
+{
+ref class rtDialogEvent;
+ref class rtStackEvent;
- ref class rtInviteEvent;
- ref class rtMessagingEvent;
- ref class rtInfoEvent;
- ref class rtOptionsEvent;
- ref class rtPublicationEvent;
- ref class rtRegistrationEvent;
- ref class rtSubscriptionEvent;
+ref class rtInviteEvent;
+ref class rtMessagingEvent;
+ref class rtInfoEvent;
+ref class rtOptionsEvent;
+ref class rtPublicationEvent;
+ref class rtRegistrationEvent;
+ref class rtSubscriptionEvent;
- public interface class rtISipCallback
- {
- virtual int OnDialogEvent(rtDialogEvent^ e);
- virtual int OnStackEvent(rtStackEvent^ e);
+public interface class rtISipCallback
+{
+ virtual int OnDialogEvent(rtDialogEvent^ e);
+ virtual int OnStackEvent(rtStackEvent^ e);
+
+ virtual int OnInviteEvent(rtInviteEvent^ e);
+ virtual int OnMessagingEvent(rtMessagingEvent^ e);
+ virtual int OnInfoEvent(rtInfoEvent^ e);
+ virtual int OnOptionsEvent(rtOptionsEvent^ e);
+ virtual int OnPublicationEvent(rtPublicationEvent^ e);
+ virtual int OnRegistrationEvent(rtRegistrationEvent^ e);
+ virtual int OnSubscriptionEvent(rtSubscriptionEvent^ e);
+};
- virtual int OnInviteEvent(rtInviteEvent^ e);
- virtual int OnMessagingEvent(rtMessagingEvent^ e);
- virtual int OnInfoEvent(rtInfoEvent^ e);
- virtual int OnOptionsEvent(rtOptionsEvent^ e);
- virtual int OnPublicationEvent(rtPublicationEvent^ e);
- virtual int OnRegistrationEvent(rtRegistrationEvent^ e);
- virtual int OnSubscriptionEvent(rtSubscriptionEvent^ e);
- };
+public ref class rtSipCallback sealed
+{
+internal:
+ rtSipCallback(rtISipCallback^ pI);
+public:
+ virtual ~rtSipCallback();
+ friend class SipCallbackProxy;
- public ref class rtSipCallback sealed
- {
- internal:
- rtSipCallback(rtISipCallback^ pI);
- public:
- virtual ~rtSipCallback();
- friend class SipCallbackProxy;
-
- internal:
- const SipCallback* getWrappedCallback();
+internal:
+ const SipCallback* getWrappedCallback();
- private:
- rtISipCallback^ m_pI;
- SipCallbackProxy* m_pCallback;
- };
- }
+private:
+ rtISipCallback^ m_pI;
+ SipCallbackProxy* m_pCallback;
+};
+}
}
diff --git a/bindings/winrt/doubango_rt/include/rt_SipEvent.h b/bindings/winrt/doubango_rt/include/rt_SipEvent.h
index e615bde..f337262 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipEvent.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipEvent.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -39,7 +39,7 @@ class SubscriptionEvent;
virtual Platform::String^ getPhrase(); \
virtual rtISipSession^ getBaseSession(); \
virtual rtSipMessage^ getSipMessage(); \
-
+
#define rtISipEvent_Implement(cls) \
short cls##::getCode(){ \
return m_pEvent->getCode(); \
@@ -53,192 +53,192 @@ rtISipSession^ cls##::getBaseSession(){ \
rtSipMessage^ cls##::getSipMessage(){ \
return ref new rtSipMessage(const_cast<struct tsip_message_s*>(const_cast<SipMessage*>(m_pEvent->getSipMessage())->getWrappedSipMessage())); \
} \
-
+
namespace doubango_rt
{
- namespace BackEnd
- {
- interface class rtISipSession;
- ref class rtSipMessage;
- ref class rtInviteSession;
- ref class rtMsrpSession;
- ref class rtCallSession;
- ref class rtMessagingSession;
- ref class rtInfoSession;
- ref class rtOptionsSession;
- ref class rtPublicationSession;
- ref class rtRegistrationSession;
- ref class rtSubscriptionSession;
-
-
- /* ======================== rtISipEvent ========================*/
- public interface class rtISipEvent
- {
- short getCode();
- Platform::String^ getPhrase();
- rtISipSession^ getBaseSession();
- rtSipMessage^ getSipMessage();
- };
-
-
- /* ======================== rtDialogEvent ========================*/
- public ref class rtDialogEvent sealed : rtISipEvent
- {
- internal:
- rtDialogEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtDialogEvent();
- rtISipEvent_Declare();
-
- private:
- DialogEvent* m_pEvent;
- };
-
- /* ======================== rtStackEvent ========================*/
- public ref class rtStackEvent sealed : rtISipEvent
- {
- internal:
- rtStackEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtStackEvent();
- rtISipEvent_Declare();
-
- private:
- StackEvent* m_pEvent;
- };
-
-
- /* ======================== rtInviteEvent ========================*/
- public ref class rtInviteEvent sealed : rtISipEvent
- {
- internal:
- rtInviteEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtInviteEvent();
- rtISipEvent_Declare();
-
- rt_tsip_invite_event_type_t getType();
- rt_twrap_media_type_t getMediaType();
- rtInviteSession^ getSession();
- rtCallSession^ takeCallSessionOwnership();
- rtMsrpSession^ takeMsrpSessionOwnership();
-
- private:
- InviteEvent* m_pEvent;
- };
-
- /* ======================== rtMessagingEvent ========================*/
- public ref class rtMessagingEvent sealed : rtISipEvent
- {
- internal:
- rtMessagingEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtMessagingEvent();
- rtISipEvent_Declare();
-
- rt_tsip_message_event_type_t getType();
- rtMessagingSession^ getSession();
- rtMessagingSession^ takeSessionOwnership();
-
- private:
- MessagingEvent* m_pEvent;
- };
-
-
- /* ======================== rtInfoEvent ========================*/
- public ref class rtInfoEvent sealed : rtISipEvent
- {
- internal:
- rtInfoEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtInfoEvent();
- rtISipEvent_Declare();
-
- rt_tsip_info_event_type_t getType();
- rtInfoSession^ getSession();
- rtInfoSession^ takeSessionOwnership();
-
- private:
- InfoEvent* m_pEvent;
- };
-
-
- /* ======================== rtOptionsEvent ========================*/
- public ref class rtOptionsEvent sealed : rtISipEvent
- {
- internal:
- rtOptionsEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtOptionsEvent();
- rtISipEvent_Declare();
-
- rt_tsip_options_event_type_t getType();
- rtOptionsSession^ getSession();
- rtOptionsSession^ takeSessionOwnership();
-
- private:
- OptionsEvent* m_pEvent;
- };
-
- /* ======================== rtPublicationEvent ========================*/
- public ref class rtPublicationEvent sealed : rtISipEvent
- {
- internal:
- rtPublicationEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtPublicationEvent();
- rtISipEvent_Declare();
-
- rt_tsip_publish_event_type_t getType();
- rtPublicationSession^ getSession();
- rtPublicationSession^ takeSessionOwnership();
-
- private:
- PublicationEvent* m_pEvent;
- };
-
- /* ======================== rtRegistrationEvent ========================*/
- public ref class rtRegistrationEvent sealed : rtISipEvent
- {
- internal:
- rtRegistrationEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtRegistrationEvent();
- rtISipEvent_Declare();
-
- rt_tsip_register_event_type_t getType();
- rtRegistrationSession^ getSession();
- rtRegistrationSession^ takeSessionOwnership();
-
- private:
- RegistrationEvent* m_pEvent;
- };
-
- /* ======================== rtSubscriptionEvent ========================*/
- public ref class rtSubscriptionEvent sealed : rtISipEvent
- {
- internal:
- rtSubscriptionEvent(const struct tsip_event_s *e);
-
- public:
- virtual ~rtSubscriptionEvent();
- rtISipEvent_Declare();
-
- rt_tsip_subscribe_event_type_t getType();
- rtSubscriptionSession^ getSession();
- rtSubscriptionSession^ takeSessionOwnership();
-
- private:
- SubscriptionEvent* m_pEvent;
- };
- }
+namespace BackEnd
+{
+interface class rtISipSession;
+ref class rtSipMessage;
+ref class rtInviteSession;
+ref class rtMsrpSession;
+ref class rtCallSession;
+ref class rtMessagingSession;
+ref class rtInfoSession;
+ref class rtOptionsSession;
+ref class rtPublicationSession;
+ref class rtRegistrationSession;
+ref class rtSubscriptionSession;
+
+
+/* ======================== rtISipEvent ========================*/
+public interface class rtISipEvent
+{
+ short getCode();
+ Platform::String^ getPhrase();
+ rtISipSession^ getBaseSession();
+ rtSipMessage^ getSipMessage();
+};
+
+
+/* ======================== rtDialogEvent ========================*/
+public ref class rtDialogEvent sealed : rtISipEvent
+{
+internal:
+ rtDialogEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtDialogEvent();
+ rtISipEvent_Declare();
+
+private:
+ DialogEvent* m_pEvent;
+};
+
+/* ======================== rtStackEvent ========================*/
+public ref class rtStackEvent sealed : rtISipEvent
+{
+internal:
+ rtStackEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtStackEvent();
+ rtISipEvent_Declare();
+
+private:
+ StackEvent* m_pEvent;
+};
+
+
+/* ======================== rtInviteEvent ========================*/
+public ref class rtInviteEvent sealed : rtISipEvent
+{
+internal:
+ rtInviteEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtInviteEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_invite_event_type_t getType();
+ rt_twrap_media_type_t getMediaType();
+ rtInviteSession^ getSession();
+ rtCallSession^ takeCallSessionOwnership();
+ rtMsrpSession^ takeMsrpSessionOwnership();
+
+private:
+ InviteEvent* m_pEvent;
+};
+
+/* ======================== rtMessagingEvent ========================*/
+public ref class rtMessagingEvent sealed : rtISipEvent
+{
+internal:
+ rtMessagingEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtMessagingEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_message_event_type_t getType();
+ rtMessagingSession^ getSession();
+ rtMessagingSession^ takeSessionOwnership();
+
+private:
+ MessagingEvent* m_pEvent;
+};
+
+
+/* ======================== rtInfoEvent ========================*/
+public ref class rtInfoEvent sealed : rtISipEvent
+{
+internal:
+ rtInfoEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtInfoEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_info_event_type_t getType();
+ rtInfoSession^ getSession();
+ rtInfoSession^ takeSessionOwnership();
+
+private:
+ InfoEvent* m_pEvent;
+};
+
+
+/* ======================== rtOptionsEvent ========================*/
+public ref class rtOptionsEvent sealed : rtISipEvent
+{
+internal:
+ rtOptionsEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtOptionsEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_options_event_type_t getType();
+ rtOptionsSession^ getSession();
+ rtOptionsSession^ takeSessionOwnership();
+
+private:
+ OptionsEvent* m_pEvent;
+};
+
+/* ======================== rtPublicationEvent ========================*/
+public ref class rtPublicationEvent sealed : rtISipEvent
+{
+internal:
+ rtPublicationEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtPublicationEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_publish_event_type_t getType();
+ rtPublicationSession^ getSession();
+ rtPublicationSession^ takeSessionOwnership();
+
+private:
+ PublicationEvent* m_pEvent;
+};
+
+/* ======================== rtRegistrationEvent ========================*/
+public ref class rtRegistrationEvent sealed : rtISipEvent
+{
+internal:
+ rtRegistrationEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtRegistrationEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_register_event_type_t getType();
+ rtRegistrationSession^ getSession();
+ rtRegistrationSession^ takeSessionOwnership();
+
+private:
+ RegistrationEvent* m_pEvent;
+};
+
+/* ======================== rtSubscriptionEvent ========================*/
+public ref class rtSubscriptionEvent sealed : rtISipEvent
+{
+internal:
+ rtSubscriptionEvent(const struct tsip_event_s *e);
+
+public:
+ virtual ~rtSubscriptionEvent();
+ rtISipEvent_Declare();
+
+ rt_tsip_subscribe_event_type_t getType();
+ rtSubscriptionSession^ getSession();
+ rtSubscriptionSession^ takeSessionOwnership();
+
+private:
+ SubscriptionEvent* m_pEvent;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_SipMessage.h b/bindings/winrt/doubango_rt/include/rt_SipMessage.h
index a61c1c3..2feac91 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipMessage.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipMessage.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -27,52 +27,52 @@ struct tsip_message_s;
namespace doubango_rt
{
- namespace BackEnd
- {
- public ref class rtSdpMessage sealed
- {
- internal:
- rtSdpMessage();
- rtSdpMessage(struct tsdp_message_s *message);
- public:
- virtual ~rtSdpMessage();
+namespace BackEnd
+{
+public ref class rtSdpMessage sealed
+{
+internal:
+ rtSdpMessage();
+ rtSdpMessage(struct tsdp_message_s *message);
+public:
+ virtual ~rtSdpMessage();
- public:
- Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name, unsigned index);
- Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name);
- Platform::String^ getSdpHeaderAValue(Platform::String^ media, Platform::String^ attributeName);
+public:
+ Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name, unsigned index);
+ Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name);
+ Platform::String^ getSdpHeaderAValue(Platform::String^ media, Platform::String^ attributeName);
- private:
- SdpMessage* m_pSdpMessage;
- };
+private:
+ SdpMessage* m_pSdpMessage;
+};
- public ref class rtSipMessage sealed
- {
- internal:
- rtSipMessage();
- rtSipMessage(struct tsip_message_s* message);
- public:
- virtual ~rtSipMessage();
+public ref class rtSipMessage sealed
+{
+internal:
+ rtSipMessage();
+ rtSipMessage(struct tsip_message_s* message);
+public:
+ virtual ~rtSipMessage();
- public:
- bool isResponse();
- rt_tsip_request_type_t getRequestType();
- short getResponseCode();
- Platform::String^ getResponsePhrase();
- Platform::String^ getSipHeaderValue(Platform::String^ name, unsigned index);
- Platform::String^ getSipHeaderValue(Platform::String^ name);
- Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param, unsigned index);
- Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param);
- unsigned getSipContentLength();
+public:
+ bool isResponse();
+ rt_tsip_request_type_t getRequestType();
+ short getResponseCode();
+ Platform::String^ getResponsePhrase();
+ Platform::String^ getSipHeaderValue(Platform::String^ name, unsigned index);
+ Platform::String^ getSipHeaderValue(Platform::String^ name);
+ Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param, unsigned index);
+ Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param);
+ unsigned getSipContentLength();
#if COM_VISIBLE
- Platform::String^ getSipContent();
+ Platform::String^ getSipContent();
#else
- unsigned getSipContent(Platform::IntPtr output, unsigned maxsize);
+ unsigned getSipContent(Platform::IntPtr output, unsigned maxsize);
#endif
- rtSdpMessage^ getSdpMessage();
+ rtSdpMessage^ getSdpMessage();
- private:
- SipMessage* m_pSipMessage;
- };
- }
+private:
+ SipMessage* m_pSipMessage;
+};
+}
}
diff --git a/bindings/winrt/doubango_rt/include/rt_SipSession.h b/bindings/winrt/doubango_rt/include/rt_SipSession.h
index bf52ba5..73a36dd 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipSession.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipSession.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -61,7 +61,7 @@ class T140Callback;
virtual bool setSilentHangup(bool silent); \
virtual bool addSigCompCompartment(Platform::String^ compId); \
virtual bool removeSigCompCompartment(); \
-
+
#define rtISession_Implement(cls) \
unsigned cls##::getId(){ \
return m_pSipSession->getId(); \
@@ -108,7 +108,7 @@ OVERRIDE_FUNC(bool cls##::setToUri(Platform::String^ toUriString){ \
bool cls##::removeSigCompCompartment(){ \
return m_pSipSession->removeSigCompCompartment(); \
}\
-
+
#define rtIInviteSession_Declare() \
[Windows::Foundation::Metadata::DefaultOverload] \
@@ -124,7 +124,7 @@ OVERRIDE_FUNC(bool cls##::setToUri(Platform::String^ toUriString){ \
virtual bool sendInfo(VISIBLE_VOID_PTR payload, unsigned len, rtActionConfig^ config); \
OVERRIDE_FUNC(virtual bool sendInfo(VISIBLE_VOID_PTR payload, unsigned len);) \
virtual rtMediaSessionMgr^ getMediaMgr(); \
-
+
#define rtIInviteSession_Implement(cls) \
bool cls##::accept(rtActionConfig^ config){ \
return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null); \
@@ -156,355 +156,363 @@ rtMediaSessionMgr^ cls##::getMediaMgr(){ \
} \
return nullptr; \
} \
-
+
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtMsrpCallback;
- interface class rtIMsrpCallback;
-
-
- /* ======================== rtT140CallbackData ========================*/
- public ref class rtT140CallbackData sealed
- {
- internal:
- rtT140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
- public:
- virtual ~rtT140CallbackData();
-
- private:
- T140CallbackData* m_pData;
- };
-
- /* ======================== rtT140Callback ========================*/
- public interface class rtIT140Callback
- {
- virtual int ondata(rtT140CallbackData^ pData);
- };
- public ref class rtT140Callback sealed
- {
- internal:
- rtT140Callback();
- const T140Callback* getWrappedCallback(){ return m_pCallback; }
-
- public:
- rtT140Callback(rtIT140Callback^ pI)
- {
- m_pI = pI;
- }
- virtual ~rtT140Callback();
-
- protected:
- virtual int ondata(rtT140CallbackData^ pData){
- if(m_pI)
- {
- return m_pI->ondata(pData);
- }
- return 0;
- }
-
- private:
- T140Callback* m_pCallback;
- rtIT140Callback^ m_pI;
- };
-
-
- /* ======================== rtISipSession ========================*/
- public interface class rtISipSession
- {
- rtISession_Declare();
- };
-
-
- /* ======================== rtIInviteSession ========================*/
- public interface class rtIInviteSession : rtISipSession
- {
- rtIInviteSession_Declare();
- };
-
- /* ======================== rtSipSession ========================*/
- public ref class rtSipSession sealed: rtISipSession
- {
- public:
- rtSipSession(rtSipStack^ pStack);
- virtual ~rtSipSession();
- internal:
- rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- SipSession* getWrappedSession(){ return m_pSipSession; }
-
- public:
- rtISession_Declare();
-
- private:
- SipSession* m_pSipSession;
- };
-
- /* ======================== rtInviteSession ========================*/
- public ref class rtInviteSession sealed: rtIInviteSession
- {
- public:
- rtInviteSession(rtSipStack^ pStack);
- virtual ~rtInviteSession();
- internal:
- rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- InviteSession* getWrappedSession(){ return m_pSipSession; }
-
- public:
- rtISession_Declare();
- rtIInviteSession_Declare();
-
- private:
- InviteSession* m_pSipSession;
- };
-
- /* ======================== CallSession ========================*/
- public ref class rtCallSession sealed : rtIInviteSession
- {
- public:
- rtCallSession(rtSipStack^ pStack);
- virtual ~rtCallSession();
- internal:
- rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- CallSession* getWrappedSession(){ return m_pSipSession; }
-
- public:
- rtISession_Declare();
- rtIInviteSession_Declare();
-
- [Windows::Foundation::Metadata::DefaultOverload]
- bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media, rtActionConfig^ config);
- [Windows::Foundation::Metadata::DefaultOverload]
- bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media);
- bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media, rtActionConfig^ config);
- bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media);
-
- bool setSessionTimer(unsigned timeout, Platform::String^ refresher);
- bool set100rel(bool enabled);
- bool setRtcp(bool enabled);
- bool setRtcpMux(bool enabled);
- bool setICE(bool enabled);
- bool setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength);
- bool setVideoFps(int32_t fps);
- bool setVideoBandwidthUploadMax(int32_t max);
- bool setVideoBandwidthDownloadMax(int32_t max);
- bool setVideoPrefSize(rt_tmedia_pref_video_size_t pref_video_size);
- bool hold(rtActionConfig^ config);
- bool hold();
- bool resume(rtActionConfig^ config);
- bool resume();
- bool transfer(Platform::String^ referToUriString, rtActionConfig^ config);
- bool transfer(Platform::String^ referToUriString);
- bool acceptTransfer(rtActionConfig^ config);
- bool acceptTransfer();
- bool rejectTransfer(rtActionConfig^ config);
- bool rejectTransfer();
- bool sendDTMF(int number);
- unsigned getSessionTransferId();
+namespace BackEnd
+{
+ref class rtMsrpCallback;
+interface class rtIMsrpCallback;
+
+
+/* ======================== rtT140CallbackData ========================*/
+public ref class rtT140CallbackData sealed
+{
+internal:
+ rtT140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
+public:
+ virtual ~rtT140CallbackData();
+
+private:
+ T140CallbackData* m_pData;
+};
+
+/* ======================== rtT140Callback ========================*/
+public interface class rtIT140Callback
+{
+ virtual int ondata(rtT140CallbackData^ pData);
+};
+public ref class rtT140Callback sealed
+{
+internal:
+ rtT140Callback();
+ const T140Callback* getWrappedCallback() {
+ return m_pCallback;
+ }
+
+public:
+ rtT140Callback(rtIT140Callback^ pI) {
+ m_pI = pI;
+ }
+ virtual ~rtT140Callback();
+
+protected:
+ virtual int ondata(rtT140CallbackData^ pData) {
+ if(m_pI) {
+ return m_pI->ondata(pData);
+ }
+ return 0;
+ }
+
+private:
+ T140Callback* m_pCallback;
+ rtIT140Callback^ m_pI;
+};
+
+
+/* ======================== rtISipSession ========================*/
+public interface class rtISipSession
+{
+ rtISession_Declare();
+};
+
+
+/* ======================== rtIInviteSession ========================*/
+public interface class rtIInviteSession : rtISipSession
+{
+ rtIInviteSession_Declare();
+};
+
+/* ======================== rtSipSession ========================*/
+public ref class rtSipSession sealed: rtISipSession
+{
+public:
+ rtSipSession(rtSipStack^ pStack);
+ virtual ~rtSipSession();
+internal:
+ rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ SipSession* getWrappedSession() {
+ return m_pSipSession;
+ }
+
+public:
+ rtISession_Declare();
+
+private:
+ SipSession* m_pSipSession;
+};
+
+/* ======================== rtInviteSession ========================*/
+public ref class rtInviteSession sealed: rtIInviteSession
+{
+public:
+ rtInviteSession(rtSipStack^ pStack);
+ virtual ~rtInviteSession();
+internal:
+ rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ InviteSession* getWrappedSession() {
+ return m_pSipSession;
+ }
+
+public:
+ rtISession_Declare();
+ rtIInviteSession_Declare();
+
+private:
+ InviteSession* m_pSipSession;
+};
+
+/* ======================== CallSession ========================*/
+public ref class rtCallSession sealed : rtIInviteSession
+{
+public:
+ rtCallSession(rtSipStack^ pStack);
+ virtual ~rtCallSession();
+internal:
+ rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ CallSession* getWrappedSession() {
+ return m_pSipSession;
+ }
+
+public:
+ rtISession_Declare();
+ rtIInviteSession_Declare();
+
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media, rtActionConfig^ config);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media);
+ bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media, rtActionConfig^ config);
+ bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media);
+
+ bool setSessionTimer(unsigned timeout, Platform::String^ refresher);
+ bool set100rel(bool enabled);
+ bool setRtcp(bool enabled);
+ bool setRtcpMux(bool enabled);
+ bool setICE(bool enabled);
+ bool setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength);
+ bool setVideoFps(int32_t fps);
+ bool setVideoBandwidthUploadMax(int32_t max);
+ bool setVideoBandwidthDownloadMax(int32_t max);
+ bool setVideoPrefSize(rt_tmedia_pref_video_size_t pref_video_size);
+ bool hold(rtActionConfig^ config);
+ bool hold();
+ bool resume(rtActionConfig^ config);
+ bool resume();
+ bool transfer(Platform::String^ referToUriString, rtActionConfig^ config);
+ bool transfer(Platform::String^ referToUriString);
+ bool acceptTransfer(rtActionConfig^ config);
+ bool acceptTransfer();
+ bool rejectTransfer(rtActionConfig^ config);
+ bool rejectTransfer();
+ bool sendDTMF(int number);
+ unsigned getSessionTransferId();
#if COM_VISIBLE
- bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::String^ data);
+ bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::String^ data);
#else
- bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::IntPtr data_ptr, unsigned data_size);
+ bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::IntPtr data_ptr, unsigned data_size);
#endif
- bool sendT140Data(rt_tmedia_t140_data_type_t data_type);
- bool setT140Callback(rtT140Callback^ pT140Callback);
-
- private:
- CallSession* m_pSipSession;
- };
-
-
- /* ======================== rtMsrpSession ========================*/
- public ref class rtMsrpSession sealed : rtIInviteSession
- {
- public:
- rtMsrpSession(rtSipStack^ pStack, rtIMsrpCallback^ pCallback);
- virtual ~rtMsrpSession();
-
- internal:
- rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- MsrpSession* getWrappedSession(){ return m_pSipSession; }
-
- public:
- rtISession_Declare();
- rtIInviteSession_Declare();
-
- bool setCallback(rtIMsrpCallback^ pCallback);
- [Windows::Foundation::Metadata::DefaultOverload]
- bool callMsrp(Platform::String^ remoteUriString, rtActionConfig^ config);
- [Windows::Foundation::Metadata::DefaultOverload]
- bool callMsrp(Platform::String^ remoteUriString);
- bool callMsrp(rtSipUri^ remoteUri, rtActionConfig^ config);
- bool callMsrp(rtSipUri^ remoteUri);
+ bool sendT140Data(rt_tmedia_t140_data_type_t data_type);
+ bool setT140Callback(rtT140Callback^ pT140Callback);
+
+private:
+ CallSession* m_pSipSession;
+};
+
+
+/* ======================== rtMsrpSession ========================*/
+public ref class rtMsrpSession sealed : rtIInviteSession
+{
+public:
+ rtMsrpSession(rtSipStack^ pStack, rtIMsrpCallback^ pCallback);
+ virtual ~rtMsrpSession();
+
+internal:
+ rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+ MsrpSession* getWrappedSession() {
+ return m_pSipSession;
+ }
+
+public:
+ rtISession_Declare();
+ rtIInviteSession_Declare();
+
+ bool setCallback(rtIMsrpCallback^ pCallback);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool callMsrp(Platform::String^ remoteUriString, rtActionConfig^ config);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool callMsrp(Platform::String^ remoteUriString);
+ bool callMsrp(rtSipUri^ remoteUri, rtActionConfig^ config);
+ bool callMsrp(rtSipUri^ remoteUri);
#if COM_VISIBLE
- bool sendMessage(Platform::String^ payload, rtActionConfig^ config);
- bool sendMessage(Platform::String^ payload);
+ bool sendMessage(Platform::String^ payload, rtActionConfig^ config);
+ bool sendMessage(Platform::String^ payload);
#else
- bool sendMessage(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
- bool sendMessage(Platform::IntPtr payload, unsigned len);
+ bool sendMessage(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
+ bool sendMessage(Platform::IntPtr payload, unsigned len);
#endif
- private:
- MsrpSession* m_pSipSession;
- rtMsrpCallback^ m_pCallback;
- };
-
- /* ======================== rtMessagingSession ========================*/
- public ref class rtMessagingSession sealed : rtISipSession
- {
- internal:
- rtMessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtMessagingSession(rtSipStack^ pStack);
- virtual ~rtMessagingSession();
-
- rtISession_Declare();
-
+private:
+ MsrpSession* m_pSipSession;
+ rtMsrpCallback^ m_pCallback;
+};
+
+/* ======================== rtMessagingSession ========================*/
+public ref class rtMessagingSession sealed : rtISipSession
+{
+internal:
+ rtMessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtMessagingSession(rtSipStack^ pStack);
+ virtual ~rtMessagingSession();
+
+ rtISession_Declare();
+
#if COM_VISIBLE
- bool send(Platform::String^ payload, rtActionConfig^ config);
- bool send(Platform::String^ payload);
+ bool send(Platform::String^ payload, rtActionConfig^ config);
+ bool send(Platform::String^ payload);
#else
- [Windows::Foundation::Metadata::DefaultOverload]
- bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
- bool send(Platform::IntPtr payload, unsigned len);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
+ bool send(Platform::IntPtr payload, unsigned len);
#endif
- [Windows::Foundation::Metadata::DefaultOverload]
- bool accept(rtActionConfig^ config);
- bool accept();
- [Windows::Foundation::Metadata::DefaultOverload]
- bool reject(rtActionConfig^ config);
- bool reject();
-
- private:
- MessagingSession* m_pSipSession;
- };
-
-
- /* ======================== rtInfoSession ========================*/
- public ref class rtInfoSession sealed : rtISipSession
- {
- internal:
- rtInfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtInfoSession(rtSipStack^ pStack);
- virtual ~rtInfoSession();
-
- rtISession_Declare();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool accept(rtActionConfig^ config);
+ bool accept();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool reject(rtActionConfig^ config);
+ bool reject();
+
+private:
+ MessagingSession* m_pSipSession;
+};
+
+
+/* ======================== rtInfoSession ========================*/
+public ref class rtInfoSession sealed : rtISipSession
+{
+internal:
+ rtInfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtInfoSession(rtSipStack^ pStack);
+ virtual ~rtInfoSession();
+
+ rtISession_Declare();
#if COM_VISIBLE
- bool send(Platform::String^ payload, rtActionConfig^ config);
- bool send(Platform::String^ payload);
+ bool send(Platform::String^ payload, rtActionConfig^ config);
+ bool send(Platform::String^ payload);
#else
- [Windows::Foundation::Metadata::DefaultOverload]
- bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
- bool send(Platform::IntPtr payload, unsigned len);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
+ bool send(Platform::IntPtr payload, unsigned len);
#endif
- [Windows::Foundation::Metadata::DefaultOverload]
- bool accept(rtActionConfig^ config);
- bool accept();
- [Windows::Foundation::Metadata::DefaultOverload]
- bool reject(rtActionConfig^ config);
- bool reject();
-
- private:
- InfoSession* m_pSipSession;
- };
-
-
- /* ======================== rtOptionsSession ========================*/
- public ref class rtOptionsSession sealed : rtISipSession
- {
- internal:
- rtOptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtOptionsSession(rtSipStack^ pStack);
- virtual ~rtOptionsSession();
-
- rtISession_Declare();
-
- [Windows::Foundation::Metadata::DefaultOverload]
- bool send(rtActionConfig^ config);
- bool send();
- [Windows::Foundation::Metadata::DefaultOverload]
- bool accept(rtActionConfig^ config);
- bool accept();
- [Windows::Foundation::Metadata::DefaultOverload]
- bool reject(rtActionConfig^ config);
- bool reject();
-
- private:
- OptionsSession* m_pSipSession;
- };
-
-
- /* ======================== rtPublicationSession ========================*/
- public ref class rtPublicationSession sealed : rtISipSession
- {
- internal:
- rtPublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtPublicationSession(rtSipStack^ pStack);
- virtual ~rtPublicationSession();
-
- rtISession_Declare();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool accept(rtActionConfig^ config);
+ bool accept();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool reject(rtActionConfig^ config);
+ bool reject();
+
+private:
+ InfoSession* m_pSipSession;
+};
+
+
+/* ======================== rtOptionsSession ========================*/
+public ref class rtOptionsSession sealed : rtISipSession
+{
+internal:
+ rtOptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtOptionsSession(rtSipStack^ pStack);
+ virtual ~rtOptionsSession();
+
+ rtISession_Declare();
+
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool send(rtActionConfig^ config);
+ bool send();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool accept(rtActionConfig^ config);
+ bool accept();
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool reject(rtActionConfig^ config);
+ bool reject();
+
+private:
+ OptionsSession* m_pSipSession;
+};
+
+
+/* ======================== rtPublicationSession ========================*/
+public ref class rtPublicationSession sealed : rtISipSession
+{
+internal:
+ rtPublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtPublicationSession(rtSipStack^ pStack);
+ virtual ~rtPublicationSession();
+
+ rtISession_Declare();
#if COM_VISIBLE
- bool publish(Platform::String^ payload, rtActionConfig^ config);
- bool publish(Platform::String^ payload);
+ bool publish(Platform::String^ payload, rtActionConfig^ config);
+ bool publish(Platform::String^ payload);
#else
- [Windows::Foundation::Metadata::DefaultOverload]
- bool publish(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
- bool publish(Platform::IntPtr payload, unsigned len);
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool publish(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
+ bool publish(Platform::IntPtr payload, unsigned len);
#endif
- [Windows::Foundation::Metadata::DefaultOverload]
- bool unPublish(rtActionConfig^ config);
- bool unPublish();
-
- private:
- PublicationSession* m_pSipSession;
- };
-
-
- /* ======================== rtRegistrationSession ========================*/
- public ref class rtRegistrationSession sealed : rtISipSession
- {
- internal:
- rtRegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtRegistrationSession(rtSipStack^ pStack);
- virtual ~rtRegistrationSession();
-
- rtISession_Declare();
-
- bool register_(rtActionConfig^ config);
- bool register_();
- bool unRegister(rtActionConfig^ config);
- bool unRegister();
- bool accept(rtActionConfig^ config);
- bool accept();
- bool reject(rtActionConfig^ config);
- bool reject();
-
- private:
- RegistrationSession* m_pSipSession;
- };
-
- /* ======================== rtSubscriptionSession ========================*/
- public ref class rtSubscriptionSession sealed : rtISipSession
- {
- internal:
- rtSubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
- public:
- rtSubscriptionSession(rtSipStack^ pStack);
- virtual ~rtSubscriptionSession();
-
- rtISession_Declare();
-
- bool subscribe();
- bool unSubscribe();
-
- private:
- SubscriptionSession* m_pSipSession;
- };
- }
+ [Windows::Foundation::Metadata::DefaultOverload]
+ bool unPublish(rtActionConfig^ config);
+ bool unPublish();
+
+private:
+ PublicationSession* m_pSipSession;
+};
+
+
+/* ======================== rtRegistrationSession ========================*/
+public ref class rtRegistrationSession sealed : rtISipSession
+{
+internal:
+ rtRegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtRegistrationSession(rtSipStack^ pStack);
+ virtual ~rtRegistrationSession();
+
+ rtISession_Declare();
+
+ bool register_(rtActionConfig^ config);
+ bool register_();
+ bool unRegister(rtActionConfig^ config);
+ bool unRegister();
+ bool accept(rtActionConfig^ config);
+ bool accept();
+ bool reject(rtActionConfig^ config);
+ bool reject();
+
+private:
+ RegistrationSession* m_pSipSession;
+};
+
+/* ======================== rtSubscriptionSession ========================*/
+public ref class rtSubscriptionSession sealed : rtISipSession
+{
+internal:
+ rtSubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
+public:
+ rtSubscriptionSession(rtSipStack^ pStack);
+ virtual ~rtSubscriptionSession();
+
+ rtISession_Declare();
+
+ bool subscribe();
+ bool unSubscribe();
+
+private:
+ SubscriptionSession* m_pSipSession;
+};
+}
}
diff --git a/bindings/winrt/doubango_rt/include/rt_SipStack.h b/bindings/winrt/doubango_rt/include/rt_SipStack.h
index b55c5ae..6148420 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipStack.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipStack.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -23,98 +23,106 @@ class SipStack;
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtSipCallback;
- interface class rtISipCallback;
- ref class rtDDebugCallback;
- interface class rtIDDebugCallback;
+namespace BackEnd
+{
+ref class rtSipCallback;
+interface class rtISipCallback;
+ref class rtDDebugCallback;
+interface class rtIDDebugCallback;
- enum class rt_tdav_codec_id_t;
+enum class rt_tdav_codec_id_t;
- public ref class rtDnsResult sealed
- {
- internal:
- rtDnsResult(uint16 port, Platform::String^ address):_port(port), _address(address){}
- public:
- property uint16 Port{ uint16 get() { return _port; }; }
- property Platform::String^ Address{ Platform::String^ get() { return _address; }; }
- private:
- uint16 _port;
- Platform::String^ _address;
- };
+public ref class rtDnsResult sealed
+{
+internal:
+ rtDnsResult(uint16 port, Platform::String^ address):_port(port), _address(address) {}
+public:
+ property uint16 Port { uint16 get() {
+ return _port;
+ };
+ }
+ property Platform::String^ Address { Platform::String^ get() {
+ return _address;
+ };
+ }
+private:
+ uint16 _port;
+ Platform::String^ _address;
+};
- public ref class rtSipStack sealed
- {
- public:
- virtual ~rtSipStack();
+public ref class rtSipStack sealed
+{
+public:
+ virtual ~rtSipStack();
+
+internal:
+ rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri);
+ const SipStack* getWrappedStack() {
+ return m_pSipStack;
+ }
- internal:
- rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri);
- const SipStack* getWrappedStack() { return m_pSipStack; }
+public:
+ bool start();
+ bool setDebugCallback(rtIDDebugCallback^ pCallback);
+ bool setDisplayName(Platform::String^ display_name);
+ bool setRealm(Platform::String^ realm_uri);
+ bool setIMPI(Platform::String^ impi);
+ bool setIMPU(Platform::String^ impu_uri);
+ bool setPassword(Platform::String^ password);
+ bool setAMF(Platform::String^ amf);
+ bool setOperatorId(Platform::String^ opid);
+ bool setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion);
+ bool setLocalIP(Platform::String^ ip, Platform::String^ transport);
+ bool setLocalIP(Platform::String^ ip);
+ bool setLocalPort(unsigned short port, Platform::String^ transport);
+ bool setLocalPort(unsigned short port);
+ bool setEarlyIMS(bool enabled);
+ bool addHeader(Platform::String^ name, Platform::String^ value);
+ bool removeHeader(Platform::String^ name);
+ bool addDnsServer(Platform::String^ ip);
+ bool setDnsDiscovery(bool enabled);
+ bool setAoR(Platform::String^ ip, int port);
+ bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
+ bool addSigCompCompartment(Platform::String^ compId);
+ bool removeSigCompCompartment(Platform::String^ compId);
- public:
- bool start();
- bool setDebugCallback(rtIDDebugCallback^ pCallback);
- bool setDisplayName(Platform::String^ display_name);
- bool setRealm(Platform::String^ realm_uri);
- bool setIMPI(Platform::String^ impi);
- bool setIMPU(Platform::String^ impu_uri);
- bool setPassword(Platform::String^ password);
- bool setAMF(Platform::String^ amf);
- bool setOperatorId(Platform::String^ opid);
- bool setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion);
- bool setLocalIP(Platform::String^ ip, Platform::String^ transport);
- bool setLocalIP(Platform::String^ ip);
- bool setLocalPort(unsigned short port, Platform::String^ transport);
- bool setLocalPort(unsigned short port);
- bool setEarlyIMS(bool enabled);
- bool addHeader(Platform::String^ name, Platform::String^ value);
- bool removeHeader(Platform::String^ name);
- bool addDnsServer(Platform::String^ ip);
- bool setDnsDiscovery(bool enabled);
- bool setAoR(Platform::String^ ip, int port);
- bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
- bool addSigCompCompartment(Platform::String^ compId);
- bool removeSigCompCompartment(Platform::String^ compId);
-
- bool setSTUNServer(Platform::String^ ip, unsigned short port);
- bool setSTUNCred(Platform::String^ login, Platform::String^ password);
+ bool setSTUNServer(Platform::String^ ip, unsigned short port);
+ bool setSTUNCred(Platform::String^ login, Platform::String^ password);
- bool setTLSSecAgree(bool enabled);
- bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify);
- bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey);
- bool setIPSecSecAgree(bool enabled);
- bool setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto);
-
- Platform::String^ dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain);
+ bool setTLSSecAgree(bool enabled);
+ bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify);
+ bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey);
+ bool setIPSecSecAgree(bool enabled);
+ bool setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto);
+
+ Platform::String^ dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain);
#if COM_VISIBLE
- rtDnsResult^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service);
- rtDnsResult^ dnsSrv(Platform::String^ service);
- Platform::String^ getLocalIP(Platform::String^ protocol);
- uint16 getLocalPort(Platform::String^ protocol);
+ rtDnsResult^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service);
+ rtDnsResult^ dnsSrv(Platform::String^ service);
+ Platform::String^ getLocalIP(Platform::String^ protocol);
+ uint16 getLocalPort(Platform::String^ protocol);
#else
- Platform::String^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service, Platform::IntPtr port);
- Platform::String^ dnsSrv(Platform::String^ service, Platform::IntPtr port);
- Platform::String^ getLocalIPnPort(Platform::String^ protocol, Platform::IntPtr port);
+ Platform::String^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service, Platform::IntPtr port);
+ Platform::String^ dnsSrv(Platform::String^ service, Platform::IntPtr port);
+ Platform::String^ getLocalIPnPort(Platform::String^ protocol, Platform::IntPtr port);
#endif
- Platform::String^ getPreferredIdentity();
+ Platform::String^ getPreferredIdentity();
+
+ bool isValid();
+ bool stop();
- bool isValid();
- bool stop();
-
- static bool initialize();
- static bool deInitialize();
- static void setCodecs(enum class rt_tdav_codec_id_t codecs);
- static bool setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority);
- static bool isCodecSupported(enum class rt_tdav_codec_id_t codec_id);
+ static bool initialize();
+ static bool deInitialize();
+ static void setCodecs(enum class rt_tdav_codec_id_t codecs);
+ static bool setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority);
+ static bool isCodecSupported(enum class rt_tdav_codec_id_t codec_id);
- private:
- SipStack* m_pSipStack;
- rtSipCallback^ m_pSipCallback;
- rtDDebugCallback^ m_pDebugCallback;
- std::recursive_mutex mLock;
- };
- }
+private:
+ SipStack* m_pSipStack;
+ rtSipCallback^ m_pSipCallback;
+ rtDDebugCallback^ m_pDebugCallback;
+ std::recursive_mutex mLock;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_SipUri.h b/bindings/winrt/doubango_rt/include/rt_SipUri.h
index 3917f87..99db756 100755
--- a/bindings/winrt/doubango_rt/include/rt_SipUri.h
+++ b/bindings/winrt/doubango_rt/include/rt_SipUri.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -23,38 +23,40 @@ class SipUri;
namespace doubango_rt
{
- namespace BackEnd
- {
- public ref class rtSipUri sealed
- {
- public:
- virtual ~rtSipUri();
- rtSipUri(Platform::String^ uriString, Platform::String^ displayName);
- rtSipUri(Platform::String^ uriString);
-
-
- public:
- static bool isValid(Platform::String^ uri);
+namespace BackEnd
+{
+public ref class rtSipUri sealed
+{
+public:
+ virtual ~rtSipUri();
+ rtSipUri(Platform::String^ uriString, Platform::String^ displayName);
+ rtSipUri(Platform::String^ uriString);
+
+
+public:
+ static bool isValid(Platform::String^ uri);
#if COM_VISIBLE
- bool isValid_();
+ bool isValid_();
#else
- bool isValid();
+ bool isValid();
#endif
- Platform::String^ getScheme();
- Platform::String^ getHost();
- unsigned short getPort();
- Platform::String^ getUserName();
- Platform::String^ getPassword();
- Platform::String^ getDisplayName();
- Platform::String^ getParamValue(Platform::String^ name);
- void setDisplayName(Platform::String^ displayName);
-
- internal:
- const SipUri* getWrappedUri(){ return m_pSipUri; }
-
- private:
- SipUri* m_pSipUri;
- };
- }
+ Platform::String^ getScheme();
+ Platform::String^ getHost();
+ unsigned short getPort();
+ Platform::String^ getUserName();
+ Platform::String^ getPassword();
+ Platform::String^ getDisplayName();
+ Platform::String^ getParamValue(Platform::String^ name);
+ void setDisplayName(Platform::String^ displayName);
+
+internal:
+ const SipUri* getWrappedUri() {
+ return m_pSipUri;
+ }
+
+private:
+ SipUri* m_pSipUri;
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_String.h b/bindings/winrt/doubango_rt/include/rt_String.h
index 5562b5d..ce227ae 100755
--- a/bindings/winrt/doubango_rt/include/rt_String.h
+++ b/bindings/winrt/doubango_rt/include/rt_String.h
@@ -1,17 +1,17 @@
/*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.
*/
@@ -21,13 +21,13 @@
namespace doubango_rt
{
- namespace BackEnd
- {
- ref class rtString sealed
- {
- internal:
- static std::vector<char> toUtf8(Platform::String^ str);
- static Platform::String^ toString(char const* str);
- };
- }
+namespace BackEnd
+{
+ref class rtString sealed
+{
+internal:
+ static std::vector<char> toUtf8(Platform::String^ str);
+ static Platform::String^ toString(char const* str);
+};
+}
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/include/rt_Xcap.h b/bindings/winrt/doubango_rt/include/rt_Xcap.h
index 9385aed..d47a63c 100755
--- a/bindings/winrt/doubango_rt/include/rt_Xcap.h
+++ b/bindings/winrt/doubango_rt/include/rt_Xcap.h
@@ -1,17 +1,17 @@
/*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.
*/
diff --git a/bindings/winrt/doubango_rt/src/rt_ActionConfig.cxx b/bindings/winrt/doubango_rt/src/rt_ActionConfig.cxx
index 02f713e..b076eba 100755
--- a/bindings/winrt/doubango_rt/src/rt_ActionConfig.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_ActionConfig.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -26,51 +26,51 @@ using namespace std;
rtActionConfig::rtActionConfig()
{
- m_pActionConfig = new ActionConfig();
+ m_pActionConfig = new ActionConfig();
}
rtActionConfig::~rtActionConfig()
{
- rtSafeDelete(m_pActionConfig);
+ rtSafeDelete(m_pActionConfig);
}
-
+
bool rtActionConfig::addHeader(String^ name, String^ value)
{
- return m_pActionConfig->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
+ return m_pActionConfig->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
}
bool rtActionConfig::setActiveMedia(rt_twrap_media_type_t type)
{
- return m_pActionConfig->setActiveMedia((twrap_media_type_t)type);
+ return m_pActionConfig->setActiveMedia((twrap_media_type_t)type);
}
#if COM_VISIBLE
bool rtActionConfig::addPayload(Platform::String^ payload)
{
- static std::vector<char> _payload = rtString::toUtf8(payload);
- return m_pActionConfig->addPayload(_payload.data(), _payload.size());
+ static std::vector<char> _payload = rtString::toUtf8(payload);
+ return m_pActionConfig->addPayload(_payload.data(), _payload.size());
}
#else
bool rtActionConfig::addPayload(IntPtr payload, unsigned len)
{
- return m_pActionConfig->addPayload((const void*)payload, len);
+ return m_pActionConfig->addPayload((const void*)payload, len);
}
#endif /* COM_VISIBLE */
-
+
rtActionConfig^ rtActionConfig::setResponseLine(short code, String^ phrase)
{
- m_pActionConfig->setResponseLine(code, rtString::toUtf8(phrase).data());
- return this;
+ m_pActionConfig->setResponseLine(code, rtString::toUtf8(phrase).data());
+ return this;
}
rtActionConfig^ rtActionConfig::setMediaString(rt_twrap_media_type_t type, String^ key, String^ value)
{
- m_pActionConfig->setMediaString((twrap_media_type_t)type, rtString::toUtf8(key).data(), rtString::toUtf8(value).data());
- return this;
+ m_pActionConfig->setMediaString((twrap_media_type_t)type, rtString::toUtf8(key).data(), rtString::toUtf8(value).data());
+ return this;
}
rtActionConfig^ rtActionConfig::setMediaInt(rt_twrap_media_type_t type, String^ key, int value)
{
- m_pActionConfig->setMediaInt((twrap_media_type_t)type, rtString::toUtf8(key).data(), value);
- return this;
+ m_pActionConfig->setMediaInt((twrap_media_type_t)type, rtString::toUtf8(key).data(), value);
+ return this;
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_DDebug.cxx b/bindings/winrt/doubango_rt/src/rt_DDebug.cxx
index a03300c..dcb75ea 100755
--- a/bindings/winrt/doubango_rt/src/rt_DDebug.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_DDebug.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -27,52 +27,46 @@ using namespace std;
class DDebugCallbackProxy : public DDebugCallback
{
public:
- DDebugCallbackProxy(rtDDebugCallback^ pCallback)
- {
- m_pCallback = pCallback;
- }
+ DDebugCallbackProxy(rtDDebugCallback^ pCallback) {
+ m_pCallback = pCallback;
+ }
- ~DDebugCallbackProxy()
- {
-
- }
+ ~DDebugCallbackProxy() {
- virtual int OnDebugInfo(const char* message)
- {
- return m_pCallback->m_pI->OnDebugInfo(rtString::toString(message));
- }
+ }
- virtual int OnDebugWarn(const char* message)
- {
- return m_pCallback->m_pI->OnDebugWarn(rtString::toString(message));
- }
+ virtual int OnDebugInfo(const char* message) {
+ return m_pCallback->m_pI->OnDebugInfo(rtString::toString(message));
+ }
- virtual int OnDebugError(const char* message)
- {
- return m_pCallback->m_pI->OnDebugError(rtString::toString(message));
- }
+ virtual int OnDebugWarn(const char* message) {
+ return m_pCallback->m_pI->OnDebugWarn(rtString::toString(message));
+ }
- virtual int OnDebugFatal(const char* message)
- {
- return m_pCallback->m_pI->OnDebugFatal(rtString::toString(message));
- }
+ virtual int OnDebugError(const char* message) {
+ return m_pCallback->m_pI->OnDebugError(rtString::toString(message));
+ }
+
+ virtual int OnDebugFatal(const char* message) {
+ return m_pCallback->m_pI->OnDebugFatal(rtString::toString(message));
+ }
private:
- rtDDebugCallback^ m_pCallback;
+ rtDDebugCallback^ m_pCallback;
};
rtDDebugCallback::rtDDebugCallback(rtIDDebugCallback^ pI)
{
- m_pI = pI;
- m_pCallback = new DDebugCallbackProxy(this);
+ m_pI = pI;
+ m_pCallback = new DDebugCallbackProxy(this);
}
rtDDebugCallback::~rtDDebugCallback()
{
- rtSafeDelete(m_pCallback);
-}
-
+ rtSafeDelete(m_pCallback);
+}
+
const DDebugCallback* rtDDebugCallback::getWrappedCallback()
{
- return dynamic_cast<const DDebugCallback*>(m_pCallback);
+ return dynamic_cast<const DDebugCallback*>(m_pCallback);
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_Enums.cxx b/bindings/winrt/doubango_rt/src/rt_Enums.cxx
index fa2645c..888ffa4 100755
--- a/bindings/winrt/doubango_rt/src/rt_Enums.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_Enums.cxx
@@ -1,17 +1,17 @@
/*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_enums.h" \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_MediaContent.cxx b/bindings/winrt/doubango_rt/src/rt_MediaContent.cxx
index 623cb1f..b510d81 100755
--- a/bindings/winrt/doubango_rt/src/rt_MediaContent.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_MediaContent.cxx
@@ -1,17 +1,17 @@
/*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.
*/ \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx b/bindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx
index 7d2c6f0..fcd9b21 100755
--- a/bindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_MediaSessionMgr.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -27,348 +27,347 @@ using namespace std;
rtCodec::rtCodec(struct tmedia_codec_s* pCodec)
{
- m_pCodec = new Codec(pCodec);
+ m_pCodec = new Codec(pCodec);
}
-
+
rtCodec::~rtCodec()
{
- rtSafeDelete(m_pCodec);
+ rtSafeDelete(m_pCodec);
}
enum class rt_twrap_media_type_t rtCodec::getMediaType()
{
- return (rt_twrap_media_type_t)m_pCodec->getMediaType();
+ return (rt_twrap_media_type_t)m_pCodec->getMediaType();
}
Platform::String^ rtCodec::getName()
{
- return rtString::toString(m_pCodec->getName());
+ return rtString::toString(m_pCodec->getName());
}
Platform::String^ rtCodec::getDescription()
{
- return rtString::toString(m_pCodec->getDescription());
+ return rtString::toString(m_pCodec->getDescription());
}
Platform::String^ rtCodec::getNegFormat()
{
- return rtString::toString(m_pCodec->getNegFormat());
+ return rtString::toString(m_pCodec->getNegFormat());
}
int rtCodec::getAudioSamplingRate()
{
- return m_pCodec->getAudioSamplingRate();
+ return m_pCodec->getAudioSamplingRate();
}
int rtCodec::getAudioChannels()
{
- return m_pCodec->getAudioChannels();
+ return m_pCodec->getAudioChannels();
}
int rtCodec::getAudioPTime()
{
- return m_pCodec->getAudioPTime();
+ return m_pCodec->getAudioPTime();
}
rtMediaSessionMgr::rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr)
{
- m_pMediaSessionMgr = new MediaSessionMgr(pWrappedMgr);
+ m_pMediaSessionMgr = new MediaSessionMgr(pWrappedMgr);
}
rtMediaSessionMgr::~rtMediaSessionMgr()
{
- rtSafeDelete(m_pMediaSessionMgr);
+ 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);
+ 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());
+ 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);
+ 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);
+ 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);
+ 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);
+ 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;
+ 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());
+ 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);
+ return m_pMediaSessionMgr->getSessionId((twrap_media_type_t)media);
}
-
+
bool rtMediaSessionMgr::defaultsSetProfile(rt_tmedia_profile_t profile)
{
- return MediaSessionMgr::defaultsSetProfile((tmedia_profile_t) profile);
+ return MediaSessionMgr::defaultsSetProfile((tmedia_profile_t) profile);
}
rt_tmedia_profile_t rtMediaSessionMgr::defaultsGetProfile()
{
- return (rt_tmedia_profile_t)MediaSessionMgr::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);
+ return MediaSessionMgr::defaultsSetPrefVideoSize((tmedia_pref_video_size_t) pref_video_size);
}
bool rtMediaSessionMgr::defaultsSetJbMargin(uint32 jb_margin_ms)
{
- return MediaSessionMgr::defaultsSetJbMargin(jb_margin_ms);
+ return MediaSessionMgr::defaultsSetJbMargin(jb_margin_ms);
}
bool rtMediaSessionMgr::defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent)
{
- return MediaSessionMgr::defaultsSetJbMaxLateRate(jb_late_rate_percent);
+ return MediaSessionMgr::defaultsSetJbMaxLateRate(jb_late_rate_percent);
}
bool rtMediaSessionMgr::defaultsSetEchoTail(uint32 echo_tail)
{
- return MediaSessionMgr::defaultsSetEchoTail(echo_tail);
+ return MediaSessionMgr::defaultsSetEchoTail(echo_tail);
}
uint32 rtMediaSessionMgr::defaultsGetEchoTail()
{
- return MediaSessionMgr::defaultsGetEchoTail();
+ return MediaSessionMgr::defaultsGetEchoTail();
}
bool rtMediaSessionMgr::defaultsSetEchoSkew(uint32 echo_skew)
{
- return MediaSessionMgr::defaultsSetEchoSkew(echo_skew);
+ return MediaSessionMgr::defaultsSetEchoSkew(echo_skew);
}
bool rtMediaSessionMgr::defaultsSetEchoSuppEnabled(bool echo_supp_enabled)
{
- return MediaSessionMgr::defaultsSetEchoSuppEnabled(echo_supp_enabled);
+ return MediaSessionMgr::defaultsSetEchoSuppEnabled(echo_supp_enabled);
}
bool rtMediaSessionMgr::defaultsGetEchoSuppEnabled()
{
- return MediaSessionMgr::defaultsGetEchoSuppEnabled();
+ return MediaSessionMgr::defaultsGetEchoSuppEnabled();
}
bool rtMediaSessionMgr::defaultsSetAgcEnabled(bool agc_enabled)
{
- return MediaSessionMgr::defaultsSetAgcEnabled(agc_enabled);
+ return MediaSessionMgr::defaultsSetAgcEnabled(agc_enabled);
}
bool rtMediaSessionMgr::defaultsGetAgcEnabled()
{
- return MediaSessionMgr::defaultsGetAgcEnabled();
+ return MediaSessionMgr::defaultsGetAgcEnabled();
}
bool rtMediaSessionMgr::defaultsSetAgcLevel(float agc_level)
{
- return MediaSessionMgr::defaultsSetAgcLevel(agc_level);
+ return MediaSessionMgr::defaultsSetAgcLevel(agc_level);
}
float rtMediaSessionMgr::defaultsGetAgcLevel()
{
- return MediaSessionMgr::defaultsGetAgcLevel();
+ return MediaSessionMgr::defaultsGetAgcLevel();
}
bool rtMediaSessionMgr::defaultsSetVadEnabled(bool vad_enabled)
{
- return MediaSessionMgr::defaultsSetVadEnabled(vad_enabled);
+ return MediaSessionMgr::defaultsSetVadEnabled(vad_enabled);
}
bool rtMediaSessionMgr::defaultsGetGetVadEnabled()
{
- return MediaSessionMgr::defaultsGetGetVadEnabled();
+ return MediaSessionMgr::defaultsGetGetVadEnabled();
}
bool rtMediaSessionMgr::defaultsSetNoiseSuppEnabled(bool noise_supp_enabled)
{
- return MediaSessionMgr::defaultsSetNoiseSuppEnabled(noise_supp_enabled);
+ return MediaSessionMgr::defaultsSetNoiseSuppEnabled(noise_supp_enabled);
}
bool rtMediaSessionMgr::defaultsGetNoiseSuppEnabled()
{
- return MediaSessionMgr::defaultsGetNoiseSuppEnabled();
+ return MediaSessionMgr::defaultsGetNoiseSuppEnabled();
}
bool rtMediaSessionMgr::defaultsSetNoiseSuppLevel(int32 noise_supp_level)
{
- return MediaSessionMgr::defaultsSetNoiseSuppLevel(noise_supp_level);
+ return MediaSessionMgr::defaultsSetNoiseSuppLevel(noise_supp_level);
}
int32 rtMediaSessionMgr::defaultsGetNoiseSuppLevel()
{
- return MediaSessionMgr::defaultsGetNoiseSuppLevel();
+ return MediaSessionMgr::defaultsGetNoiseSuppLevel();
}
bool rtMediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
{
- return MediaSessionMgr::defaultsSet100relEnabled(_100rel_enabled);
+ return MediaSessionMgr::defaultsSet100relEnabled(_100rel_enabled);
}
bool rtMediaSessionMgr::defaultsGet100relEnabled()
{
- return MediaSessionMgr::defaultsGet100relEnabled();
+ return MediaSessionMgr::defaultsGet100relEnabled();
}
bool rtMediaSessionMgr::defaultsSetScreenSize(int32 sx, int32 sy)
{
- return MediaSessionMgr::defaultsSetScreenSize(sx, sy);
+ return MediaSessionMgr::defaultsSetScreenSize(sx, sy);
}
bool rtMediaSessionMgr::defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain)
{
- return MediaSessionMgr::defaultsSetAudioGain(producer_gain, 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);
+ return MediaSessionMgr::defaultsSetRtpPortRange(range_start, range_stop);
}
bool rtMediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled)
{
- return MediaSessionMgr::defaultsSetRtpSymetricEnabled(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);
+ return MediaSessionMgr::defaultsSetMediaType((twrap_media_type_t) media_type);
}
bool rtMediaSessionMgr::defaultsSetVolume(int32 volume)
{
- return MediaSessionMgr::defaultsSetVolume(volume);
+ return MediaSessionMgr::defaultsSetVolume(volume);
}
int32 rtMediaSessionMgr::defaultsGetVolume()
{
- return MediaSessionMgr::defaultsGetVolume();
+ return MediaSessionMgr::defaultsGetVolume();
}
bool rtMediaSessionMgr::defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher)
{
- return MediaSessionMgr::defaultsSetInviteSessionTimers(timeout, rtString::toUtf8(refresher).data());
+ 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);
+ 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();
+ 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);
+ 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();
+ return (rt_tmedia_srtp_type_t)MediaSessionMgr::defaultsGetSRtpType();
}
bool rtMediaSessionMgr::defaultsSetRtcpEnabled(bool enabled)
{
- return MediaSessionMgr::defaultsSetRtcpEnabled(enabled);
+ return MediaSessionMgr::defaultsSetRtcpEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetRtcpEnabled()
{
- return MediaSessionMgr::defaultsGetRtcpEnabled();
+ return MediaSessionMgr::defaultsGetRtcpEnabled();
}
bool rtMediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled)
{
- return MediaSessionMgr::defaultsSetRtcpMuxEnabled(enabled);
+ return MediaSessionMgr::defaultsSetRtcpMuxEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetRtcpMuxEnabled()
{
- return MediaSessionMgr::defaultsGetRtcpMuxEnabled();
+ return MediaSessionMgr::defaultsGetRtcpMuxEnabled();
}
bool rtMediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled)
{
- return MediaSessionMgr::defaultsSetIceEnabled(ice_enabled);
+ return MediaSessionMgr::defaultsSetIceEnabled(ice_enabled);
}
bool rtMediaSessionMgr::defaultsSetByPassEncoding(bool enabled)
{
- return MediaSessionMgr::defaultsSetByPassEncoding(enabled);
+ return MediaSessionMgr::defaultsSetByPassEncoding(enabled);
}
bool rtMediaSessionMgr::defaultsGetByPassEncoding()
{
- return MediaSessionMgr::defaultsGetByPassEncoding();
+ return MediaSessionMgr::defaultsGetByPassEncoding();
}
bool rtMediaSessionMgr::defaultsSetByPassDecoding(bool enabled)
{
- return MediaSessionMgr::defaultsSetByPassDecoding(enabled);
+ return MediaSessionMgr::defaultsSetByPassDecoding(enabled);
}
bool rtMediaSessionMgr::defaultsGetByPassDecoding()
{
- return MediaSessionMgr::defaultsGetByPassDecoding();
+ return MediaSessionMgr::defaultsGetByPassDecoding();
}
bool rtMediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled)
{
- return MediaSessionMgr::defaultsSetVideoJbEnabled(enabled);
+ return MediaSessionMgr::defaultsSetVideoJbEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetVideoJbEnabled()
{
- return MediaSessionMgr::defaultsGetVideoJbEnabled();
+ return MediaSessionMgr::defaultsGetVideoJbEnabled();
}
bool rtMediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize)
{
- return MediaSessionMgr::defaultsSetRtpBuffSize(buffSize);
+ return MediaSessionMgr::defaultsSetRtpBuffSize(buffSize);
}
unsigned rtMediaSessionMgr::defaultsGetRtpBuffSize()
{
- return MediaSessionMgr::defaultsGetRtpBuffSize();
+ return MediaSessionMgr::defaultsGetRtpBuffSize();
}
bool rtMediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max)
{
- return MediaSessionMgr::defaultsSetAvpfTail(tail_min, tail_max);
+ return MediaSessionMgr::defaultsSetAvpfTail(tail_min, tail_max);
}
diff --git a/bindings/winrt/doubango_rt/src/rt_Msrp.cxx b/bindings/winrt/doubango_rt/src/rt_Msrp.cxx
index 1d09f06..6699495 100755
--- a/bindings/winrt/doubango_rt/src/rt_Msrp.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_Msrp.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -35,103 +35,101 @@ using namespace std;
rtMsrpMessage::rtMsrpMessage(struct tmsrp_message_s *message)
{
- m_pMsrpMessage= new MsrpMessage(message);
+ m_pMsrpMessage= new MsrpMessage(message);
}
rtMsrpMessage::~rtMsrpMessage()
{
- rtSafeDelete(m_pMsrpMessage);
+ rtSafeDelete(m_pMsrpMessage);
}
bool rtMsrpMessage::isRequest()
{
- return m_pMsrpMessage->isRequest();
+ return m_pMsrpMessage->isRequest();
}
short rtMsrpMessage::getCode()
{
- return m_pMsrpMessage->getCode();
+ return m_pMsrpMessage->getCode();
}
String^ rtMsrpMessage::getPhrase()
{
- return rtString::toString(m_pMsrpMessage->getPhrase());
+ return rtString::toString(m_pMsrpMessage->getPhrase());
}
rt_tmsrp_request_type_t rtMsrpMessage::getRequestType()
{
- return (rt_tmsrp_request_type_t)m_pMsrpMessage->getRequestType();
+ return (rt_tmsrp_request_type_t)m_pMsrpMessage->getRequestType();
}
#if COM_VISIBLE
rtMsrpByteRange^ rtMsrpMessage::getByteRange()
{
- int64_t _start = -1, _end = -1, _total = -1;
- m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
- return ref new rtMsrpByteRange(_start, _end, _total);
+ int64_t _start = -1, _end = -1, _total = -1;
+ m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
+ return ref new rtMsrpByteRange(_start, _end, _total);
}
#else
void rtMsrpMessage::getByteRange(IntPtr start, IntPtr end, IntPtr total)
{
- int64_t _start = -1, _end = -1, _total = -1;
- m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
- // IntPtr is 32bit or 64bit -> 32 to be sure not memory errors will raise
- *((int32_t*)(void*)start) = (int32_t)_start;
- *((int32_t*)(void*)end) = (int32_t)_end;
- *((int32_t*)(void*)total) = (int32_t)_total;
+ int64_t _start = -1, _end = -1, _total = -1;
+ m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
+ // IntPtr is 32bit or 64bit -> 32 to be sure not memory errors will raise
+ *((int32_t*)(void*)start) = (int32_t)_start;
+ *((int32_t*)(void*)end) = (int32_t)_end;
+ *((int32_t*)(void*)total) = (int32_t)_total;
}
#endif /* COM_VISIBLE */
bool rtMsrpMessage::isLastChunck()
{
- return m_pMsrpMessage->isLastChunck();
+ return m_pMsrpMessage->isLastChunck();
}
bool rtMsrpMessage::isFirstChunck()
{
- return m_pMsrpMessage->isFirstChunck();
+ return m_pMsrpMessage->isFirstChunck();
}
bool rtMsrpMessage::isSuccessReport()
{
- return m_pMsrpMessage->isSuccessReport();
+ return m_pMsrpMessage->isSuccessReport();
}
String^ rtMsrpMessage::getMsrpHeaderValue(String^ name)
{
- return rtString::toString(m_pMsrpMessage->getMsrpHeaderValue(rtString::toUtf8(name).data()));
+ return rtString::toString(m_pMsrpMessage->getMsrpHeaderValue(rtString::toUtf8(name).data()));
}
String^ rtMsrpMessage::getMsrpHeaderParamValue(String^ name, String^ param)
{
- return rtString::toString(m_pMsrpMessage->getMsrpHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data()));
+ return rtString::toString(m_pMsrpMessage->getMsrpHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data()));
}
unsigned rtMsrpMessage::getMsrpContentLength()
{
- return m_pMsrpMessage->getMsrpContentLength();
+ return m_pMsrpMessage->getMsrpContentLength();
}
#if COM_VISIBLE
String^ rtMsrpMessage::getMsrpContent(unsigned maxsize)
{
- if(maxsize)
- {
- void* _s = calloc(maxsize + 1, 1);
- if(_s)
- {
- unsigned len = m_pMsrpMessage->getMsrpContent(_s, maxsize);
- String^ s = rtString::toString((const char*)_s);
- free(_s);
- return s;
- }
- }
- return nullptr;
+ if(maxsize) {
+ void* _s = calloc(maxsize + 1, 1);
+ if(_s) {
+ unsigned len = m_pMsrpMessage->getMsrpContent(_s, maxsize);
+ String^ s = rtString::toString((const char*)_s);
+ free(_s);
+ return s;
+ }
+ }
+ return nullptr;
}
#else
unsigned rtMsrpMessage::getMsrpContent(IntPtr output, unsigned maxsize)
{
- return m_pMsrpMessage->getMsrpContent((void*)output, maxsize);
+ return m_pMsrpMessage->getMsrpContent((void*)output, maxsize);
}
#endif /* COM_VISIBLE */
@@ -142,37 +140,35 @@ unsigned rtMsrpMessage::getMsrpContent(IntPtr output, unsigned maxsize)
rtMsrpEvent::rtMsrpEvent(const struct tmsrp_event_s *event)
{
- m_pMsrpEvent = new MsrpEvent(event);
+ m_pMsrpEvent = new MsrpEvent(event);
}
-
+
rtMsrpEvent::~rtMsrpEvent()
{
- rtSafeDelete(m_pMsrpEvent);
+ rtSafeDelete(m_pMsrpEvent);
}
rt_tmsrp_event_type_t rtMsrpEvent::getType()
{
- return (rt_tmsrp_event_type_t)m_pMsrpEvent->getType();
+ return (rt_tmsrp_event_type_t)m_pMsrpEvent->getType();
}
rtMsrpSession^ rtMsrpEvent::getSipSession()
{
- if(m_pMsrpEvent->getSipSession())
- {
- assert(0); // FIXME: Not implemented
- return nullptr;
- // return ref new rtMsrpSession(m_pMsrpEvent->getSipSession()->getWrappedSession());
- }
- return nullptr;
+ if(m_pMsrpEvent->getSipSession()) {
+ assert(0); // FIXME: Not implemented
+ return nullptr;
+ // return ref new rtMsrpSession(m_pMsrpEvent->getSipSession()->getWrappedSession());
+ }
+ return nullptr;
}
rtMsrpMessage^ rtMsrpEvent::getMessage()
{
- if(m_pMsrpEvent->getMessage())
- {
- return ref new rtMsrpMessage(const_cast<struct tmsrp_message_s *>(const_cast<MsrpMessage*>(m_pMsrpEvent->getMessage())->getWrappedMsrpMessage()));
- }
- return nullptr;
+ if(m_pMsrpEvent->getMessage()) {
+ return ref new rtMsrpMessage(const_cast<struct tmsrp_message_s *>(const_cast<MsrpMessage*>(m_pMsrpEvent->getMessage())->getWrappedMsrpMessage()));
+ }
+ return nullptr;
}
//
@@ -181,14 +177,13 @@ rtMsrpMessage^ rtMsrpEvent::getMessage()
rtMsrpCallback::rtMsrpCallback(rtIMsrpCallback^ pI)
{
- m_pI = pI;
- m_pCallback = new MsrpCallback();
+ m_pI = pI;
+ m_pCallback = new MsrpCallback();
}
rtMsrpCallback::~rtMsrpCallback()
{
- rtSafeDelete(m_pCallback);
+ rtSafeDelete(m_pCallback);
}
- \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx b/bindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx
index 623cb1f..b510d81 100755
--- a/bindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SMSEncoder.cxx
@@ -1,17 +1,17 @@
/*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.
*/ \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SipCallback.cxx b/bindings/winrt/doubango_rt/src/rt_SipCallback.cxx
index 68c6299..ce5c0c9 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipCallback.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipCallback.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -28,108 +28,89 @@ using namespace std;
class SipCallbackProxy : public SipCallback
{
public:
- SipCallbackProxy(rtSipCallback^ rtCallback)
- {
- m_pCallback = rtCallback;
- }
-
- virtual int OnDialogEvent(const DialogEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnDialogEvent(ref new rtDialogEvent(const_cast<tsip_event_t*>(const_cast<DialogEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnStackEvent(const StackEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnStackEvent(ref new rtStackEvent(const_cast<tsip_event_t*>(const_cast<StackEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnInviteEvent(const InviteEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnInviteEvent(ref new rtInviteEvent(const_cast<tsip_event_t*>(const_cast<InviteEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnMessagingEvent(const MessagingEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnMessagingEvent(ref new rtMessagingEvent(const_cast<tsip_event_t*>(const_cast<MessagingEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnInfoEvent(const InfoEvent* e) override
- {
- if(m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnInfoEvent(ref new rtInfoEvent(const_cast<tsip_event_t*>(const_cast<InfoEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnOptionsEvent(const OptionsEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnOptionsEvent(ref new rtOptionsEvent(const_cast<tsip_event_t*>(const_cast<OptionsEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnPublicationEvent(const PublicationEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnPublicationEvent(ref new rtPublicationEvent(const_cast<tsip_event_t*>(const_cast<PublicationEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnRegistrationEvent(const RegistrationEvent* e) override
- {
- if(m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnRegistrationEvent(ref new rtRegistrationEvent(const_cast<tsip_event_t*>(const_cast<RegistrationEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
-
- virtual int OnSubscriptionEvent(const SubscriptionEvent* e) override
- {
- if(e && m_pCallback && m_pCallback->m_pI)
- {
- return m_pCallback->m_pI->OnSubscriptionEvent(ref new rtSubscriptionEvent(const_cast<tsip_event_t*>(const_cast<SubscriptionEvent*>(e)->getWrappedEvent())));
- }
- return 0;
- }
+ SipCallbackProxy(rtSipCallback^ rtCallback) {
+ m_pCallback = rtCallback;
+ }
+
+ virtual int OnDialogEvent(const DialogEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnDialogEvent(ref new rtDialogEvent(const_cast<tsip_event_t*>(const_cast<DialogEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnStackEvent(const StackEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnStackEvent(ref new rtStackEvent(const_cast<tsip_event_t*>(const_cast<StackEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnInviteEvent(const InviteEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnInviteEvent(ref new rtInviteEvent(const_cast<tsip_event_t*>(const_cast<InviteEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnMessagingEvent(const MessagingEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnMessagingEvent(ref new rtMessagingEvent(const_cast<tsip_event_t*>(const_cast<MessagingEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnInfoEvent(const InfoEvent* e) override {
+ if(m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnInfoEvent(ref new rtInfoEvent(const_cast<tsip_event_t*>(const_cast<InfoEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnOptionsEvent(const OptionsEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnOptionsEvent(ref new rtOptionsEvent(const_cast<tsip_event_t*>(const_cast<OptionsEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnPublicationEvent(const PublicationEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnPublicationEvent(ref new rtPublicationEvent(const_cast<tsip_event_t*>(const_cast<PublicationEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnRegistrationEvent(const RegistrationEvent* e) override {
+ if(m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnRegistrationEvent(ref new rtRegistrationEvent(const_cast<tsip_event_t*>(const_cast<RegistrationEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
+
+ virtual int OnSubscriptionEvent(const SubscriptionEvent* e) override {
+ if(e && m_pCallback && m_pCallback->m_pI) {
+ return m_pCallback->m_pI->OnSubscriptionEvent(ref new rtSubscriptionEvent(const_cast<tsip_event_t*>(const_cast<SubscriptionEvent*>(e)->getWrappedEvent())));
+ }
+ return 0;
+ }
private:
- rtSipCallback^ m_pCallback;
+ rtSipCallback^ m_pCallback;
};
rtSipCallback::rtSipCallback(rtISipCallback^ pI)
{
- m_pI = pI;
- m_pCallback = new SipCallbackProxy(this);
+ m_pI = pI;
+ m_pCallback = new SipCallbackProxy(this);
}
rtSipCallback::~rtSipCallback()
{
- rtSafeDelete(m_pCallback);
+ rtSafeDelete(m_pCallback);
}
const SipCallback* rtSipCallback::getWrappedCallback()
-{
- return dynamic_cast<const SipCallback*>(m_pCallback);
+{
+ return dynamic_cast<const SipCallback*>(m_pCallback);
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SipEvent.cxx b/bindings/winrt/doubango_rt/src/rt_SipEvent.cxx
index 1bd414e..65c5dbd 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipEvent.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipEvent.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -38,7 +38,7 @@ rt##cls##Session^ rt##cls##Event::getSession(){ \
} \
return nullptr; \
} \
-
+
#define rt_takeOwnership_Implement(cls, name, session) \
rt##name##Session^ rt##cls##Event::take##session##Ownership(){ \
name##Session* s = m_pEvent->take##session##Ownership(); \
@@ -49,18 +49,18 @@ rt##name##Session^ rt##cls##Event::take##session##Ownership(){ \
} \
return nullptr; \
} \
-
+
/* ======================== rtDialogEvent ========================*/
rtISipEvent_Implement(rtDialogEvent);
rtDialogEvent::rtDialogEvent(const struct tsip_event_s *e)
{
- m_pEvent = new DialogEvent(e);
+ m_pEvent = new DialogEvent(e);
}
rtDialogEvent::~rtDialogEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
@@ -69,36 +69,36 @@ rtISipEvent_Implement(rtStackEvent);
rtStackEvent::rtStackEvent(const struct tsip_event_s *e)
{
- m_pEvent = new StackEvent(e);
+ m_pEvent = new StackEvent(e);
}
rtStackEvent::~rtStackEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
- /* ======================== rtInviteEvent ========================*/
+/* ======================== rtInviteEvent ========================*/
rtISipEvent_Implement(rtInviteEvent);
rtInviteEvent::rtInviteEvent(const struct tsip_event_s *e)
{
- m_pEvent = new InviteEvent(e);
+ m_pEvent = new InviteEvent(e);
}
rtInviteEvent::~rtInviteEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_invite_event_type_t rtInviteEvent::getType()
{
- return (rt_tsip_invite_event_type_t)m_pEvent->getType();
+ return (rt_tsip_invite_event_type_t)m_pEvent->getType();
}
rt_twrap_media_type_t rtInviteEvent::getMediaType()
{
- return (rt_twrap_media_type_t)m_pEvent->getMediaType();
+ return (rt_twrap_media_type_t)m_pEvent->getMediaType();
}
rt_getSession_Implement(Invite);
@@ -110,18 +110,18 @@ rtISipEvent_Implement(rtMessagingEvent);
rtMessagingEvent::rtMessagingEvent(const struct tsip_event_s *e)
{
- m_pEvent = new MessagingEvent(e);
+ m_pEvent = new MessagingEvent(e);
}
-
+
rtMessagingEvent::~rtMessagingEvent()
{
- rtSafeDelete(m_pEvent);
-}
+ rtSafeDelete(m_pEvent);
+}
rt_tsip_message_event_type_t rtMessagingEvent::getType()
{
- return (rt_tsip_message_event_type_t)m_pEvent->getType();
+ return (rt_tsip_message_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Messaging);
@@ -133,17 +133,17 @@ rtISipEvent_Implement(rtInfoEvent);
rtInfoEvent::rtInfoEvent(const struct tsip_event_s *e)
{
- m_pEvent = new InfoEvent(e);
+ m_pEvent = new InfoEvent(e);
}
rtInfoEvent::~rtInfoEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_info_event_type_t rtInfoEvent::getType()
{
- return (rt_tsip_info_event_type_t)m_pEvent->getType();
+ return (rt_tsip_info_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Info);
@@ -155,17 +155,17 @@ rtISipEvent_Implement(rtOptionsEvent);
rtOptionsEvent::rtOptionsEvent(const struct tsip_event_s *e)
{
- m_pEvent = new OptionsEvent(e);
+ m_pEvent = new OptionsEvent(e);
}
rtOptionsEvent::~rtOptionsEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_options_event_type_t rtOptionsEvent::getType()
{
- return (rt_tsip_options_event_type_t)m_pEvent->getType();
+ return (rt_tsip_options_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Options);
@@ -177,17 +177,17 @@ rtISipEvent_Implement(rtPublicationEvent);
rtPublicationEvent::rtPublicationEvent(const struct tsip_event_s *e)
{
- m_pEvent = new PublicationEvent(e);
+ m_pEvent = new PublicationEvent(e);
}
rtPublicationEvent::~rtPublicationEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_publish_event_type_t rtPublicationEvent::getType()
{
- return (rt_tsip_publish_event_type_t)m_pEvent->getType();
+ return (rt_tsip_publish_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Publication);
@@ -200,17 +200,17 @@ rtISipEvent_Implement(rtRegistrationEvent);
rtRegistrationEvent::rtRegistrationEvent(const struct tsip_event_s *e)
{
- m_pEvent = new RegistrationEvent(e);
+ m_pEvent = new RegistrationEvent(e);
}
rtRegistrationEvent::~rtRegistrationEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_register_event_type_t rtRegistrationEvent::getType()
{
- return (rt_tsip_register_event_type_t)m_pEvent->getType();
+ return (rt_tsip_register_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Registration);
@@ -222,17 +222,17 @@ rtISipEvent_Implement(rtSubscriptionEvent);
rtSubscriptionEvent::rtSubscriptionEvent(const struct tsip_event_s *e)
{
- m_pEvent = new SubscriptionEvent(e);
+ m_pEvent = new SubscriptionEvent(e);
}
rtSubscriptionEvent::~rtSubscriptionEvent()
{
- rtSafeDelete(m_pEvent);
+ rtSafeDelete(m_pEvent);
}
rt_tsip_subscribe_event_type_t rtSubscriptionEvent::getType()
{
- return (rt_tsip_subscribe_event_type_t)m_pEvent->getType();
+ return (rt_tsip_subscribe_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Subscription);
diff --git a/bindings/winrt/doubango_rt/src/rt_SipMessage.cxx b/bindings/winrt/doubango_rt/src/rt_SipMessage.cxx
index 55e05d9..1c5ba3e 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipMessage.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipMessage.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -29,52 +29,50 @@ using namespace std;
//
rtSdpMessage::rtSdpMessage()
- :m_pSdpMessage(NULL)
+ :m_pSdpMessage(NULL)
{
}
rtSdpMessage::rtSdpMessage(struct tsdp_message_s *message)
{
- m_pSdpMessage = new SdpMessage(message);
+ m_pSdpMessage = new SdpMessage(message);
}
rtSdpMessage::~rtSdpMessage()
{
- rtSafeDelete(m_pSdpMessage);
+ rtSafeDelete(m_pSdpMessage);
}
String^ rtSdpMessage::getSdpHeaderValue(String^ media, String^ name, unsigned index)
{
- if(m_pSdpMessage)
- {
- char * _str = m_pSdpMessage->getSdpHeaderValue
- (rtString::toUtf8(media).data(),
- rtString::toUtf8(media).data()[0],
- index);
- String^ str = rtString::toString(_str);
- TSK_FREE(str);
- return str;
- }
- return nullptr;
+ if(m_pSdpMessage) {
+ char * _str = m_pSdpMessage->getSdpHeaderValue
+ (rtString::toUtf8(media).data(),
+ rtString::toUtf8(media).data()[0],
+ index);
+ String^ str = rtString::toString(_str);
+ TSK_FREE(str);
+ return str;
+ }
+ return nullptr;
}
String^ rtSdpMessage::getSdpHeaderValue(String^ media, String^ name)
{
- return getSdpHeaderValue(media, name, 0);
+ return getSdpHeaderValue(media, name, 0);
}
String^ rtSdpMessage::getSdpHeaderAValue(String^ media, String^ attributeName)
{
- if(m_pSdpMessage)
- {
- char * _str = m_pSdpMessage->getSdpHeaderAValue
- (rtString::toUtf8(media).data(),
- rtString::toUtf8(attributeName).data());
- String^ str = rtString::toString(_str);
- TSK_FREE(str);
- return str;
- }
- return nullptr;
+ if(m_pSdpMessage) {
+ char * _str = m_pSdpMessage->getSdpHeaderAValue
+ (rtString::toUtf8(media).data(),
+ rtString::toUtf8(attributeName).data());
+ String^ str = rtString::toString(_str);
+ TSK_FREE(str);
+ return str;
+ }
+ return nullptr;
}
//
@@ -82,90 +80,88 @@ String^ rtSdpMessage::getSdpHeaderAValue(String^ media, String^ attributeName)
//
rtSipMessage::rtSipMessage()
- :m_pSipMessage(NULL)
+ :m_pSipMessage(NULL)
{
}
rtSipMessage::rtSipMessage(struct tsip_message_s* message)
{
- m_pSipMessage = new SipMessage(message);
+ m_pSipMessage = new SipMessage(message);
}
rtSipMessage::~rtSipMessage()
{
- rtSafeDelete(m_pSipMessage);
+ rtSafeDelete(m_pSipMessage);
}
bool rtSipMessage::isResponse()
{
- return m_pSipMessage ? m_pSipMessage->isResponse() : false;
+ return m_pSipMessage ? m_pSipMessage->isResponse() : false;
}
rt_tsip_request_type_t rtSipMessage::getRequestType()
{
- return (rt_tsip_request_type_t)(m_pSipMessage ? m_pSipMessage->getRequestType() : 0);
+ return (rt_tsip_request_type_t)(m_pSipMessage ? m_pSipMessage->getRequestType() : 0);
}
short rtSipMessage::getResponseCode()
{
- return m_pSipMessage ? m_pSipMessage->getResponseCode() : 0;
+ return m_pSipMessage ? m_pSipMessage->getResponseCode() : 0;
}
String^ rtSipMessage::getResponsePhrase()
{
- return m_pSipMessage ? rtString::toString(m_pSipMessage->getResponsePhrase()) : nullptr;
+ return m_pSipMessage ? rtString::toString(m_pSipMessage->getResponsePhrase()) : nullptr;
}
String^ rtSipMessage::getSipHeaderValue(String^ name, unsigned index)
{
- return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderValue(rtString::toUtf8(name).data(), index)) : nullptr;
+ return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderValue(rtString::toUtf8(name).data(), index)) : nullptr;
}
String^ rtSipMessage::getSipHeaderValue(String^ name)
{
- return getSipHeaderValue(name, 0);
+ return getSipHeaderValue(name, 0);
}
String^ rtSipMessage::getSipHeaderParamValue(String^ name, String^ param, unsigned index)
{
- return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data(), index)) : nullptr;
+ return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data(), index)) : nullptr;
}
String^ rtSipMessage::getSipHeaderParamValue(String^ name, String^ param)
{
- return getSipHeaderParamValue(name, param, 0);
+ return getSipHeaderParamValue(name, param, 0);
}
unsigned rtSipMessage::getSipContentLength()
{
- return m_pSipMessage ? m_pSipMessage->getSipContentLength() : 0;
+ return m_pSipMessage ? m_pSipMessage->getSipContentLength() : 0;
}
#if COM_VISIBLE
String^ rtSipMessage::getSipContent()
{
- unsigned len = getSipContentLength();
- if(len > 0)
- {
- void* data_ptr = calloc(len, 1);
- if(data_ptr)
- {
- m_pSipMessage->getSipContent(data_ptr, len);
- String^ s = rtString::toString((const char*)data_ptr);
- free(data_ptr);
- return s;
- }
- }
- return nullptr;
+ unsigned len = getSipContentLength();
+ if(len > 0) {
+ void* data_ptr = calloc(len, 1);
+ if(data_ptr) {
+ m_pSipMessage->getSipContent(data_ptr, len);
+ String^ s = rtString::toString((const char*)data_ptr);
+ free(data_ptr);
+ return s;
+ }
+ }
+ return nullptr;
}
#else
unsigned rtSipMessage::getSipContent(IntPtr output, unsigned maxsize)
{
- return m_pSipMessage ? m_pSipMessage->getSipContent((void*)output, maxsize) : 0;
+ return m_pSipMessage ? m_pSipMessage->getSipContent((void*)output, maxsize) : 0;
}
#endif
rtSdpMessage^ rtSipMessage::getSdpMessage()
{
- return m_pSipMessage ? ref new rtSdpMessage(const_cast<struct tsdp_message_s *>(const_cast<SdpMessage*>(m_pSipMessage->getSdpMessage())->getWrappedSdpMessage())) : nullptr;
+ return m_pSipMessage ? ref new rtSdpMessage(const_cast<struct tsdp_message_s *>(const_cast<SdpMessage*>(m_pSipMessage->getSdpMessage())->getWrappedSdpMessage())) : nullptr;
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SipSession.cxx b/bindings/winrt/doubango_rt/src/rt_SipSession.cxx
index 872a2e2..487ba2e 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipSession.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipSession.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -31,24 +31,24 @@ using namespace std;
/* ======================== T140Callback ========================*/
rtT140CallbackData::rtT140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
- m_pData = new T140CallbackData(data_type, data_ptr, data_size);
+ m_pData = new T140CallbackData(data_type, data_ptr, data_size);
}
-
+
rtT140CallbackData::~rtT140CallbackData()
{
- rtSafeDelete(m_pData);
+ rtSafeDelete(m_pData);
}
/* ======================== rtT140Callback ========================*/
rtT140Callback::rtT140Callback()
{
- m_pCallback = new T140Callback();
+ m_pCallback = new T140Callback();
}
rtT140Callback::~rtT140Callback()
{
- rtSafeDelete(m_pCallback);
+ rtSafeDelete(m_pCallback);
}
/* ======================== rtSipSession ========================*/
@@ -56,17 +56,17 @@ rtISession_Implement(rtSipSession);
rtSipSession::rtSipSession(rtSipStack^ pStack)
{
- m_pSipSession = new SipSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new SipSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtSipSession::rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new SipSession(pStack, pHandle);
+ m_pSipSession = new SipSession(pStack, pHandle);
}
rtSipSession::~rtSipSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
@@ -76,19 +76,19 @@ rtIInviteSession_Implement(rtInviteSession);
rtInviteSession::rtInviteSession(rtSipStack^ pStack)
{
- m_pSipSession = new InviteSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new InviteSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtInviteSession::rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new InviteSession(pStack, pHandle);
+ m_pSipSession = new InviteSession(pStack, pHandle);
}
rtInviteSession::~rtInviteSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
-
+
/* ======================== rtCallSession ========================*/
rtISession_Implement(rtCallSession);
@@ -96,177 +96,177 @@ rtIInviteSession_Implement(rtCallSession);
rtCallSession::rtCallSession(rtSipStack^ pStack)
{
- m_pSipSession = new CallSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new CallSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtCallSession::rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new CallSession(pStack, pHandle);
+ m_pSipSession = new CallSession(pStack, pHandle);
}
rtCallSession::~rtCallSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
bool rtCallSession::call(String^ remoteUriString, rt_twrap_media_type_t media, rtActionConfig^ config)
{
- return m_pSipSession->call(rtString::toUtf8(remoteUriString).data(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->call(rtString::toUtf8(remoteUriString).data(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::call(String^ remoteUriString, rt_twrap_media_type_t media)
{
- return call(remoteUriString, media, nullptr);
+ return call(remoteUriString, media, nullptr);
}
bool rtCallSession::call(rtSipUri^ remoteUri, rt_twrap_media_type_t media, rtActionConfig^ config)
{
- return m_pSipSession->call(remoteUri->getWrappedUri(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->call(remoteUri->getWrappedUri(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::call(rtSipUri^ remoteUri, rt_twrap_media_type_t media)
{
- return call(remoteUri, media, nullptr);
+ return call(remoteUri, media, nullptr);
}
bool rtCallSession::setSessionTimer(unsigned timeout, String^ refresher)
{
- return m_pSipSession->setSessionTimer(timeout, rtString::toUtf8(refresher).data());
+ return m_pSipSession->setSessionTimer(timeout, rtString::toUtf8(refresher).data());
}
bool rtCallSession::set100rel(bool enabled)
{
- return m_pSipSession->set100rel(enabled);
+ return m_pSipSession->set100rel(enabled);
}
bool rtCallSession::setRtcp(bool enabled)
{
- return m_pSipSession->setRtcp(enabled);
+ return m_pSipSession->setRtcp(enabled);
}
bool rtCallSession::setRtcpMux(bool enabled)
{
- return m_pSipSession->setRtcpMux(enabled);
+ return m_pSipSession->setRtcpMux(enabled);
}
bool rtCallSession::setICE(bool enabled)
{
- return m_pSipSession->setICE(enabled);
+ return m_pSipSession->setICE(enabled);
}
bool rtCallSession::setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength)
{
- return m_pSipSession->setQoS((tmedia_qos_stype_t) type, (tmedia_qos_strength_t) strength);
+ return m_pSipSession->setQoS((tmedia_qos_stype_t) type, (tmedia_qos_strength_t) strength);
}
bool rtCallSession::setVideoFps(int32_t fps)
{
- return m_pSipSession->setVideoFps(fps);
+ return m_pSipSession->setVideoFps(fps);
}
bool rtCallSession::setVideoBandwidthUploadMax(int32_t max)
{
- return m_pSipSession->setVideoBandwidthUploadMax(max);
+ return m_pSipSession->setVideoBandwidthUploadMax(max);
}
bool rtCallSession::setVideoBandwidthDownloadMax(int32_t max)
{
- return m_pSipSession->setVideoBandwidthDownloadMax(max);
+ return m_pSipSession->setVideoBandwidthDownloadMax(max);
}
bool rtCallSession::setVideoPrefSize(rt_tmedia_pref_video_size_t pref_video_size)
{
- return m_pSipSession->setVideoPrefSize((tmedia_pref_video_size_t)pref_video_size);
+ return m_pSipSession->setVideoPrefSize((tmedia_pref_video_size_t)pref_video_size);
}
bool rtCallSession::hold(rtActionConfig^ config)
{
- return m_pSipSession->hold(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->hold(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::hold()
{
- return hold(nullptr);
+ return hold(nullptr);
}
bool rtCallSession::resume(rtActionConfig^ config)
{
- return m_pSipSession->resume(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->resume(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::resume()
{
- return resume(nullptr);
+ return resume(nullptr);
}
bool rtCallSession::transfer(String^ referToUriString, rtActionConfig^ config)
{
- return m_pSipSession->transfer(rtString::toUtf8(referToUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->transfer(rtString::toUtf8(referToUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::transfer(String^ referToUriString)
{
- return transfer(referToUriString, nullptr);
+ return transfer(referToUriString, nullptr);
}
bool rtCallSession::acceptTransfer(rtActionConfig^ config)
{
- return m_pSipSession->acceptTransfer(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->acceptTransfer(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::acceptTransfer()
{
- return acceptTransfer(nullptr);
+ return acceptTransfer(nullptr);
}
bool rtCallSession::rejectTransfer(rtActionConfig^ config)
{
- return m_pSipSession->rejectTransfer(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->rejectTransfer(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::rejectTransfer()
{
- return rejectTransfer(nullptr);
+ return rejectTransfer(nullptr);
}
bool rtCallSession::sendDTMF(int number)
{
- return m_pSipSession->sendDTMF(number);
+ return m_pSipSession->sendDTMF(number);
}
unsigned rtCallSession::getSessionTransferId()
{
- return m_pSipSession->getSessionTransferId();
+ return m_pSipSession->getSessionTransferId();
}
#if COM_VISIBLE
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type, String^ data)
{
- std::vector<char> _data = rtString::toUtf8(data);
- return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)_data.data(), _data.size());
+ std::vector<char> _data = rtString::toUtf8(data);
+ return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)_data.data(), _data.size());
}
#else
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type, IntPtr data_ptr, unsigned data_size)
{
- return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)data_ptr, data_size);
+ return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)data_ptr, data_size);
}
#endif
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type)
{
- return sendT140Data(data_type, nullptr
+ return sendT140Data(data_type, nullptr
#if !COM_VISIBLE
- , 0
+ , 0
#endif
- );
+ );
}
bool rtCallSession::setT140Callback(rtT140Callback^ pT140Callback)
{
- return m_pSipSession->setT140Callback(const_cast<T140Callback*>(pT140Callback->getWrappedCallback()));
+ return m_pSipSession->setT140Callback(const_cast<T140Callback*>(pT140Callback->getWrappedCallback()));
}
@@ -276,74 +276,73 @@ rtIInviteSession_Implement(rtMsrpSession);
rtMsrpSession::rtMsrpSession(rtSipStack^ pStack, rtIMsrpCallback^ pCallback)
{
- m_pCallback = ref new rtMsrpCallback(pCallback);
- m_pSipSession = new MsrpSession(const_cast<SipStack*>(pStack->getWrappedStack()), const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
+ m_pCallback = ref new rtMsrpCallback(pCallback);
+ m_pSipSession = new MsrpSession(const_cast<SipStack*>(pStack->getWrappedStack()), const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
}
rtMsrpSession::rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new MsrpSession(pStack, pHandle);
+ m_pSipSession = new MsrpSession(pStack, pHandle);
}
rtMsrpSession::~rtMsrpSession()
{
- rtSafeDelete(m_pSipSession);
- rtSafeDelete(m_pCallback);
+ rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pCallback);
}
bool rtMsrpSession::setCallback(rtIMsrpCallback^ pCallback)
{
- rtSafeDelete(m_pCallback);
- if(!pCallback)
- {
- return m_pSipSession->setCallback(tsk_null);
- return true;
- }
- m_pCallback = ref new rtMsrpCallback(pCallback);
- return m_pSipSession->setCallback(const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
+ rtSafeDelete(m_pCallback);
+ if(!pCallback) {
+ return m_pSipSession->setCallback(tsk_null);
+ return true;
+ }
+ m_pCallback = ref new rtMsrpCallback(pCallback);
+ return m_pSipSession->setCallback(const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
}
bool rtMsrpSession::callMsrp(Platform::String^ remoteUriString, rtActionConfig^ config)
{
- return m_pSipSession->callMsrp(rtString::toUtf8(remoteUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->callMsrp(rtString::toUtf8(remoteUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::callMsrp(Platform::String^ remoteUriString)
{
- return callMsrp(remoteUriString, nullptr);
+ return callMsrp(remoteUriString, nullptr);
}
bool rtMsrpSession::callMsrp(rtSipUri^ remoteUri, rtActionConfig^ config)
{
- return m_pSipSession->callMsrp(remoteUri->getWrappedUri(), config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->callMsrp(remoteUri->getWrappedUri(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::callMsrp(rtSipUri^ remoteUri)
{
- return callMsrp(remoteUri, nullptr);
+ return callMsrp(remoteUri, nullptr);
}
#if COM_VISIBLE
bool rtMsrpSession::sendMessage(String^ payload, rtActionConfig^ config)
{
- std::vector<char> _payload = rtString::toUtf8(payload);
- return m_pSipSession->sendMessage((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
+ std::vector<char> _payload = rtString::toUtf8(payload);
+ return m_pSipSession->sendMessage((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::sendMessage(Platform::String^ payload)
{
- return sendMessage(payload, nullptr);
+ return sendMessage(payload, nullptr);
}
#else
bool rtMsrpSession::sendMessage(Platform::IntPtr payload, unsigned len, rtActionConfig^ config)
{
- return m_pSipSession->sendMessage((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->sendMessage((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::sendMessage(Platform::IntPtr payload, unsigned len)
{
- return sendMessage(payload, len, nullptr);
+ return sendMessage(payload, len, nullptr);
}
#endif /* COM_VISIBLE */
@@ -353,61 +352,61 @@ rtISession_Implement(rtMessagingSession);
rtMessagingSession::rtMessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new MessagingSession(pStack, pHandle);
+ m_pSipSession = new MessagingSession(pStack, pHandle);
}
-
+
rtMessagingSession::rtMessagingSession(rtSipStack^ pStack)
{
- m_pSipSession = new MessagingSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new MessagingSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtMessagingSession::~rtMessagingSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtMessagingSession::send(String^ payload, rtActionConfig^ config)
{
- std::vector<char>_payload = rtString::toUtf8(payload);
- return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
+ std::vector<char>_payload = rtString::toUtf8(payload);
+ return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::send(Platform::String^ payload)
{
- return send(payload, nullptr);
+ return send(payload, nullptr);
}
#else
bool rtMessagingSession::send(IntPtr payload, unsigned len, rtActionConfig^ config)
{
- return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::send(IntPtr payload, unsigned len)
{
- return send(payload, len, nullptr);
+ return send(payload, len, nullptr);
}
#endif
bool rtMessagingSession::accept(rtActionConfig^ config)
{
- return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::accept()
{
- return accept(nullptr);
+ return accept(nullptr);
}
bool rtMessagingSession::reject(rtActionConfig^ config)
{
- return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::reject()
{
- return reject(nullptr);
+ return reject(nullptr);
}
/* ======================== rtInfoSession ========================*/
@@ -415,60 +414,60 @@ rtISession_Implement(rtInfoSession);
rtInfoSession::rtInfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new InfoSession(pStack, pHandle);
+ m_pSipSession = new InfoSession(pStack, pHandle);
}
rtInfoSession::rtInfoSession(rtSipStack^ pStack)
{
- m_pSipSession = new InfoSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new InfoSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtInfoSession::~rtInfoSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtInfoSession::send(Platform::String^ payload, rtActionConfig^ config)
{
- std::vector<char>_payload = rtString::toUtf8(payload);
- return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
+ std::vector<char>_payload = rtString::toUtf8(payload);
+ return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::send(Platform::String^ payload)
{
- return send(payload, nullptr);
+ return send(payload, nullptr);
}
#else
bool rtInfoSession::send(IntPtr payload, unsigned len, rtActionConfig^ config)
{
- return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::send(IntPtr payload, unsigned len)
{
- return send(payload, len, nullptr);
+ return send(payload, len, nullptr);
}
#endif
bool rtInfoSession::accept(rtActionConfig^ config)
{
- return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::accept()
{
- return accept(nullptr);
+ return accept(nullptr);
}
bool rtInfoSession::reject(rtActionConfig^ config)
{
- return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::reject()
{
- return reject(nullptr);
+ return reject(nullptr);
}
@@ -478,47 +477,47 @@ rtISession_Implement(rtOptionsSession);
rtOptionsSession::rtOptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new OptionsSession(pStack, pHandle);
+ m_pSipSession = new OptionsSession(pStack, pHandle);
}
rtOptionsSession::rtOptionsSession(rtSipStack^ pStack)
{
- m_pSipSession = new OptionsSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new OptionsSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtOptionsSession::~rtOptionsSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
bool rtOptionsSession::send(rtActionConfig^ config)
{
- return m_pSipSession->send(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->send(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::send()
{
- return send(nullptr);
+ return send(nullptr);
}
bool rtOptionsSession::accept(rtActionConfig^ config)
{
- return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::accept()
{
- return accept(nullptr);
+ return accept(nullptr);
}
bool rtOptionsSession::reject(rtActionConfig^ config)
{
- return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::reject()
{
- return reject(nullptr);
+ return reject(nullptr);
}
@@ -528,49 +527,49 @@ rtISession_Implement(rtPublicationSession);
rtPublicationSession::rtPublicationSession(rtSipStack^ pStack)
{
- m_pSipSession = new PublicationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new PublicationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtPublicationSession::rtPublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new PublicationSession(pStack, pHandle);
+ m_pSipSession = new PublicationSession(pStack, pHandle);
}
rtPublicationSession::~rtPublicationSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtPublicationSession::publish(String^ payload, rtActionConfig^ config)
{
- std::vector<char>_payload = rtString::toUtf8(payload);
- return m_pSipSession->publish((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
+ std::vector<char>_payload = rtString::toUtf8(payload);
+ return m_pSipSession->publish((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::publish(Platform::String^ payload)
{
- return publish(payload, nullptr);
+ return publish(payload, nullptr);
}
#else
bool rtPublicationSession::publish(Platform::IntPtr payload, unsigned len, rtActionConfig^ config)
{
- return m_pSipSession->publish((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->publish((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::publish(Platform::IntPtr payload, unsigned len)
{
- return publish(payload, len, nullptr);
+ return publish(payload, len, nullptr);
}
#endif
bool rtPublicationSession::unPublish(rtActionConfig^ config)
{
- return m_pSipSession->unPublish(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->unPublish(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::unPublish()
{
- return unPublish(nullptr);
+ return unPublish(nullptr);
}
@@ -579,57 +578,57 @@ rtISession_Implement(rtRegistrationSession);
rtRegistrationSession::rtRegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new RegistrationSession(pStack, pHandle);
+ m_pSipSession = new RegistrationSession(pStack, pHandle);
}
rtRegistrationSession::rtRegistrationSession(rtSipStack^ pStack)
{
- m_pSipSession = new RegistrationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new RegistrationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtRegistrationSession::~rtRegistrationSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
bool rtRegistrationSession::register_(rtActionConfig^ config)
{
- return m_pSipSession->register_(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->register_(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::register_()
{
- return register_(nullptr);
+ return register_(nullptr);
}
bool rtRegistrationSession::unRegister(rtActionConfig^ config)
{
- return m_pSipSession->unRegister(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->unRegister(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::unRegister()
{
- return unRegister(nullptr);
+ return unRegister(nullptr);
}
bool rtRegistrationSession::accept(rtActionConfig^ config)
{
- return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::accept()
{
- return accept(nullptr);
+ return accept(nullptr);
}
bool rtRegistrationSession::reject(rtActionConfig^ config)
{
- return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
+ return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::reject()
{
- return reject(nullptr);
+ return reject(nullptr);
}
@@ -638,25 +637,25 @@ rtISession_Implement(rtSubscriptionSession);
rtSubscriptionSession::rtSubscriptionSession(rtSipStack^ pStack)
{
- m_pSipSession = new SubscriptionSession(const_cast<SipStack*>(pStack->getWrappedStack()));
+ m_pSipSession = new SubscriptionSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtSubscriptionSession::rtSubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
- m_pSipSession = new SubscriptionSession(pStack, pHandle);
+ m_pSipSession = new SubscriptionSession(pStack, pHandle);
}
rtSubscriptionSession::~rtSubscriptionSession()
{
- rtSafeDelete(m_pSipSession);
+ rtSafeDelete(m_pSipSession);
}
-
+
bool rtSubscriptionSession::subscribe()
{
- return m_pSipSession->subscribe();
+ return m_pSipSession->subscribe();
}
bool rtSubscriptionSession::unSubscribe()
{
- return m_pSipSession->unSubscribe();
+ return m_pSipSession->unSubscribe();
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_SipStack.cxx b/bindings/winrt/doubango_rt/src/rt_SipStack.cxx
index 753a881..4aa04c6 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipStack.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipStack.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -30,360 +30,359 @@ using namespace std;
rtSipStack::rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri)
{
- m_pSipCallback = ref new rtSipCallback(callback);
- m_pSipStack = new SipStack(
- const_cast<SipCallback*>(m_pSipCallback->getWrappedCallback()),
- rtString::toUtf8(realmUri).data(),
- rtString::toUtf8(impiString).data(),
- rtString::toUtf8(impuUri).data()
- );
+ m_pSipCallback = ref new rtSipCallback(callback);
+ m_pSipStack = new SipStack(
+ const_cast<SipCallback*>(m_pSipCallback->getWrappedCallback()),
+ rtString::toUtf8(realmUri).data(),
+ rtString::toUtf8(impiString).data(),
+ rtString::toUtf8(impuUri).data()
+ );
}
rtSipStack::~rtSipStack()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- rtSafeDelete(m_pSipStack);
- rtSafeDelete(m_pSipCallback);
- rtSafeDelete(m_pDebugCallback);
+ rtSafeDelete(m_pSipStack);
+ rtSafeDelete(m_pSipCallback);
+ rtSafeDelete(m_pDebugCallback);
}
bool rtSipStack::start()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->start();
+ return m_pSipStack->start();
}
bool rtSipStack::setDebugCallback(rtIDDebugCallback^ pCallback)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- m_pSipStack->setDebugCallback(tsk_null);
- rtSafeDelete(m_pDebugCallback);
- if(!pCallback)
- {
- return true;
- }
+ m_pSipStack->setDebugCallback(tsk_null);
+ rtSafeDelete(m_pDebugCallback);
+ if(!pCallback) {
+ return true;
+ }
- m_pDebugCallback = ref new rtDDebugCallback(pCallback);
- return m_pSipStack->setDebugCallback(const_cast<DDebugCallback*>(m_pDebugCallback->getWrappedCallback()));
+ m_pDebugCallback = ref new rtDDebugCallback(pCallback);
+ return m_pSipStack->setDebugCallback(const_cast<DDebugCallback*>(m_pDebugCallback->getWrappedCallback()));
}
bool rtSipStack::setDisplayName(Platform::String^ display_name)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setDisplayName(rtString::toUtf8(display_name).data());
+ return m_pSipStack->setDisplayName(rtString::toUtf8(display_name).data());
}
bool rtSipStack::setRealm(Platform::String^ realm_uri)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setRealm(rtString::toUtf8(realm_uri).data());
+ return m_pSipStack->setRealm(rtString::toUtf8(realm_uri).data());
}
bool rtSipStack::setIMPI(Platform::String^ impi)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setIMPI(rtString::toUtf8(impi).data());
+ return m_pSipStack->setIMPI(rtString::toUtf8(impi).data());
}
bool rtSipStack::setIMPU(Platform::String^ impu_uri)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setIMPU(rtString::toUtf8(impu_uri).data());
+ return m_pSipStack->setIMPU(rtString::toUtf8(impu_uri).data());
}
bool rtSipStack::setPassword(Platform::String^ password)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setPassword(rtString::toUtf8(password).data());
+ return m_pSipStack->setPassword(rtString::toUtf8(password).data());
}
bool rtSipStack::setAMF(Platform::String^ amf)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setAMF(rtString::toUtf8(amf).data());
+ return m_pSipStack->setAMF(rtString::toUtf8(amf).data());
}
bool rtSipStack::setOperatorId(Platform::String^ opid)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setOperatorId(rtString::toUtf8(opid).data());
+ return m_pSipStack->setOperatorId(rtString::toUtf8(opid).data());
}
bool rtSipStack::setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setProxyCSCF(
- rtString::toUtf8(fqdn).data(),
- port,
- rtString::toUtf8(transport).data(),
- rtString::toUtf8(ipversion).data()
- );
+ return m_pSipStack->setProxyCSCF(
+ rtString::toUtf8(fqdn).data(),
+ port,
+ rtString::toUtf8(transport).data(),
+ rtString::toUtf8(ipversion).data()
+ );
}
bool rtSipStack::setLocalIP(Platform::String^ ip, Platform::String^ transport)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data(), rtString::toUtf8(transport).data());
+ return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data(), rtString::toUtf8(transport).data());
}
bool rtSipStack::setLocalIP(Platform::String^ ip)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data());
+ return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data());
}
bool rtSipStack::setLocalPort(unsigned short port, Platform::String^ transport)
{
- return m_pSipStack->setLocalPort(port, rtString::toUtf8(transport).data());
+ return m_pSipStack->setLocalPort(port, rtString::toUtf8(transport).data());
}
bool rtSipStack::setLocalPort(unsigned short port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setLocalPort(port);
+ return m_pSipStack->setLocalPort(port);
}
bool rtSipStack::setEarlyIMS(bool enabled)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setEarlyIMS(enabled);
+ return m_pSipStack->setEarlyIMS(enabled);
}
bool rtSipStack::addHeader(Platform::String^ name, Platform::String^ value)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
+ return m_pSipStack->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
}
bool rtSipStack::removeHeader(Platform::String^ name)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->removeHeader(rtString::toUtf8(name).data());
+ return m_pSipStack->removeHeader(rtString::toUtf8(name).data());
}
bool rtSipStack::addDnsServer(Platform::String^ ip)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->removeHeader(rtString::toUtf8(ip).data());
+ return m_pSipStack->removeHeader(rtString::toUtf8(ip).data());
}
bool rtSipStack::setDnsDiscovery(bool enabled)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setDnsDiscovery(enabled);
+ return m_pSipStack->setDnsDiscovery(enabled);
}
bool rtSipStack::setAoR(Platform::String^ ip, int port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setAoR(rtString::toUtf8(ip).data(), port);
+ return m_pSipStack->setAoR(rtString::toUtf8(ip).data(), port);
}
bool rtSipStack::setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setSigCompParams(dms, sms, cpb, enablePresDict);
+ return m_pSipStack->setSigCompParams(dms, sms, cpb, enablePresDict);
}
bool rtSipStack::addSigCompCompartment(Platform::String^ compId)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->addSigCompCompartment(rtString::toUtf8(compId).data());
+ return m_pSipStack->addSigCompCompartment(rtString::toUtf8(compId).data());
}
bool rtSipStack::removeSigCompCompartment(Platform::String^ compId)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->removeSigCompCompartment(rtString::toUtf8(compId).data());
+ return m_pSipStack->removeSigCompCompartment(rtString::toUtf8(compId).data());
}
-
+
bool rtSipStack::setSTUNServer(Platform::String^ ip, unsigned short port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setSTUNServer(rtString::toUtf8(ip).data(), port);
+ return m_pSipStack->setSTUNServer(rtString::toUtf8(ip).data(), port);
}
bool rtSipStack::setSTUNCred(Platform::String^ login, Platform::String^ password)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setSTUNCred(rtString::toUtf8(login).data(), rtString::toUtf8(password).data());
+ return m_pSipStack->setSTUNCred(rtString::toUtf8(login).data(), rtString::toUtf8(password).data());
}
bool rtSipStack::setTLSSecAgree(bool enabled)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setTLSSecAgree(enabled);
+ return m_pSipStack->setTLSSecAgree(enabled);
}
bool rtSipStack::setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setSSLCertificates(rtString::toUtf8(privKey).data(), rtString::toUtf8(pubKey).data(), rtString::toUtf8(caKey).data(), verify);
+ return m_pSipStack->setSSLCertificates(rtString::toUtf8(privKey).data(), rtString::toUtf8(pubKey).data(), rtString::toUtf8(caKey).data(), verify);
}
bool rtSipStack::setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return setSSLCertificates(privKey, pubKey, caKey, false);
+ return setSSLCertificates(privKey, pubKey, caKey, false);
}
bool rtSipStack::setIPSecSecAgree(bool enabled)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setIPSecSecAgree(enabled);
+ return m_pSipStack->setIPSecSecAgree(enabled);
}
bool rtSipStack::setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->setIPSecParameters(rtString::toUtf8(algo).data(), rtString::toUtf8(ealgo).data(), rtString::toUtf8(mode).data(), rtString::toUtf8(proto).data());
+ return m_pSipStack->setIPSecParameters(rtString::toUtf8(algo).data(), rtString::toUtf8(ealgo).data(), rtString::toUtf8(mode).data(), rtString::toUtf8(proto).data());
}
-
+
Platform::String^ rtSipStack::dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return rtString::toString(m_pSipStack->dnsENUM(rtString::toUtf8(service).data(), rtString::toUtf8(e164num).data(), rtString::toUtf8(domain).data()));
+ return rtString::toString(m_pSipStack->dnsENUM(rtString::toUtf8(service).data(), rtString::toUtf8(e164num).data(), rtString::toUtf8(domain).data()));
}
#if COM_VISIBLE
rtDnsResult^ rtSipStack::dnsNaptrSrv(String^ domain, String^ service)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- unsigned short _port = 0;
- String^ address = rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), &_port));
- return ref new rtDnsResult(_port, address);
+ unsigned short _port = 0;
+ String^ address = rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), &_port));
+ return ref new rtDnsResult(_port, address);
}
rtDnsResult^ rtSipStack::dnsSrv(String^ service)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- unsigned short _port = 0;
- String^ address = rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), &_port));
- return ref new rtDnsResult(_port, address);
+ unsigned short _port = 0;
+ String^ address = rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), &_port));
+ return ref new rtDnsResult(_port, address);
}
String^ rtSipStack::getLocalIP(String^ protocol)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), tsk_null);
- String^ ip = rtString::toString(_ip);
- TSK_FREE(_ip);
- return ip;
+ char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), tsk_null);
+ String^ ip = rtString::toString(_ip);
+ TSK_FREE(_ip);
+ return ip;
}
uint16 rtSipStack::getLocalPort(String^ protocol)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- uint16 port = 0;
- char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), &port);
- TSK_FREE(_ip);
- return port;
+ uint16 port = 0;
+ char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), &port);
+ TSK_FREE(_ip);
+ return port;
}
#else
String^ rtSipStack::dnsNaptrSrv(String^ domain, String^ service, IntPtr port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
+ return rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
}
String^ rtSipStack::dnsSrv(String^ service, IntPtr port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
+ return rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
}
Platform::String^ rtSipStack::getLocalIPnPort(String^ protocol, IntPtr port)
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), ((unsigned short*)(void*)port));
- String^ ip = rtString::toString();
- TSK_FREE(_ip);
- return ip;
+ char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), ((unsigned short*)(void*)port));
+ String^ ip = rtString::toString();
+ TSK_FREE(_ip);
+ return ip;
}
#endif /* COM_VISIBLE */
Platform::String^ rtSipStack::getPreferredIdentity()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return rtString::toString(m_pSipStack->getPreferredIdentity());
+ return rtString::toString(m_pSipStack->getPreferredIdentity());
}
bool rtSipStack::isValid()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->isValid();
+ return m_pSipStack->isValid();
}
bool rtSipStack::stop()
{
- std::lock_guard<std::recursive_mutex> lock(mLock);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
- return m_pSipStack->stop();
+ return m_pSipStack->stop();
}
-
+
bool rtSipStack::initialize()
{
- return SipStack::initialize();
+ return SipStack::initialize();
}
bool rtSipStack::deInitialize()
{
- return SipStack::deInitialize();
+ return SipStack::deInitialize();
}
void rtSipStack::setCodecs(enum class rt_tdav_codec_id_t codecs)
{
- return SipStack::setCodecs((tdav_codec_id_t) codecs);
+ return SipStack::setCodecs((tdav_codec_id_t) codecs);
}
bool rtSipStack::setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority)
{
- return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
+ return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
}
bool rtSipStack::isCodecSupported(enum class rt_tdav_codec_id_t codec_id)
{
- return SipStack::isCodecSupported((tdav_codec_id_t) codec_id);
+ return SipStack::isCodecSupported((tdav_codec_id_t) codec_id);
}
diff --git a/bindings/winrt/doubango_rt/src/rt_SipUri.cxx b/bindings/winrt/doubango_rt/src/rt_SipUri.cxx
index 1398325..94565d4 100755
--- a/bindings/winrt/doubango_rt/src/rt_SipUri.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_SipUri.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -27,24 +27,24 @@ using namespace std;
rtSipUri::rtSipUri(Platform::String^ uriString, Platform::String^ displayName)
{
- m_pSipUri = new SipUri(
- rtString::toUtf8(uriString).data(),
- rtString::toUtf8(displayName).data());
+ m_pSipUri = new SipUri(
+ rtString::toUtf8(uriString).data(),
+ rtString::toUtf8(displayName).data());
}
rtSipUri::rtSipUri(Platform::String^ uriString)
{
- m_pSipUri = new SipUri(rtString::toUtf8(uriString).data());
+ m_pSipUri = new SipUri(rtString::toUtf8(uriString).data());
}
rtSipUri::~rtSipUri()
{
- rtSafeDelete(m_pSipUri);
+ rtSafeDelete(m_pSipUri);
}
bool rtSipUri::isValid(Platform::String^ uri)
{
- return SipUri::isValid(rtString::toUtf8(uri).data());
+ return SipUri::isValid(rtString::toUtf8(uri).data());
}
// MIDL4069: Static members and instance members cannot have the same name on a runtime class. isValid
@@ -55,49 +55,48 @@ bool rtSipUri::isValid_()
bool rtSipUri::isValid()
#endif
{
- return (m_pSipUri && m_pSipUri->isValid());
+ return (m_pSipUri && m_pSipUri->isValid());
}
Platform::String^ rtSipUri::getScheme()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getScheme()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getScheme()) : nullptr;
}
Platform::String^ rtSipUri::getHost()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getHost()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getHost()) : nullptr;
}
unsigned short rtSipUri::getPort()
{
- return m_pSipUri ? m_pSipUri->getPort() : 0;
+ return m_pSipUri ? m_pSipUri->getPort() : 0;
}
Platform::String^ rtSipUri::getUserName()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getUserName()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getUserName()) : nullptr;
}
Platform::String^ rtSipUri::getPassword()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getPassword()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getPassword()) : nullptr;
}
Platform::String^ rtSipUri::getDisplayName()
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getDisplayName()) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getDisplayName()) : nullptr;
}
Platform::String^ rtSipUri::getParamValue(Platform::String^ name)
{
- return m_pSipUri ? rtString::toString(m_pSipUri->getParamValue(rtString::toUtf8(name).data())) : nullptr;
+ return m_pSipUri ? rtString::toString(m_pSipUri->getParamValue(rtString::toUtf8(name).data())) : nullptr;
}
void rtSipUri::setDisplayName(Platform::String^ displayName)
{
- if(m_pSipUri)
- {
- m_pSipUri->setDisplayName(rtString::toUtf8(displayName).data());
- }
+ if(m_pSipUri) {
+ m_pSipUri->setDisplayName(rtString::toUtf8(displayName).data());
+ }
}
diff --git a/bindings/winrt/doubango_rt/src/rt_String.cxx b/bindings/winrt/doubango_rt/src/rt_String.cxx
index 7d17f03..9ac6803 100755
--- a/bindings/winrt/doubango_rt/src/rt_String.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_String.cxx
@@ -1,17 +1,17 @@
/*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.
*/
@@ -25,34 +25,28 @@ using namespace std;
vector<char> rtString::toUtf8(String^ str)
{
- if(str != nullptr && !str->IsEmpty())
- {
- int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), nullptr, 0, nullptr, nullptr);
- if (len > 0)
- {
- vector<char> vec(len + 1);
- if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len)
- {
- return std::move(vec);
- }
- }
- }
+ if(str != nullptr && !str->IsEmpty()) {
+ int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), nullptr, 0, nullptr, nullptr);
+ if (len > 0) {
+ vector<char> vec(len + 1);
+ if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len) {
+ return std::move(vec);
+ }
+ }
+ }
return std::move(vector<char>(0));
}
String^ rtString::toString(char const* str)
{
- if(str)
- {
- int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0);
- if (len > 0)
- {
- vector<wchar_t> vec(len);
- if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len)
- {
- return ref new String(vec.data());
- }
- }
- }
- return nullptr;
+ if(str) {
+ int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0);
+ if (len > 0) {
+ vector<wchar_t> vec(len);
+ if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len) {
+ return ref new String(vec.data());
+ }
+ }
+ }
+ return nullptr;
} \ No newline at end of file
diff --git a/bindings/winrt/doubango_rt/src/rt_Xcap.cxx b/bindings/winrt/doubango_rt/src/rt_Xcap.cxx
index 623cb1f..b510d81 100755
--- a/bindings/winrt/doubango_rt/src/rt_Xcap.cxx
+++ b/bindings/winrt/doubango_rt/src/rt_Xcap.cxx
@@ -1,17 +1,17 @@
/*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.
*/ \ No newline at end of file
OpenPOWER on IntegriCloud