2011-03-25 09:38:07 +00:00
|
|
|
/*
|
2011-03-29 12:51:58 +00:00
|
|
|
* Copyright (C) 2010-2011 Mamadou Diop.
|
2011-03-25 09:38:07 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#ifndef TINYWRAP_MEDIA_SESSIONMGR_H
|
|
|
|
#define TINYWRAP_MEDIA_SESSIONMGR_H
|
|
|
|
|
|
|
|
#include "tinymedia.h"
|
|
|
|
#include "Common.h"
|
|
|
|
|
|
|
|
class ProxyPlugin;
|
|
|
|
|
2012-09-03 06:41:33 +00:00
|
|
|
class Codec
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
#if !defined(SWIG)
|
|
|
|
Codec(struct tmedia_codec_s* pWrappedCodec);
|
|
|
|
#endif
|
|
|
|
virtual ~Codec();
|
|
|
|
|
|
|
|
public:
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2011-03-25 09:38:07 +00:00
|
|
|
class MediaSessionMgr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
#if !defined(SWIG)
|
2011-08-25 01:07:28 +00:00
|
|
|
MediaSessionMgr(tmedia_session_mgr_t* pWrappedMgr);
|
2011-03-25 09:38:07 +00:00
|
|
|
#endif
|
|
|
|
virtual ~MediaSessionMgr();
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool sessionSetInt32(twrap_media_type_t media, const char* key, int32_t value);
|
2012-03-14 16:11:33 +00:00
|
|
|
int32_t sessionGetInt32(twrap_media_type_t media, const char* key);
|
2011-03-25 09:38:07 +00:00
|
|
|
|
|
|
|
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);
|
2012-09-03 06:41:33 +00:00
|
|
|
Codec* producerGetCodec(twrap_media_type_t media);
|
2011-03-25 09:38:07 +00:00
|
|
|
|
|
|
|
#if !defined(SWIG)
|
2011-05-12 22:14:22 +00:00
|
|
|
const ProxyPlugin* findProxyPlugin(twrap_media_type_t media, bool consumer)const;
|
2011-03-25 09:38:07 +00:00
|
|
|
#endif
|
|
|
|
|
2011-05-12 22:14:22 +00:00
|
|
|
const ProxyPlugin* findProxyPluginConsumer(twrap_media_type_t media)const{
|
2011-03-25 09:38:07 +00:00
|
|
|
return this->findProxyPlugin(media, true);
|
|
|
|
}
|
2011-05-12 22:14:22 +00:00
|
|
|
const ProxyPlugin* findProxyPluginProducer(twrap_media_type_t media)const{
|
2011-03-25 09:38:07 +00:00
|
|
|
return this->findProxyPlugin(media, false);
|
|
|
|
}
|
2011-08-25 01:07:28 +00:00
|
|
|
|
2012-09-03 06:41:33 +00:00
|
|
|
static unsigned int registerAudioPluginFromFile(const char* path);
|
|
|
|
|
2011-08-25 01:07:28 +00:00
|
|
|
uint64_t getSessionId(twrap_media_type_t media)const;
|
2012-11-02 16:24:29 +00:00
|
|
|
|
|
|
|
#if !defined(SWIG)
|
|
|
|
inline const tmedia_session_mgr_t* getWrappedMgr()const { return m_pWrappedMgr; }
|
|
|
|
#endif
|
2011-06-03 21:28:04 +00:00
|
|
|
|
|
|
|
// Defaults
|
2012-05-02 10:42:55 +00:00
|
|
|
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 defaultsSetPrefVideoSize(tmedia_pref_video_size_t pref_video_size);
|
2011-10-26 00:32:57 +00:00
|
|
|
static bool defaultsSetJbMargin(uint32_t jb_margin_ms);
|
|
|
|
static bool defaultsSetJbMaxLateRate(uint32_t jb_late_rate_percent);
|
2011-06-03 21:28:04 +00:00
|
|
|
static bool defaultsSetEchoTail(uint32_t echo_tail);
|
|
|
|
static uint32_t defaultsGetEchoTail();
|
2011-08-01 05:14:45 +00:00
|
|
|
static bool defaultsSetEchoSkew(uint32_t echo_skew);
|
2011-06-03 21:28:04 +00:00
|
|
|
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();
|
2011-06-23 17:13:16 +00:00
|
|
|
static bool defaultsSet100relEnabled(bool _100rel_enabled);
|
|
|
|
static bool defaultsGet100relEnabled();
|
2011-07-27 05:19:27 +00:00
|
|
|
static bool defaultsSetScreenSize(int32_t sx, int32_t sy);
|
2011-08-05 12:48:22 +00:00
|
|
|
static bool defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain);
|
2011-10-13 22:38:16 +00:00
|
|
|
static bool defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop);
|
2011-10-21 12:11:06 +00:00
|
|
|
static bool defaultsSetMediaType(twrap_media_type_t media_type);
|
2011-12-06 23:03:49 +00:00
|
|
|
static bool defaultsSetVolume(int32_t volume);
|
|
|
|
static int32_t defaultsGetVolume();
|
2012-02-07 05:31:32 +00:00
|
|
|
static bool defaultsSetInviteSessionTimers(int32_t timeout, const char* refresher);
|
2012-03-14 16:11:33 +00:00
|
|
|
static bool defaultsSetSRtpMode(tmedia_srtp_mode_t mode);
|
2012-06-29 02:30:49 +00:00
|
|
|
static bool defaultsSetRtcpEnabled(bool enabled);
|
|
|
|
static bool defaultsGetRtcpEnabled();
|
|
|
|
static bool defaultsSetRtcpMuxEnabled(bool enabled);
|
|
|
|
static bool defaultsGetRtcpMuxEnabled();
|
2012-05-02 10:42:55 +00:00
|
|
|
static bool defaultsSetIceEnabled(bool ice_enabled);
|
2011-03-25 09:38:07 +00:00
|
|
|
|
|
|
|
private:
|
2011-08-25 01:07:28 +00:00
|
|
|
tmedia_session_mgr_t* m_pWrappedMgr;
|
2011-03-25 09:38:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* TINYWRAP_MEDIA_SESSIONMGR_H */
|