- GNU make files:

* complete rewrite to add auto detection for thirdparties libraries
 * all features are enabled by default unless --without-xxx is used
 * adds support for pkg-config to ease integration on other projects (tp, webrtc2sip...)
****** FIRT REVISION KNOW TO FULLY WORK WITH TP ******
- Detect support for h264, h263, theora and mp4v-es at runtime instead of using macros at compile-time
- Allows configuring audio ptime and video fps
- Adds support for congestion control
- Complete support for RTCP-REMB (http://tools.ietf.org/html/draft-alvestrand-rmcat-remb-00)
- Change way the bitrate is computed (use width, height, motion-rank and fps)
-
This commit is contained in:
bossiel 2013-06-10 05:47:01 +00:00
parent 64cda3d26f
commit 1da4baac3e
101 changed files with 1903 additions and 270 deletions

View File

@ -13,4 +13,7 @@ SUBDIRS = tinySAK \
tinyMEDIA \
tinyRTP \
tinyDAV \
tinySIP
tinySIP
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = doubango.pc

View File

@ -293,6 +293,10 @@ tmedia_bandwidth_level_t MediaSessionMgr::defaultsGetBandwidthLevel() // @deprec
{
return tmedia_defaults_get_bl();
}
bool MediaSessionMgr::defaultsSetCongestionCtrlEnabled(bool enabled)
{
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);
@ -412,6 +416,13 @@ bool MediaSessionMgr::defaultsSetAudioGain(int32_t producer_gain, int32_t consum
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::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;
}

View File

@ -97,6 +97,7 @@ public:
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 defaultsSetBandwidthVideoUploadMax(int32_t bw_video_up_max_kbps);
static bool defaultsSetBandwidthVideoDownloadMax(int32_t bw_video_down_max_kbps);
@ -122,6 +123,8 @@ public:
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);

View File

@ -74,8 +74,8 @@ int twrap_consumer_proxy_audio_prepare(tmedia_consumer_t* self, const tmedia_cod
ret = audio->pcConsumer->getCallback()->prepare((int)self->audio.ptime, self->audio.in.rate, self->audio.in.channels);
if(ret == 0){
// say consumer can output these params
self->audio.out.rate = self->audio.in.rate;
self->audio.out.channels = self->audio.in.channels;
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;
}
}
}
@ -252,6 +252,22 @@ ProxyAudioConsumer::~ProxyAudioConsumer()
}
}
// 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;
}
}
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);

View File

@ -64,7 +64,7 @@ public:
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);

View File

@ -209,14 +209,17 @@ ProxyAudioProducer::~ProxyAudioProducer()
// 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)
{
TSK_DEBUG_INFO("setActualSndCardRecordParams(ptime=%d, rate=%d, channels=%d)", nPtime, nRate, 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;
}
return false;
else{
TSK_DEBUG_ERROR("Invalid state");
return false;
}
}
bool ProxyAudioProducer::setPushBuffer(const void* pPushBufferPtr, unsigned nPushBufferSize, bool bUsePushCallback/*=false*/)

View File

@ -345,6 +345,7 @@ typedef enum tmedia_pref_video_size_s
tmedia_pref_video_size_720p, // 1280 x 720
tmedia_pref_video_size_16cif, // 1408 x 1152
tmedia_pref_video_size_1080p, // 1920 x 1080
tmedia_pref_video_size_2160p, // 3840 x 2160
}
tmedia_pref_video_size_t;

View File

@ -119,6 +119,11 @@ public class MediaSessionMgr : IDisposable {
return ret;
}
public static bool defaultsSetCongestionCtrlEnabled(bool enabled) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetCongestionCtrlEnabled(enabled);
return ret;
}
public static bool defaultsSetVideoMotionRank(int video_motion_rank) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetVideoMotionRank(video_motion_rank);
return ret;
@ -244,6 +249,16 @@ public class MediaSessionMgr : IDisposable {
return ret;
}
public static bool defaultsSetAudioPtime(int ptime) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetAudioPtime(ptime);
return ret;
}
public static bool defaultsSetAudioChannels(int channel_playback, int channel_record) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetAudioChannels(channel_playback, channel_record);
return ret;
}
public static bool defaultsSetRtpPortRange(ushort range_start, ushort range_stop) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetRtpPortRange(range_start, range_stop);
return ret;

View File

@ -40,6 +40,11 @@ public class ProxyAudioConsumer : ProxyPlugin {
}
}
public bool setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels) {
bool ret = tinyWRAPPINVOKE.ProxyAudioConsumer_setActualSndCardPlaybackParams(swigCPtr, nPtime, nRate, nChannels);
return ret;
}
public bool queryForResampler(ushort nInFreq, ushort nOutFreq, ushort nFrameDuration, ushort nChannels, ushort nResamplerQuality) {
bool ret = tinyWRAPPINVOKE.ProxyAudioConsumer_queryForResampler(swigCPtr, nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
return ret;

View File

@ -336,6 +336,9 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsGetBandwidthLevel")]
public static extern int MediaSessionMgr_defaultsGetBandwidthLevel();
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetCongestionCtrlEnabled")]
public static extern bool MediaSessionMgr_defaultsSetCongestionCtrlEnabled(bool jarg1);
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetVideoMotionRank")]
public static extern bool MediaSessionMgr_defaultsSetVideoMotionRank(int jarg1);
@ -411,6 +414,12 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetAudioGain")]
public static extern bool MediaSessionMgr_defaultsSetAudioGain(int jarg1, int jarg2);
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetAudioPtime")]
public static extern bool MediaSessionMgr_defaultsSetAudioPtime(int jarg1);
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetAudioChannels")]
public static extern bool MediaSessionMgr_defaultsSetAudioChannels(int jarg1, int jarg2);
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetRtpPortRange")]
public static extern bool MediaSessionMgr_defaultsSetRtpPortRange(ushort jarg1, ushort jarg2);
@ -1236,6 +1245,9 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_delete_ProxyAudioConsumer")]
public static extern void delete_ProxyAudioConsumer(HandleRef jarg1);
[DllImport("tinyWRAP", EntryPoint="CSharp_ProxyAudioConsumer_setActualSndCardPlaybackParams")]
public static extern bool ProxyAudioConsumer_setActualSndCardPlaybackParams(HandleRef jarg1, int jarg2, int jarg3, int jarg4);
[DllImport("tinyWRAP", EntryPoint="CSharp_ProxyAudioConsumer_queryForResampler")]
public static extern bool ProxyAudioConsumer_queryForResampler(HandleRef jarg1, ushort jarg2, ushort jarg3, ushort jarg4, ushort jarg5, ushort jarg6);

View File

@ -1806,6 +1806,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsGetBandwidthLevel() {
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetCongestionCtrlEnabled(unsigned int jarg1) {
unsigned int jresult ;
bool arg1 ;
bool result;
arg1 = jarg1 ? true : false;
result = (bool)MediaSessionMgr::defaultsSetCongestionCtrlEnabled(arg1);
jresult = result;
return jresult;
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetVideoMotionRank(int jarg1) {
unsigned int jresult ;
int32_t arg1 ;
@ -2094,6 +2106,32 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetAudioGain(
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetAudioPtime(int jarg1) {
unsigned int jresult ;
int32_t arg1 ;
bool result;
arg1 = (int32_t)jarg1;
result = (bool)MediaSessionMgr::defaultsSetAudioPtime(arg1);
jresult = result;
return jresult;
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetAudioChannels(int jarg1, int jarg2) {
unsigned int jresult ;
int32_t arg1 ;
int32_t arg2 ;
bool result;
arg1 = (int32_t)jarg1;
arg2 = (int32_t)jarg2;
result = (bool)MediaSessionMgr::defaultsSetAudioChannels(arg1,arg2);
jresult = result;
return jresult;
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetRtpPortRange(unsigned short jarg1, unsigned short jarg2) {
unsigned int jresult ;
uint16_t arg1 ;
@ -5580,6 +5618,24 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_ProxyAudioConsumer(void * jarg1) {
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ProxyAudioConsumer_setActualSndCardPlaybackParams(void * jarg1, int jarg2, int jarg3, int jarg4) {
unsigned int jresult ;
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;
int arg2 ;
int arg3 ;
int arg4 ;
bool result;
arg1 = (ProxyAudioConsumer *)jarg1;
arg2 = (int)jarg2;
arg3 = (int)jarg3;
arg4 = (int)jarg4;
result = (bool)(arg1)->setActualSndCardPlaybackParams(arg2,arg3,arg4);
jresult = result;
return jresult;
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ProxyAudioConsumer_queryForResampler(void * jarg1, unsigned short jarg2, unsigned short jarg3, unsigned short jarg4, unsigned short jarg5, unsigned short jarg6) {
unsigned int jresult ;
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;

View File

@ -20,7 +20,8 @@ public enum tmedia_pref_video_size_t {
tmedia_pref_video_size_480p,
tmedia_pref_video_size_720p,
tmedia_pref_video_size_16cif,
tmedia_pref_video_size_1080p
tmedia_pref_video_size_1080p,
tmedia_pref_video_size_2160p
}
}

View File

@ -98,6 +98,10 @@ public class MediaSessionMgr {
return tmedia_bandwidth_level_t.swigToEnum(tinyWRAPJNI.MediaSessionMgr_defaultsGetBandwidthLevel());
}
public static boolean defaultsSetCongestionCtrlEnabled(boolean enabled) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetCongestionCtrlEnabled(enabled);
}
public static boolean defaultsSetVideoMotionRank(int video_motion_rank) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetVideoMotionRank(video_motion_rank);
}
@ -198,6 +202,14 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetAudioGain(producer_gain, consumer_gain);
}
public static boolean defaultsSetAudioPtime(int ptime) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetAudioPtime(ptime);
}
public static boolean defaultsSetAudioChannels(int channel_playback, int channel_record) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetAudioChannels(channel_playback, channel_record);
}
public static boolean defaultsSetRtpPortRange(int range_start, int range_stop) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetRtpPortRange(range_start, range_stop);
}

View File

@ -35,6 +35,10 @@ public class ProxyAudioConsumer extends ProxyPlugin {
super.delete();
}
public boolean setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels) {
return tinyWRAPJNI.ProxyAudioConsumer_setActualSndCardPlaybackParams(swigCPtr, this, nPtime, nRate, nChannels);
}
public boolean queryForResampler(int nInFreq, int nOutFreq, int nFrameDuration, int nChannels, int nResamplerQuality) {
return tinyWRAPJNI.ProxyAudioConsumer_queryForResampler(swigCPtr, this, nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
}

View File

@ -98,6 +98,10 @@ public class MediaSessionMgr {
return tmedia_bandwidth_level_t.swigToEnum(tinyWRAPJNI.MediaSessionMgr_defaultsGetBandwidthLevel());
}
public static boolean defaultsSetCongestionCtrlEnabled(boolean enabled) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetCongestionCtrlEnabled(enabled);
}
public static boolean defaultsSetVideoMotionRank(int video_motion_rank) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetVideoMotionRank(video_motion_rank);
}
@ -198,6 +202,14 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetAudioGain(producer_gain, consumer_gain);
}
public static boolean defaultsSetAudioPtime(int ptime) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetAudioPtime(ptime);
}
public static boolean defaultsSetAudioChannels(int channel_playback, int channel_record) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetAudioChannels(channel_playback, channel_record);
}
public static boolean defaultsSetRtpPortRange(int range_start, int range_stop) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetRtpPortRange(range_start, range_stop);
}

View File

@ -35,6 +35,10 @@ public class ProxyAudioConsumer extends ProxyPlugin {
super.delete();
}
public boolean setActualSndCardPlaybackParams(int nPtime, int nRate, int nChannels) {
return tinyWRAPJNI.ProxyAudioConsumer_setActualSndCardPlaybackParams(swigCPtr, this, nPtime, nRate, nChannels);
}
public boolean queryForResampler(int nInFreq, int nOutFreq, int nFrameDuration, int nChannels, int nResamplerQuality) {
return tinyWRAPJNI.ProxyAudioConsumer_queryForResampler(swigCPtr, this, nInFreq, nOutFreq, nFrameDuration, nChannels, nResamplerQuality);
}

View File

@ -59,6 +59,7 @@ public class tinyWRAPJNI {
public final static native int MediaSessionMgr_defaultsGetProfile();
public final static native boolean MediaSessionMgr_defaultsSetBandwidthLevel(int jarg1);
public final static native int MediaSessionMgr_defaultsGetBandwidthLevel();
public final static native boolean MediaSessionMgr_defaultsSetCongestionCtrlEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsSetVideoMotionRank(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoUploadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax(int jarg1);
@ -84,6 +85,8 @@ public class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsGet100relEnabled();
public final static native boolean MediaSessionMgr_defaultsSetScreenSize(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetAudioGain(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetAudioPtime(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetAudioChannels(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetRtpPortRange(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetRtpSymetricEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsSetMediaType(int jarg1);
@ -362,6 +365,7 @@ public class tinyWRAPJNI {
public final static native void ProxyAudioConsumerCallback_director_connect(ProxyAudioConsumerCallback obj, long cptr, boolean mem_own, boolean weak_global);
public final static native void ProxyAudioConsumerCallback_change_ownership(ProxyAudioConsumerCallback obj, long cptr, boolean take_or_release);
public final static native void delete_ProxyAudioConsumer(long jarg1);
public final static native boolean ProxyAudioConsumer_setActualSndCardPlaybackParams(long jarg1, ProxyAudioConsumer jarg1_, int jarg2, int jarg3, int jarg4);
public final static native boolean ProxyAudioConsumer_queryForResampler(long jarg1, ProxyAudioConsumer jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, int jarg6);
public final static native boolean ProxyAudioConsumer_setPullBuffer(long jarg1, ProxyAudioConsumer jarg1_, java.nio.ByteBuffer jarg2, long jarg3);
public final static native long ProxyAudioConsumer_pull__SWIG_0(long jarg1, ProxyAudioConsumer jarg1_, java.nio.ByteBuffer jarg2, long jarg3);

View File

@ -2841,6 +2841,20 @@ SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetCongestionCtrlEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
jboolean jresult = 0 ;
bool arg1 ;
bool result;
(void)jenv;
(void)jcls;
arg1 = jarg1 ? true : false;
result = (bool)MediaSessionMgr::defaultsSetCongestionCtrlEnabled(arg1);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetVideoMotionRank(JNIEnv *jenv, jclass jcls, jint jarg1) {
jboolean jresult = 0 ;
int32_t arg1 ;
@ -3179,6 +3193,36 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAudioPtime(JNIEnv *jenv, jclass jcls, jint jarg1) {
jboolean jresult = 0 ;
int32_t arg1 ;
bool result;
(void)jenv;
(void)jcls;
arg1 = (int32_t)jarg1;
result = (bool)MediaSessionMgr::defaultsSetAudioPtime(arg1);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAudioChannels(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
jboolean jresult = 0 ;
int32_t arg1 ;
int32_t arg2 ;
bool result;
(void)jenv;
(void)jcls;
arg1 = (int32_t)jarg1;
arg2 = (int32_t)jarg2;
result = (bool)MediaSessionMgr::defaultsSetAudioChannels(arg1,arg2);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetRtpPortRange(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
jboolean jresult = 0 ;
uint16_t arg1 ;
@ -7983,6 +8027,27 @@ SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1ProxyAudi
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyAudioConsumer_1setActualSndCardPlaybackParams(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4) {
jboolean jresult = 0 ;
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;
int arg2 ;
int arg3 ;
int arg4 ;
bool result;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(ProxyAudioConsumer **)&jarg1;
arg2 = (int)jarg2;
arg3 = (int)jarg3;
arg4 = (int)jarg4;
result = (bool)(arg1)->setActualSndCardPlaybackParams(arg2,arg3,arg4);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyAudioConsumer_1queryForResampler(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4, jint jarg5, jint jarg6) {
jboolean jresult = 0 ;
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;

View File

@ -20,7 +20,8 @@ public enum tmedia_pref_video_size_t {
tmedia_pref_video_size_480p,
tmedia_pref_video_size_720p,
tmedia_pref_video_size_16cif,
tmedia_pref_video_size_1080p;
tmedia_pref_video_size_1080p,
tmedia_pref_video_size_2160p;
public final int swigValue() {
return swigValue;

View File

@ -59,6 +59,7 @@ public class tinyWRAPJNI {
public final static native int MediaSessionMgr_defaultsGetProfile();
public final static native boolean MediaSessionMgr_defaultsSetBandwidthLevel(int jarg1);
public final static native int MediaSessionMgr_defaultsGetBandwidthLevel();
public final static native boolean MediaSessionMgr_defaultsSetCongestionCtrlEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsSetVideoMotionRank(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoUploadMax(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax(int jarg1);
@ -84,6 +85,8 @@ public class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsGet100relEnabled();
public final static native boolean MediaSessionMgr_defaultsSetScreenSize(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetAudioGain(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetAudioPtime(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetAudioChannels(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetRtpPortRange(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetRtpSymetricEnabled(boolean jarg1);
public final static native boolean MediaSessionMgr_defaultsSetMediaType(int jarg1);
@ -362,6 +365,7 @@ public class tinyWRAPJNI {
public final static native void ProxyAudioConsumerCallback_director_connect(ProxyAudioConsumerCallback obj, long cptr, boolean mem_own, boolean weak_global);
public final static native void ProxyAudioConsumerCallback_change_ownership(ProxyAudioConsumerCallback obj, long cptr, boolean take_or_release);
public final static native void delete_ProxyAudioConsumer(long jarg1);
public final static native boolean ProxyAudioConsumer_setActualSndCardPlaybackParams(long jarg1, ProxyAudioConsumer jarg1_, int jarg2, int jarg3, int jarg4);
public final static native boolean ProxyAudioConsumer_queryForResampler(long jarg1, ProxyAudioConsumer jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, int jarg6);
public final static native boolean ProxyAudioConsumer_setPullBuffer(long jarg1, ProxyAudioConsumer jarg1_, java.nio.ByteBuffer jarg2, long jarg3);
public final static native long ProxyAudioConsumer_pull__SWIG_0(long jarg1, ProxyAudioConsumer jarg1_, java.nio.ByteBuffer jarg2, long jarg3);

View File

@ -2841,6 +2841,20 @@ SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetCongestionCtrlEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
jboolean jresult = 0 ;
bool arg1 ;
bool result;
(void)jenv;
(void)jcls;
arg1 = jarg1 ? true : false;
result = (bool)MediaSessionMgr::defaultsSetCongestionCtrlEnabled(arg1);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetVideoMotionRank(JNIEnv *jenv, jclass jcls, jint jarg1) {
jboolean jresult = 0 ;
int32_t arg1 ;
@ -3179,6 +3193,36 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAudioPtime(JNIEnv *jenv, jclass jcls, jint jarg1) {
jboolean jresult = 0 ;
int32_t arg1 ;
bool result;
(void)jenv;
(void)jcls;
arg1 = (int32_t)jarg1;
result = (bool)MediaSessionMgr::defaultsSetAudioPtime(arg1);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetAudioChannels(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
jboolean jresult = 0 ;
int32_t arg1 ;
int32_t arg2 ;
bool result;
(void)jenv;
(void)jcls;
arg1 = (int32_t)jarg1;
arg2 = (int32_t)jarg2;
result = (bool)MediaSessionMgr::defaultsSetAudioChannels(arg1,arg2);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetRtpPortRange(JNIEnv *jenv, jclass jcls, jint jarg1, jint jarg2) {
jboolean jresult = 0 ;
uint16_t arg1 ;
@ -7983,6 +8027,27 @@ SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1ProxyAudi
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyAudioConsumer_1setActualSndCardPlaybackParams(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4) {
jboolean jresult = 0 ;
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;
int arg2 ;
int arg3 ;
int arg4 ;
bool result;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(ProxyAudioConsumer **)&jarg1;
arg2 = (int)jarg2;
arg3 = (int)jarg3;
arg4 = (int)jarg4;
result = (bool)(arg1)->setActualSndCardPlaybackParams(arg2,arg3,arg4);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_ProxyAudioConsumer_1queryForResampler(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3, jint jarg4, jint jarg5, jint jarg6) {
jboolean jresult = 0 ;
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;

View File

@ -20,7 +20,8 @@ public enum tmedia_pref_video_size_t {
tmedia_pref_video_size_480p,
tmedia_pref_video_size_720p,
tmedia_pref_video_size_16cif,
tmedia_pref_video_size_1080p;
tmedia_pref_video_size_1080p,
tmedia_pref_video_size_2160p;
public final int swigValue() {
return swigValue;

View File

@ -246,6 +246,7 @@ sub DESTROY {
*defaultsGetProfile = *tinyWRAPc::MediaSessionMgr_defaultsGetProfile;
*defaultsSetBandwidthLevel = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthLevel;
*defaultsGetBandwidthLevel = *tinyWRAPc::MediaSessionMgr_defaultsGetBandwidthLevel;
*defaultsSetCongestionCtrlEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetCongestionCtrlEnabled;
*defaultsSetVideoMotionRank = *tinyWRAPc::MediaSessionMgr_defaultsSetVideoMotionRank;
*defaultsSetBandwidthVideoUploadMax = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoUploadMax;
*defaultsSetBandwidthVideoDownloadMax = *tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax;
@ -271,6 +272,8 @@ sub DESTROY {
*defaultsGet100relEnabled = *tinyWRAPc::MediaSessionMgr_defaultsGet100relEnabled;
*defaultsSetScreenSize = *tinyWRAPc::MediaSessionMgr_defaultsSetScreenSize;
*defaultsSetAudioGain = *tinyWRAPc::MediaSessionMgr_defaultsSetAudioGain;
*defaultsSetAudioPtime = *tinyWRAPc::MediaSessionMgr_defaultsSetAudioPtime;
*defaultsSetAudioChannels = *tinyWRAPc::MediaSessionMgr_defaultsSetAudioChannels;
*defaultsSetRtpPortRange = *tinyWRAPc::MediaSessionMgr_defaultsSetRtpPortRange;
*defaultsSetRtpSymetricEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetRtpSymetricEnabled;
*defaultsSetMediaType = *tinyWRAPc::MediaSessionMgr_defaultsSetMediaType;
@ -1522,6 +1525,7 @@ sub DESTROY {
}
}
*setActualSndCardPlaybackParams = *tinyWRAPc::ProxyAudioConsumer_setActualSndCardPlaybackParams;
*queryForResampler = *tinyWRAPc::ProxyAudioConsumer_queryForResampler;
*setPullBuffer = *tinyWRAPc::ProxyAudioConsumer_setPullBuffer;
*pull = *tinyWRAPc::ProxyAudioConsumer_pull;
@ -2615,6 +2619,7 @@ package tinyWRAP;
*tmedia_pref_video_size_720p = *tinyWRAPc::tmedia_pref_video_size_720p;
*tmedia_pref_video_size_16cif = *tinyWRAPc::tmedia_pref_video_size_16cif;
*tmedia_pref_video_size_1080p = *tinyWRAPc::tmedia_pref_video_size_1080p;
*tmedia_pref_video_size_2160p = *tinyWRAPc::tmedia_pref_video_size_2160p;
*tmedia_codec_id_none = *tinyWRAPc::tmedia_codec_id_none;
*tmedia_codec_id_amr_nb_oa = *tinyWRAPc::tmedia_codec_id_amr_nb_oa;
*tmedia_codec_id_amr_nb_be = *tinyWRAPc::tmedia_codec_id_amr_nb_be;

View File

@ -3976,6 +3976,34 @@ XS(_wrap_MediaSessionMgr_defaultsGetBandwidthLevel) {
}
XS(_wrap_MediaSessionMgr_defaultsSetCongestionCtrlEnabled) {
{
bool arg1 ;
bool val1 ;
int ecode1 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: MediaSessionMgr_defaultsSetCongestionCtrlEnabled(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_defaultsSetCongestionCtrlEnabled" "', argument " "1"" of type '" "bool""'");
}
arg1 = static_cast< bool >(val1);
result = (bool)MediaSessionMgr::defaultsSetCongestionCtrlEnabled(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_defaultsSetVideoMotionRank) {
{
int32_t arg1 ;
@ -4616,6 +4644,72 @@ XS(_wrap_MediaSessionMgr_defaultsSetAudioGain) {
}
XS(_wrap_MediaSessionMgr_defaultsSetAudioPtime) {
{
int32_t arg1 ;
int val1 ;
int ecode1 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: MediaSessionMgr_defaultsSetAudioPtime(ptime);");
}
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_defaultsSetAudioPtime" "', argument " "1"" of type '" "int32_t""'");
}
arg1 = static_cast< int32_t >(val1);
result = (bool)MediaSessionMgr::defaultsSetAudioPtime(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_defaultsSetAudioChannels) {
{
int32_t arg1 ;
int32_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_defaultsSetAudioChannels(channel_playback,channel_record);");
}
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_defaultsSetAudioChannels" "', argument " "1"" of type '" "int32_t""'");
}
arg1 = static_cast< int32_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_defaultsSetAudioChannels" "', argument " "2"" of type '" "int32_t""'");
}
arg2 = static_cast< int32_t >(val2);
result = (bool)MediaSessionMgr::defaultsSetAudioChannels(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_defaultsSetRtpPortRange) {
{
uint16_t arg1 ;
@ -17474,6 +17568,64 @@ XS(_wrap_delete_ProxyAudioConsumer) {
}
XS(_wrap_ProxyAudioConsumer_setActualSndCardPlaybackParams) {
{
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;
int arg2 ;
int arg3 ;
int arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int val3 ;
int ecode3 = 0 ;
int val4 ;
int ecode4 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 4) || (items > 4)) {
SWIG_croak("Usage: ProxyAudioConsumer_setActualSndCardPlaybackParams(self,nPtime,nRate,nChannels);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ProxyAudioConsumer, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProxyAudioConsumer_setActualSndCardPlaybackParams" "', argument " "1"" of type '" "ProxyAudioConsumer *""'");
}
arg1 = reinterpret_cast< ProxyAudioConsumer * >(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 '" "ProxyAudioConsumer_setActualSndCardPlaybackParams" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProxyAudioConsumer_setActualSndCardPlaybackParams" "', argument " "3"" of type '" "int""'");
}
arg3 = static_cast< int >(val3);
ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
if (!SWIG_IsOK(ecode4)) {
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProxyAudioConsumer_setActualSndCardPlaybackParams" "', argument " "4"" of type '" "int""'");
}
arg4 = static_cast< int >(val4);
result = (bool)(arg1)->setActualSndCardPlaybackParams(arg2,arg3,arg4);
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_ProxyAudioConsumer_queryForResampler) {
{
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;
@ -27354,6 +27506,7 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::MediaSessionMgr_defaultsGetProfile", _wrap_MediaSessionMgr_defaultsGetProfile},
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthLevel", _wrap_MediaSessionMgr_defaultsSetBandwidthLevel},
{"tinyWRAPc::MediaSessionMgr_defaultsGetBandwidthLevel", _wrap_MediaSessionMgr_defaultsGetBandwidthLevel},
{"tinyWRAPc::MediaSessionMgr_defaultsSetCongestionCtrlEnabled", _wrap_MediaSessionMgr_defaultsSetCongestionCtrlEnabled},
{"tinyWRAPc::MediaSessionMgr_defaultsSetVideoMotionRank", _wrap_MediaSessionMgr_defaultsSetVideoMotionRank},
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoUploadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoUploadMax},
{"tinyWRAPc::MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax},
@ -27379,6 +27532,8 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::MediaSessionMgr_defaultsGet100relEnabled", _wrap_MediaSessionMgr_defaultsGet100relEnabled},
{"tinyWRAPc::MediaSessionMgr_defaultsSetScreenSize", _wrap_MediaSessionMgr_defaultsSetScreenSize},
{"tinyWRAPc::MediaSessionMgr_defaultsSetAudioGain", _wrap_MediaSessionMgr_defaultsSetAudioGain},
{"tinyWRAPc::MediaSessionMgr_defaultsSetAudioPtime", _wrap_MediaSessionMgr_defaultsSetAudioPtime},
{"tinyWRAPc::MediaSessionMgr_defaultsSetAudioChannels", _wrap_MediaSessionMgr_defaultsSetAudioChannels},
{"tinyWRAPc::MediaSessionMgr_defaultsSetRtpPortRange", _wrap_MediaSessionMgr_defaultsSetRtpPortRange},
{"tinyWRAPc::MediaSessionMgr_defaultsSetRtpSymetricEnabled", _wrap_MediaSessionMgr_defaultsSetRtpSymetricEnabled},
{"tinyWRAPc::MediaSessionMgr_defaultsSetMediaType", _wrap_MediaSessionMgr_defaultsSetMediaType},
@ -27590,6 +27745,7 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::ProxyAudioConsumerCallback_pause", _wrap_ProxyAudioConsumerCallback_pause},
{"tinyWRAPc::ProxyAudioConsumerCallback_stop", _wrap_ProxyAudioConsumerCallback_stop},
{"tinyWRAPc::delete_ProxyAudioConsumer", _wrap_delete_ProxyAudioConsumer},
{"tinyWRAPc::ProxyAudioConsumer_setActualSndCardPlaybackParams", _wrap_ProxyAudioConsumer_setActualSndCardPlaybackParams},
{"tinyWRAPc::ProxyAudioConsumer_queryForResampler", _wrap_ProxyAudioConsumer_queryForResampler},
{"tinyWRAPc::ProxyAudioConsumer_setPullBuffer", _wrap_ProxyAudioConsumer_setPullBuffer},
{"tinyWRAPc::ProxyAudioConsumer_pull", _wrap_ProxyAudioConsumer_pull},
@ -28954,6 +29110,11 @@ XS(SWIG_init) {
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_pref_video_size_1080p)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/local/share/swig/2.0.9/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "tmedia_pref_video_size_2160p", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_pref_video_size_2160p)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/local/share/swig/2.0.9/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "tmedia_codec_id_none", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(tmedia_codec_id_none)));

View File

@ -199,6 +199,8 @@ class MediaSessionMgr(_object):
if _newclass:defaultsSetBandwidthLevel = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetBandwidthLevel)
__swig_getmethods__["defaultsGetBandwidthLevel"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsGetBandwidthLevel
if _newclass:defaultsGetBandwidthLevel = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsGetBandwidthLevel)
__swig_getmethods__["defaultsSetCongestionCtrlEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetCongestionCtrlEnabled
if _newclass:defaultsSetCongestionCtrlEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetCongestionCtrlEnabled)
__swig_getmethods__["defaultsSetVideoMotionRank"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetVideoMotionRank
if _newclass:defaultsSetVideoMotionRank = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetVideoMotionRank)
__swig_getmethods__["defaultsSetBandwidthVideoUploadMax"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetBandwidthVideoUploadMax
@ -249,6 +251,10 @@ class MediaSessionMgr(_object):
if _newclass:defaultsSetScreenSize = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetScreenSize)
__swig_getmethods__["defaultsSetAudioGain"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetAudioGain
if _newclass:defaultsSetAudioGain = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetAudioGain)
__swig_getmethods__["defaultsSetAudioPtime"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetAudioPtime
if _newclass:defaultsSetAudioPtime = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetAudioPtime)
__swig_getmethods__["defaultsSetAudioChannels"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetAudioChannels
if _newclass:defaultsSetAudioChannels = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetAudioChannels)
__swig_getmethods__["defaultsSetRtpPortRange"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetRtpPortRange
if _newclass:defaultsSetRtpPortRange = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetRtpPortRange)
__swig_getmethods__["defaultsSetRtpSymetricEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetRtpSymetricEnabled
@ -334,6 +340,10 @@ def MediaSessionMgr_defaultsGetBandwidthLevel():
return _tinyWRAP.MediaSessionMgr_defaultsGetBandwidthLevel()
MediaSessionMgr_defaultsGetBandwidthLevel = _tinyWRAP.MediaSessionMgr_defaultsGetBandwidthLevel
def MediaSessionMgr_defaultsSetCongestionCtrlEnabled(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetCongestionCtrlEnabled(*args)
MediaSessionMgr_defaultsSetCongestionCtrlEnabled = _tinyWRAP.MediaSessionMgr_defaultsSetCongestionCtrlEnabled
def MediaSessionMgr_defaultsSetVideoMotionRank(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetVideoMotionRank(*args)
MediaSessionMgr_defaultsSetVideoMotionRank = _tinyWRAP.MediaSessionMgr_defaultsSetVideoMotionRank
@ -434,6 +444,14 @@ def MediaSessionMgr_defaultsSetAudioGain(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetAudioGain(*args)
MediaSessionMgr_defaultsSetAudioGain = _tinyWRAP.MediaSessionMgr_defaultsSetAudioGain
def MediaSessionMgr_defaultsSetAudioPtime(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetAudioPtime(*args)
MediaSessionMgr_defaultsSetAudioPtime = _tinyWRAP.MediaSessionMgr_defaultsSetAudioPtime
def MediaSessionMgr_defaultsSetAudioChannels(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetAudioChannels(*args)
MediaSessionMgr_defaultsSetAudioChannels = _tinyWRAP.MediaSessionMgr_defaultsSetAudioChannels
def MediaSessionMgr_defaultsSetRtpPortRange(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetRtpPortRange(*args)
MediaSessionMgr_defaultsSetRtpPortRange = _tinyWRAP.MediaSessionMgr_defaultsSetRtpPortRange
@ -1202,6 +1220,7 @@ class ProxyAudioConsumer(ProxyPlugin):
__repr__ = _swig_repr
__swig_destroy__ = _tinyWRAP.delete_ProxyAudioConsumer
__del__ = lambda self : None;
def setActualSndCardPlaybackParams(self, *args): return _tinyWRAP.ProxyAudioConsumer_setActualSndCardPlaybackParams(self, *args)
def queryForResampler(self, *args): return _tinyWRAP.ProxyAudioConsumer_queryForResampler(self, *args)
def setPullBuffer(self, *args): return _tinyWRAP.ProxyAudioConsumer_setPullBuffer(self, *args)
def pull(self, *args): return _tinyWRAP.ProxyAudioConsumer_pull(self, *args)
@ -1714,6 +1733,7 @@ tmedia_pref_video_size_480p = _tinyWRAP.tmedia_pref_video_size_480p
tmedia_pref_video_size_720p = _tinyWRAP.tmedia_pref_video_size_720p
tmedia_pref_video_size_16cif = _tinyWRAP.tmedia_pref_video_size_16cif
tmedia_pref_video_size_1080p = _tinyWRAP.tmedia_pref_video_size_1080p
tmedia_pref_video_size_2160p = _tinyWRAP.tmedia_pref_video_size_2160p
tmedia_codec_id_none = _tinyWRAP.tmedia_codec_id_none
tmedia_codec_id_amr_nb_oa = _tinyWRAP.tmedia_codec_id_amr_nb_oa
tmedia_codec_id_amr_nb_be = _tinyWRAP.tmedia_codec_id_amr_nb_be

View File

@ -6993,6 +6993,28 @@ fail:
}
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetCongestionCtrlEnabled(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_defaultsSetCongestionCtrlEnabled",&obj0)) SWIG_fail;
ecode1 = SWIG_AsVal_bool(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetCongestionCtrlEnabled" "', argument " "1"" of type '" "bool""'");
}
arg1 = static_cast< bool >(val1);
result = (bool)MediaSessionMgr::defaultsSetCongestionCtrlEnabled(arg1);
resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetVideoMotionRank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int32_t arg1 ;
@ -7489,6 +7511,59 @@ fail:
}
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetAudioPtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int32_t arg1 ;
int val1 ;
int ecode1 = 0 ;
PyObject * obj0 = 0 ;
bool result;
if (!PyArg_ParseTuple(args,(char *)"O:MediaSessionMgr_defaultsSetAudioPtime",&obj0)) SWIG_fail;
ecode1 = SWIG_AsVal_int(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetAudioPtime" "', argument " "1"" of type '" "int32_t""'");
}
arg1 = static_cast< int32_t >(val1);
result = (bool)MediaSessionMgr::defaultsSetAudioPtime(arg1);
resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetAudioChannels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int32_t arg1 ;
int32_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_defaultsSetAudioChannels",&obj0,&obj1)) SWIG_fail;
ecode1 = SWIG_AsVal_int(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetAudioChannels" "', argument " "1"" of type '" "int32_t""'");
}
arg1 = static_cast< int32_t >(val1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MediaSessionMgr_defaultsSetAudioChannels" "', argument " "2"" of type '" "int32_t""'");
}
arg2 = static_cast< int32_t >(val2);
result = (bool)MediaSessionMgr::defaultsSetAudioChannels(arg1,arg2);
resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetRtpPortRange(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
uint16_t arg1 ;
@ -17475,6 +17550,55 @@ fail:
}
SWIGINTERN PyObject *_wrap_ProxyAudioConsumer_setActualSndCardPlaybackParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;
int arg2 ;
int arg3 ;
int arg4 ;
void *argp1 = 0 ;
int res1 = 0 ;
int val2 ;
int ecode2 = 0 ;
int val3 ;
int ecode3 = 0 ;
int val4 ;
int ecode4 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
bool result;
if (!PyArg_ParseTuple(args,(char *)"OOOO:ProxyAudioConsumer_setActualSndCardPlaybackParams",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ProxyAudioConsumer, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProxyAudioConsumer_setActualSndCardPlaybackParams" "', argument " "1"" of type '" "ProxyAudioConsumer *""'");
}
arg1 = reinterpret_cast< ProxyAudioConsumer * >(argp1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProxyAudioConsumer_setActualSndCardPlaybackParams" "', argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
ecode3 = SWIG_AsVal_int(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProxyAudioConsumer_setActualSndCardPlaybackParams" "', argument " "3"" of type '" "int""'");
}
arg3 = static_cast< int >(val3);
ecode4 = SWIG_AsVal_int(obj3, &val4);
if (!SWIG_IsOK(ecode4)) {
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProxyAudioConsumer_setActualSndCardPlaybackParams" "', argument " "4"" of type '" "int""'");
}
arg4 = static_cast< int >(val4);
result = (bool)(arg1)->setActualSndCardPlaybackParams(arg2,arg3,arg4);
resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_ProxyAudioConsumer_queryForResampler(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
ProxyAudioConsumer *arg1 = (ProxyAudioConsumer *) 0 ;
@ -25792,6 +25916,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"MediaSessionMgr_defaultsGetProfile", _wrap_MediaSessionMgr_defaultsGetProfile, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetBandwidthLevel", _wrap_MediaSessionMgr_defaultsSetBandwidthLevel, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsGetBandwidthLevel", _wrap_MediaSessionMgr_defaultsGetBandwidthLevel, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetCongestionCtrlEnabled", _wrap_MediaSessionMgr_defaultsSetCongestionCtrlEnabled, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetVideoMotionRank", _wrap_MediaSessionMgr_defaultsSetVideoMotionRank, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetBandwidthVideoUploadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoUploadMax, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax", _wrap_MediaSessionMgr_defaultsSetBandwidthVideoDownloadMax, METH_VARARGS, NULL},
@ -25817,6 +25942,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"MediaSessionMgr_defaultsGet100relEnabled", _wrap_MediaSessionMgr_defaultsGet100relEnabled, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetScreenSize", _wrap_MediaSessionMgr_defaultsSetScreenSize, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetAudioGain", _wrap_MediaSessionMgr_defaultsSetAudioGain, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetAudioPtime", _wrap_MediaSessionMgr_defaultsSetAudioPtime, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetAudioChannels", _wrap_MediaSessionMgr_defaultsSetAudioChannels, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetRtpPortRange", _wrap_MediaSessionMgr_defaultsSetRtpPortRange, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetRtpSymetricEnabled", _wrap_MediaSessionMgr_defaultsSetRtpSymetricEnabled, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetMediaType", _wrap_MediaSessionMgr_defaultsSetMediaType, METH_VARARGS, NULL},
@ -26063,6 +26190,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"disown_ProxyAudioConsumerCallback", _wrap_disown_ProxyAudioConsumerCallback, METH_VARARGS, NULL},
{ (char *)"ProxyAudioConsumerCallback_swigregister", ProxyAudioConsumerCallback_swigregister, METH_VARARGS, NULL},
{ (char *)"delete_ProxyAudioConsumer", _wrap_delete_ProxyAudioConsumer, METH_VARARGS, NULL},
{ (char *)"ProxyAudioConsumer_setActualSndCardPlaybackParams", _wrap_ProxyAudioConsumer_setActualSndCardPlaybackParams, METH_VARARGS, NULL},
{ (char *)"ProxyAudioConsumer_queryForResampler", _wrap_ProxyAudioConsumer_queryForResampler, METH_VARARGS, NULL},
{ (char *)"ProxyAudioConsumer_setPullBuffer", _wrap_ProxyAudioConsumer_setPullBuffer, METH_VARARGS, NULL},
{ (char *)"ProxyAudioConsumer_pull", _wrap_ProxyAudioConsumer_pull, METH_VARARGS, NULL},
@ -27625,6 +27753,7 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "tmedia_pref_video_size_720p",SWIG_From_int(static_cast< int >(tmedia_pref_video_size_720p)));
SWIG_Python_SetConstant(d, "tmedia_pref_video_size_16cif",SWIG_From_int(static_cast< int >(tmedia_pref_video_size_16cif)));
SWIG_Python_SetConstant(d, "tmedia_pref_video_size_1080p",SWIG_From_int(static_cast< int >(tmedia_pref_video_size_1080p)));
SWIG_Python_SetConstant(d, "tmedia_pref_video_size_2160p",SWIG_From_int(static_cast< int >(tmedia_pref_video_size_2160p)));
SWIG_Python_SetConstant(d, "tmedia_codec_id_none",SWIG_From_int(static_cast< int >(tmedia_codec_id_none)));
SWIG_Python_SetConstant(d, "tmedia_codec_id_amr_nb_oa",SWIG_From_int(static_cast< int >(tmedia_codec_id_amr_nb_oa)));
SWIG_Python_SetConstant(d, "tmedia_codec_id_amr_nb_be",SWIG_From_int(static_cast< int >(tmedia_codec_id_amr_nb_be)));

View File

@ -1,5 +1,12 @@
#
# Copyright (C) 2010-2013 Mamadou DIOP
# Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
# License: GPLv3 or commercial
# This file is part of Doubango VoIP framework <https://code.google.com/p/doubango/>
#
AC_PREREQ([2.0])
AC_INIT(libdoubango, 0.1, doubango(at)googlegroups(dot)com)
AC_INIT(libdoubango, 2.0.898, doubango(at)googlegroups(dot)com)
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
@ -18,6 +25,8 @@ AC_PROG_SED
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
## Are we using Windows?
#dnl detecting WIN32
#case "$host" in
@ -114,20 +123,24 @@ AC_CHECK_TYPES([struct sockaddr_dl], [], [],
#endif
])
have_resolv=no
AH_TEMPLATE([HAVE_DNS_H], [Define if <dns.h> header exist])
AC_CHECK_HEADER([dns.h], AC_DEFINE(HAVE_DNS_H, 1), AC_DEFINE(HAVE_DNS_H, 0), [])
AM_CONDITIONAL(USE_RESOLV, false)
AC_CHECK_LIB([resolv], [dns_search],
AC_SUBST(LIBRESOLV_LIBADD, "-lresolv")
AM_CONDITIONAL(USE_RESOLV, true),
AM_CONDITIONAL(USE_RESOLV, true)
[have_resolv=yes],
AC_SUBST(LIBRESOLV_LIBADD, "")
)
AM_CONDITIONAL(USE_RT, false)
have_rt=no
AC_CHECK_LIB([rt], [clock_gettime],
AC_SUBST(LIBRT_LIBADD, "-lrt")
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define to 1 if we have the `clock_gettime' function.])
AM_CONDITIONAL(USE_RT, true),
AM_CONDITIONAL(USE_RT, true)
[have_rt=yes],
AC_SUBST(LIBRT_LIBADD, "")
)
@ -137,150 +150,573 @@ AC_CHECK_MEMBER([struct sockaddr_storage.ss_len], AC_DEFINE(TNET_HAVE_SS_LEN, 1)
AH_TEMPLATE([TNET_HAVE_SA_LEN], [Define if sockaddr.sa_len exists])
AC_CHECK_MEMBER([struct sockaddr.sa_len], AC_DEFINE(TNET_HAVE_SA_LEN, 1), AC_DEFINE(TNET_HAVE_SA_LEN, 0), [#include <netinet/in.h>])
########################################################
# SRTP
# --with-srtp / --without-srtp as argument to configure
########################################################
AH_TEMPLATE([HAVE_APPEND_SALT_TO_KEY], [Checks if the installed libsrtp version support append_salt_to_key() function])
AH_TEMPLATE([HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH], [Checks if the installed libsrtp version support srtp_profile_get_master_key_length() function])
AH_TEMPLATE([HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH], [Checks if the installed libsrtp version support srtp_profile_get_master_salt_length() function])
AM_CONDITIONAL(USE_SRTP, false)
have_srtp=check
want_srtp=check
path_srtp=undef
AC_SUBST(LIBSRTP_LIBADD, "")
AC_ARG_WITH(srtp,
[ --with-srtp Link against libsrtp library],
[AC_DEFINE_UNQUOTED(HAVE_SRTP, 1, HAVE_SRTP)
AC_SUBST(LIBSRTP_LIBADD, "-lsrtp")
AC_CHECK_LIB(srtp, append_salt_to_key, AC_DEFINE(HAVE_APPEND_SALT_TO_KEY, 1), AC_DEFINE(HAVE_APPEND_SALT_TO_KEY, 0))
AC_CHECK_LIB(srtp, srtp_profile_get_master_key_length, AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH, 1), AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH, 0))
AC_CHECK_LIB(srtp, srtp_profile_get_master_salt_length, AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH, 1), AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH, 0))
AM_CONDITIONAL(USE_SRTP, true)],
[ AC_SUBST(LIBSRTP_LIBADD, "")])
[ --with-srtp=PATH Build with SRTP (requires libsrtp). PATH is optional.],
if test "x$withval" = "xyes"; then
want_srtp=yes
path_srtp=undef
elif test "x$withval" = "xno"; then
want_srtp=no
path_srtp=undef
elif test "$withval"; then
want_srtp=yes
path_srtp=$withval
fi,
)
# only if --without-srtp not used
if test $want_srtp != no; then
# check for lib and headers
AC_CHECK_HEADERS(srtp/srtp.h,
AC_CHECK_LIB(srtp, srtp_create, AC_DEFINE_UNQUOTED(HAVE_SRTP, 1, HAVE_SRTP) [have_srtp=yes] LIBSRTP_LIBADD="-lsrtp"
AC_CHECK_LIB(srtp, append_salt_to_key, AC_DEFINE(HAVE_APPEND_SALT_TO_KEY, 1), AC_DEFINE(HAVE_APPEND_SALT_TO_KEY, 0))
AC_CHECK_LIB(srtp, srtp_profile_get_master_key_length, AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH, 1), AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_KEY_LENGTH, 0))
AC_CHECK_LIB(srtp, srtp_profile_get_master_salt_length, AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH, 1), AC_DEFINE(HAVE_SRTP_PROFILE_GET_MASTER_SALT_LENGTH, 0))
,
AC_DEFINE_UNQUOTED(HAVE_SRTP, 0, HAVE_SRTP) [have_srtp=no]
))
AM_CONDITIONAL(USE_SSL, false)
# if srtp not found and requested then, die.
test $have_srtp:$want_srtp = no:yes &&
AC_MSG_ERROR([You requested SRTP (requires libsrtp) but not found...die])
fi
AM_CONDITIONAL([USE_SRTP], [test $have_srtp = yes])
########################################################
# SSL
# --with-ssl / --without-ssl as argument to configure
########################################################
have_ssl=check
have_dtls_srtp=check
have_dtls=check
want_ssl=check
path_ssl=undef
AC_SUBST(LIBSSL_LIBADD, "")
AC_ARG_WITH(ssl,
[ --with-ssl Link against OpenSSL libraries],
[AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 1, HAVE_OPENSSL)
AC_SUBST(LIBSSL_LIBADD, "-lssl -lcrypto")
AC_CHECK_LIB(ssl, SSL_CTX_set_tlsext_use_srtp, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS_SRTP, 1, HAVE_OPENSSL_DTLS_SRTP))
AC_CHECK_LIB(ssl, DTLSv1_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS, 1, HAVE_OPENSSL_DTLS))
AM_CONDITIONAL(USE_SSL, true)],
[ AC_SUBST(LIBSSL_LIBADD, "")])
[ --with-ssl=PATH Build with SSL (requires OpenSSL). PATH is optional.],
if test "x$withval" = "xyes"; then
want_ssl=yes
path_ssl=undef
elif test "x$withval" = "xno"; then
want_ssl=no
path_ssl=undef
elif test "$withval"; then
want_ssl=yes
path_ssl=$withval
fi,
)
# only if --without-ssl not used
if test $want_ssl != no; then
# check for lib and headers
AC_CHECK_HEADERS(openssl/ssl.h,
AC_CHECK_LIB(ssl, SSL_library_init, AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 1, HAVE_OPENSSL) [have_ssl=yes] LIBSSL_LIBADD="${LIBSSL_LIBADD} -lssl",
AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 0, HAVE_OPENSSL) [have_ssl=no]
))
AC_CHECK_LIB(crypto, BN_init, LIBSSL_LIBADD="${LIBSSL_LIBADD} -lcrypto")
AC_CHECK_LIB(ssl, SSL_CTX_set_tlsext_use_srtp, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS_SRTP, 1, HAVE_OPENSSL_DTLS_SRTP) [have_dtls_srtp=yes])
AC_CHECK_LIB(ssl, DTLSv1_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS, 1, HAVE_OPENSSL_DTLS) [have_dtls=yes])
# if opus not found and requested then, die.
test $have_ssl:$want_ssl = no:yes &&
AC_MSG_ERROR([You requested SSL (requires OpenSSL) but not found...die])
fi
AM_CONDITIONAL([USE_SSL], [test $have_ssl = yes])
AM_CONDITIONAL(USE_FFMPEG, false)
########################################################
# FFmpeg
# --with-ffmpeg / --without-ffmpeg as argument to configure
########################################################
have_ffmpeg=check
want_ffmpeg=check
path_ffmpeg=undef
AC_SUBST(LIBFFMPEG_LIBADD, "")
AC_ARG_WITH(ffmpeg,
[ --with-ffmpeg Link against ffmpeg libraries with H.263 and MP4V-ES enabled],
[AC_DEFINE_UNQUOTED(HAVE_FFMPEG, 1, HAVE_FFMPEG)
AC_SUBST(LIBFFMPEG_LIBADD, "-lavutil -lswscale -lavcodec")
AM_CONDITIONAL(USE_FFMPEG, true)],
[ AC_SUBST(LIBFFMPEG_LIBADD, "")])
[ --with-ffmpeg=PATH Build with FFmpeg (h264, h263, theora, mp4v-es). PATH is optional.],
if test "x$withval" = "xyes"; then
want_ffmpeg=yes
path_ffmpeg=undef
elif test "x$withval" = "xno"; then
want_ffmpeg=no
path_ffmpeg=undef
elif test "$withval"; then
want_ffmpeg=yes
path_ffmpeg=$withval
fi,
)
# only if --without-opus not used
if test $want_ffmpeg != no; then
have_ffmpeg=yes
have_avutil=check
AC_CHECK_HEADERS(libavutil/avutil.h,
AC_CHECK_LIB(avutil, av_gettime, [have_avutil=yes] LIBFFMPEG_LIBADD="${LIBFFMPEG_LIBADD} -lavutil", [have_avutil=no] [have_ffmpeg=no])
)
have_swscale=check
AC_CHECK_HEADERS(libswscale/swscale.h,
AC_CHECK_LIB(swscale, sws_scale, [have_swscale=yes] LIBFFMPEG_LIBADD="${LIBFFMPEG_LIBADD} -lswscale", [have_swscale=no] [have_ffmpeg=no])
)
have_avcodec=check
AC_CHECK_HEADERS(libavcodec/avcodec.h,
AC_CHECK_LIB(avcodec, avcodec_find_encoder, [have_avcodec=yes] LIBFFMPEG_LIBADD="${LIBFFMPEG_LIBADD} -lavcodec", [have_avcodec=no] [have_ffmpeg=no])
)
test $have_ffmpeg = yes &&
AC_DEFINE_UNQUOTED(HAVE_FFMPEG, 1, HAVE_FFMPEG)
# if ffmpeg not found and requested then, die.
test $have_ffmpeg:$want_ffmpeg = no:yes &&
AC_MSG_ERROR([You requested FFmpeg (h264, h263, theora, mp4v-es) but not found...die])
fi
AM_CONDITIONAL([USE_FFMPEG], [test $have_ffmpeg = yes])
AM_CONDITIONAL(USE_H264, false)
AC_ARG_WITH(h264,
[ --with-h264 Link against x264. Requires ffmpeg libraries with H.264 enabled],
[AC_DEFINE_UNQUOTED(HAVE_H264, 1, HAVE_H264)
AC_SUBST(LIBH264_LIBADD, "-lx264")
AM_CONDITIONAL(USE_H264, true)],
[ AC_SUBST(LIBH264_LIBADD, "")])
AC_SUBST(LIBH264_LIBADD, "")
AC_ARG_WITH(h264, [ --with-h264 IMPORTANT: deprecated to be removed ],[], [])
AM_CONDITIONAL(USE_VPX, false)
########################################################
# VPX (VP8, VP9)
# --with-vpx / --without-vpx as argument to configure
########################################################
have_vpx=check
want_vpx=check
path_vpx=undef
AC_SUBST(LIBVPX_LIBADD, "")
AC_ARG_WITH(vpx,
[ --with-vpx Link against libvpx library],
[AC_DEFINE_UNQUOTED(HAVE_LIBVPX, 1, HAVE_LIBVPX)
AC_SUBST(LIBVPX_LIBADD, "-lvpx")
AM_CONDITIONAL(USE_VPX, true)],
[ AC_SUBST(LIBVPX_LIBADD, "")])
AM_CONDITIONAL(USE_YUV, false)
AC_ARG_WITH(yuv,
[ --with-yuv Link against libyuv library],
[AC_DEFINE_UNQUOTED(HAVE_LIBYUV, 1, HAVE_LIBYUV)
AM_CONDITIONAL(USE_YUV, true)
if test "x$withval" = xyes; then
LIBYUV_INCLUDE="/usr/local/include"
LIBYUV_LIB="/usr/local/lib"
else
LIBYUV_INCLUDE="${withval}/include"
LIBYUV_LIB="${withval}/lib"
[ --with-vpx=PATH Build with VPX(VP8, VP9) video codecs. PATH is optional.],
if test "x$withval" = "xyes"; then
want_vpx=yes
path_vpx=undef
elif test "x$withval" = "xno"; then
want_vpx=no
path_vpx=undef
elif test "$withval"; then
want_vpx=yes
path_vpx=$withval
fi,
)
# only if --without-vpx not used
if test $want_vpx != no; then
# check for lib and headers
AC_CHECK_HEADERS(vpx/vpx_encoder.h vpx/vpx_decoder.h,
AC_CHECK_LIB(vpx, vpx_codec_encode, AC_DEFINE_UNQUOTED(HAVE_LIBVPX, 1, HAVE_LIBVPX) [have_vpx=yes] LIBVPX_LIBADD="-lvpx",
AC_DEFINE_UNQUOTED(HAVE_LIBVPX, 0, HAVE_LIBVPX) [have_vpx=no]
))
# if opus not found and requested then, die.
test $have_vpx:$want_vpx = no:yes &&
AC_MSG_ERROR([You requested VPX(VP8, VP9) video codecs but not found...die])
fi
])
AM_CONDITIONAL([USE_VPX], [test $have_vpx = yes])
AM_CONDITIONAL(USE_AMR, false)
########################################################
# YUV
# --with-yuv / --without-yuv as argument to configure
########################################################
have_yuv=check
want_yuv=check
path_yuv=undef
AC_SUBST(LIBYUV_INCLUDE, "")
AC_SUBST(LIBYUV_LIB, "")
AC_ARG_WITH(yuv,
[ --with-yuv=PATH Build with LIBYUV. PATH is optional.],
if test "x$withval" = "xyes"; then
want_yuv=yes
path_yuv=undef
elif test "x$withval" = "xno"; then
want_yuv=no
path_yuv=undef
elif test "$withval"; then
want_yuv=yes
path_yuv=$withval
fi,
)
# only if --without-yuv not used
if test $want_yuv != no; then
# check for lib and headers
AC_CHECK_HEADERS(libyuv/libyuv.h,
AC_CHECK_LIB(yuv, I420Scale, AC_DEFINE_UNQUOTED(HAVE_LIBYUV, 1, HAVE_LIBYUV) [have_yuv=yes]
if test "x$path_yuv" = xundef; then
LIBYUV_INCLUDE="-I/usr/local/include"
LIBYUV_LIB="-L/usr/local/lib -lyuv"
else
LIBYUV_INCLUDE="-I${path_yuv}/include"
LIBYUV_LIB="-L${path_yuv}/lib -lyuv"
fi
,
AC_DEFINE_UNQUOTED(HAVE_LIBYUV, 0, HAVE_LIBYUV) [have_yuv=no]
))
# if opus not found and requested then, die.
test $have_yuv:$want_yuv = no:yes &&
AC_MSG_ERROR([You requested LIBYUV but not found...die])
fi
AM_CONDITIONAL([USE_YUV], [test $have_yuv = yes])
########################################################
# AMR
# --with-amr / --without-amr as argument to configure
########################################################
have_amr=check
want_amr=check
path_amr=undef
AC_SUBST(LIBAMR_LIBADD, "")
AC_ARG_WITH(amr,
[ --with-amr Link against libopencore-amrnb library],
[AC_DEFINE_UNQUOTED(HAVE_OPENCORE_AMR, 1, HAVE_OPENCORE_AMR)
AC_SUBST(LIBAMR_LIBADD, "-lopencore-amrnb")
AM_CONDITIONAL(USE_AMR, true)],
[ AC_SUBST(LIBAMR_LIBADD, "")])
AM_CONDITIONAL(USE_OPUS, false)
[ --with-amr=PATH Build with AMR audio codec (requires opencore-amr library). PATH is optional.],
if test "x$withval" = "xyes"; then
want_amr=yes
path_amr=undef
elif test "x$withval" = "xno"; then
want_amr=no
path_amr=undef
elif test "$withval"; then
want_amr=yes
path_amr=$withval
fi,
)
# only if --without-amr not used
if test $want_amr != no; then
# check for lib and headers
AC_CHECK_HEADERS(opencore-amrnb/interf_dec.h opencore-amrnb/interf_enc.h,
AC_CHECK_LIB(opencore-amrnb, Encoder_Interface_init, AC_DEFINE_UNQUOTED(HAVE_OPENCORE_AMR, 1, HAVE_OPENCORE_AMR) [have_amr=yes] LIBAMR_LIBADD="-lopencore-amrnb",
AC_DEFINE_UNQUOTED(HAVE_OPENCORE_AMR, 0, HAVE_OPENCORE_AMR) [have_amr=no]
))
# if amr not found and requested then, die.
test $have_amr:$want_amr = no:yes &&
AC_MSG_ERROR([You requested AMR audio codec but not found...die])
fi
AM_CONDITIONAL([USE_AMR], [test $have_amr = yes])
########################################################
# OPUS
# --with-opus / --without-opus as argument to configure
########################################################
have_opus=check
want_opus=check
path_opus=undef
AC_SUBST(LIBOPUS_LIBADD, "")
AC_ARG_WITH(opus,
[ --with-opus Link against libopus library],
[AC_DEFINE_UNQUOTED(HAVE_LIBOPUS, 1, HAVE_LIBOPUS)
AC_SUBST(LIBOPUS_LIBADD, "-lopus")
AM_CONDITIONAL(USE_OPUS, true)],
[ AC_SUBST(LIBOPUS_LIBADD, "")])
[ --with-opus=PATH Build with OPUS audio codec. PATH is optional.],
if test "x$withval" = "xyes"; then
want_opus=yes
path_opus=undef
elif test "x$withval" = "xno"; then
want_opus=no
path_opus=undef
elif test "$withval"; then
want_opus=yes
path_opus=$withval
fi,
)
# only if --without-opus not used
if test $want_opus != no; then
# check for lib and headers
AC_CHECK_HEADERS(opus/opus.h,
AC_CHECK_LIB(opus, opus_decoder_create, AC_DEFINE_UNQUOTED(HAVE_LIBOPUS, 1, HAVE_LIBOPUS) [have_opus=yes] LIBOPUS_LIBADD="-lopus",
AC_DEFINE_UNQUOTED(HAVE_LIBOPUS, 0, HAVE_LIBOPUS) [have_opus=no]
))
# if opus not found and requested then, die.
test $have_opus:$want_opus = no:yes &&
AC_MSG_ERROR([You requested OPUS audio codec but not found...die])
fi
AM_CONDITIONAL([USE_OPUS], [test $have_opus = yes])
AM_CONDITIONAL(USE_SPEEX, false)
########################################################
# SPEEX
# --with-speex / --without-speex as argument to configure
########################################################
have_speex=check
want_speex=check
path_speex=undef
AC_SUBST(LIBSPEEX_LIBADD, "")
AC_ARG_WITH(speex,
[ --with-speex Link against libspeex library],
[AC_DEFINE_UNQUOTED(HAVE_LIB_SPEEX, 1, HAVE_LIB_SPEEX)
AC_SUBST(LIBSPEEX_LIBADD, "-lspeex")
AM_CONDITIONAL(USE_SPEEX, true)],
[ AC_SUBST(LIBSPEEX_LIBADD, "")])
[ --with-speex=PATH Build with SPEEX audio codec. PATH is optional.],
if test "x$withval" = "xyes"; then
want_speex=yes
path_speex=undef
elif test "x$withval" = "xno"; then
want_speex=no
path_speex=undef
elif test "$withval"; then
want_speex=yes
path_speex=$withval
fi,
)
# only if --without-speex not used
if test $want_speex != no; then
# check lib and headers
AC_CHECK_HEADERS(speex/speex.h,
AC_CHECK_LIB(speex, speex_decode_int, AC_DEFINE_UNQUOTED(HAVE_LIB_SPEEX, 1, HAVE_LIB_SPEEX) [have_speex=yes] LIBSPEEX_LIBADD="-lspeex",
AC_DEFINE_UNQUOTED(HAVE_LIB_SPEEX, 0, HAVE_LIB_SPEEX) [have_speex=no]
))
# if speex not found and requested then, die.
test $have_speex:$want_speex = no:yes &&
AC_MSG_ERROR([You requested SPEEX audio codec but not found...die])
fi
AM_CONDITIONAL([USE_SPEEX], [test $have_speex = yes])
AM_CONDITIONAL(USE_SPEEXDSP, false)
########################################################
# SPEEXDSP
# --with-speexdsp / --without-speexdsp as argument to configure
########################################################
have_speexdsp=check
want_speexdsp=check
path_speexdsp=undef
AC_SUBST(LIBSPEEXDSP_LIBADD, "")
AC_ARG_WITH(speexdsp,
[ --with-speexdsp Link against libspeexdsp library],
[AC_DEFINE_UNQUOTED(HAVE_SPEEX_DSP, 1, HAVE_SPEEX_DSP)
AC_SUBST(LIBSPEEXDSP_LIBADD, "-lspeexdsp")
AM_CONDITIONAL(USE_SPEEXDSP, true)],
[ AC_SUBST(LIBSPEEXDSP_LIBADD, "")])
AC_ARG_ENABLE(speexresampler,
[ --enable-speexresampler Enable SPEEX RESAMPLER support (requires libspeexdsp)],
[AC_DEFINE_UNQUOTED(HAVE_SPEEX_RESAMPLER, 1, HAVE_SPEEX_RESAMPLER)], )
AC_ARG_ENABLE(speexjb,
[ --enable-speexjb Enable SPEEX JB support (requires libspeexdsp)],
[AC_DEFINE_UNQUOTED(HAVE_SPEEX_JB, 1, HAVE_SPEEX_JB)], )
AC_ARG_ENABLE(speexdenoiser,
[ --enable-speexdenoiser Enable SPEEX DENOISER support (requires libspeexdsp)],
[AC_DEFINE_UNQUOTED(HAVE_SPEEX_DENOISE, 1, HAVE_SPEEX_DENOISE)], )
[ --with-speexdsp=PATH Build with SPEEX DSP (audio resampler, jitter buffer...). PATH is optional.],
if test "x$withval" = "xyes"; then
want_speexdsp=yes
path_speexdsp=undef
elif test "x$withval" = "xno"; then
want_speexdsp=no
path_speexdsp=undef
elif test "$withval"; then
want_speexdsp=yes
path_speexdsp=$withval
fi,
)
# only if --without-speexdsp not used
if test $want_speexdsp != no; then
# check main lib
AC_CHECK_HEADERS(speex/speex_preprocess.h,
AC_CHECK_LIB(speexdsp, speex_preprocess_state_init, AC_DEFINE_UNQUOTED(HAVE_SPEEX_DSP, 1, HAVE_SPEEX_DSP) [have_speexdsp=yes] LIBSPEEXDSP_LIBADD="-lspeexdsp",
AC_DEFINE_UNQUOTED(HAVE_SPEEX_DSP, 0, HAVE_SPEEX_DSP) [have_speexdsp=no])
)
# check for jitter buffer
AC_CHECK_HEADERS(speex/speex_jitter.h,
AC_CHECK_LIB(speexdsp, jitter_buffer_init, AC_DEFINE_UNQUOTED(HAVE_SPEEX_JB, 1, HAVE_SPEEX_JB),
AC_DEFINE_UNQUOTED(HAVE_SPEEX_JB, 0, HAVE_SPEEX_JB))
)
# check for resampler
AC_CHECK_HEADERS(speex/speex_resampler.h,
AC_CHECK_LIB(speexdsp, speex_resampler_init, AC_DEFINE_UNQUOTED(HAVE_SPEEX_RESAMPLER, 1, HAVE_SPEEX_RESAMPLER),
AC_DEFINE_UNQUOTED(HAVE_SPEEX_RESAMPLER, 0, HAVE_SPEEX_RESAMPLER))
)
# check for denoiser and echo canceler
AC_CHECK_HEADERS(speex/speex_echo.h,
AC_CHECK_LIB(speexdsp, speex_echo_playback, AC_DEFINE_UNQUOTED(HAVE_SPEEX_DENOISE, 1, HAVE_SPEEX_DENOISE),
AC_DEFINE_UNQUOTED(HAVE_SPEEX_DENOISE, 0, HAVE_SPEEX_DENOISE))
)
# if speex not found and requested then, die.
test $have_speexdsp:$want_speexdsp = no:yes &&
AC_MSG_ERROR([You requested SPEEX DSP but not found...die])
fi
AM_CONDITIONAL([USE_SPEEXDSP], [test $have_speexdsp = yes])
# Deprecated options: to be removed
AC_ARG_ENABLE(speexresampler, [ --enable-speexresampler IMPORTANT: deprecated to be removed], , )
AC_ARG_ENABLE(speexdenoiser, [ --enable-speexdenoiser IMPORTANT: deprecated to be removed], , )
AC_ARG_ENABLE(speexjb, [ --enable-speexjb IMPORTANT: deprecated to be removed], , )
AM_CONDITIONAL(USE_GSM, false)
########################################################
# GSM
# --with-gsm / --without-gsm as argument to configure
########################################################
have_gsm=check
want_gsm=check
path_gsm=undef
AC_SUBST(LIBGSM_LIBADD, "")
AC_ARG_WITH(gsm,
[ --with-gsm Link against libgsm library],
[AC_DEFINE_UNQUOTED(HAVE_LIBGSM, 1, HAVE_LIBGSM)
AC_SUBST(LIBGSM_LIBADD, "-lgsm")
AM_CONDITIONAL(USE_GSM, true)],
[ AC_SUBST(LIBGSM_LIBADD, "")])
[ --with-gsm=PATH Build with GSM audio codec. PATH is optional.],
if test "x$withval" = "xyes"; then
want_gsm=yes
path_gsm=undef
elif test "x$withval" = "xno"; then
want_gsm=no
path_gsm=undef
elif test "$withval"; then
want_gsm=yes
path_gsm=$withval
fi,
)
# only if --without-gsm not used
if test $want_gsm != no; then
# check lib and headers
AC_CHECK_HEADERS(gsm.h,
AC_CHECK_LIB(gsm, gsm_create, AC_DEFINE_UNQUOTED(HAVE_LIBGSM, 1, HAVE_LIBGSM) [have_gsm=yes] LIBGSM_LIBADD="-lgsm",
AC_DEFINE_UNQUOTED(HAVE_LIBGSM, 0, HAVE_LIBGSM) [have_gsm=no]
))
# if gsm not found and requested then, die.
test $have_gsm:$want_gsm = no:yes &&
AC_MSG_ERROR([You requested GSM audio codec but not found...die])
fi
AM_CONDITIONAL([USE_GSM], [test $have_gsm = yes])
AM_CONDITIONAL(USE_G729, false)
########################################################
# G729
# --with-g729 / --without-g729 as argument to configure
########################################################
have_g729=check
want_g729=check
path_g729=undef
AC_SUBST(LIBG729_LIBADD, "")
AC_ARG_WITH(g729,
[ --with-g729 Link against libg729b library],
[AC_DEFINE_UNQUOTED(HAVE_G729, 1, HAVE_G729)
AC_SUBST(LIBG729_LIBADD, "-lg729b")
AM_CONDITIONAL(USE_G729, true)],
[ AC_SUBST(LIBG729_LIBADD, "")])
[ --with-g729=PATH Build with G.729 audio codec. PATH is optional.],
if test "x$withval" = "xyes"; then
want_g729=yes
path_g729=undef
elif test "x$withval" = "xno"; then
want_g729=no
path_g729=undef
elif test "$withval"; then
want_g729=yes
path_g729=$withval
fi,
)
# only if --without-g729 not used
if test $want_g729 != no; then
# check lib and headers
AC_CHECK_HEADERS(g729b/typedef.h g729b/ld8a.h,
AC_CHECK_LIB(g729b, Init_Decod_ld8a, AC_DEFINE_UNQUOTED(HAVE_G729, 1, HAVE_G729) [have_g729=yes] LIBG729_LIBADD="-lg729b",
AC_DEFINE_UNQUOTED(HAVE_G729, 0, HAVE_G729) [have_g729=no]), [],
[[#ifdef HAVE_G729B_TYPEDEF_H
# include <g729b/typedef.h>
#endif
]])
# if g729 not found and requested then, die.
test $have_g729:$want_g729 = no:yes &&
AC_MSG_ERROR([You requested G729 audio codec but not found...die])
fi
AM_CONDITIONAL([USE_G729], [test $have_g729 = yes])
AM_CONDITIONAL(USE_ILBC, false)
########################################################
# ILBC
# --with-ilbc / --without-ilbc as argument to configure
########################################################
have_ilbc=check
want_ilbc=check
path_ilbc=undef
AC_SUBST(LIBILBC_LIBADD, "")
AC_ARG_WITH(ilbc,
[ --with-ilbc Link against libiLBC library],
[AC_DEFINE_UNQUOTED(HAVE_ILBC, 1, HAVE_ILBC)
AC_SUBST(LIBILBC_LIBADD, "-liLBC")
AM_CONDITIONAL(USE_ILBC, true)],
[ AC_SUBST(LIBILBC_LIBADD, "")])
[ --with-ilbc=PATH Build with ILBC audio codec. PATH is optional.],
if test "x$withval" = "xyes"; then
want_ilbc=yes
path_ilbc=undef
elif test "x$withval" = "xno"; then
want_ilbc=no
path_ilbc=undef
elif test "$withval"; then
want_ilbc=yes
path_ilbc=$withval
fi,
)
# only if --without-ilbc not used
if test $want_ilbc != no; then
# check lib and headers
AC_CHECK_HEADERS(ilbc/iLBC_define.h ilbc/iLBC_encode.h ilbc/iLBC_decode.h,
AC_CHECK_LIB(iLBC, initDecode, AC_DEFINE_UNQUOTED(HAVE_ILBC, 1, HAVE_ILBC) [have_ilbc=yes] LIBILBC_LIBADD="-liLBC",
AC_DEFINE_UNQUOTED(HAVE_ILBC, 0, HAVE_ILBC) [have_ilbc=no], [-lm]
))
# if gsm not found and requested then, die.
test $have_ilbc:$want_ilbc = no:yes &&
AC_MSG_ERROR([You requested ILBC audio codec but not found...die])
fi
AM_CONDITIONAL([USE_ILBC], [test $have_ilbc = yes])
AC_OUTPUT(
AC_CONFIG_FILES(
Makefile
doubango.pc
tinySAK/Makefile
tinySAK/tinySAK.pc
tinyNET/Makefile
tinyNET/tinyNET.pc
tinyHTTP/Makefile
tinyHTTP/tinyHTTP.pc
tinyXCAP/Makefile
tinyXCAP/tinyXCAP.pc
tinyIPSec/Makefile
tinyIPSec/tinyIPSec.pc
tinySMS/Makefile
tinySMS/tinySMS.pc
tinySIGCOMP/Makefile
tinySIGCOMP/tinySIGCOMP.pc
tinySDP/Makefile
tinySDP/tinySDP.pc
tinyRTP/Makefile
tinyRTP/tinyRTP.pc
tinyMSRP/Makefile
tinyMSRP/tinyMSRP.pc
tinyMEDIA/Makefile
tinyMEDIA/tinyMEDIA.pc
tinyDAV/Makefile
tinyDAV/tinyDAV.pc
tinySIP/Makefile
)
tinySIP/tinySIP.pc
)
AC_OUTPUT
AC_MSG_NOTICE([
**************************************************************************
* CONGRATULATIONS
**************************************************************************
Host setup: ${host}
Install prefix: ${prefix}
Compiler: ${CC}
FFmpeg: $have_ffmpeg
VP8 video codec: $have_vpx
OPUS audio codec: $have_opus
ILBC audio codec: $have_ilbc
G.729 audio codec: $have_g729
GSM audio codec: $have_gsm
AMR audio codec: $have_amr
SPEEX audio codec: $have_speex
G.722 audio codec: yes
G.711 audio codec: yes
YUV: $have_yuv
SPEEX DSP: $have_speexdsp
SSL: $have_ssl
DTLS-SRTP: $have_dtls_srtp
DTLS: $have_dtls
SRTP: $have_srtp
Monotonic timers: $have_rt
RESOLV: $have_resolv
DEBUG: $debug_default
Report any issue at https://groups.google.com/group/doubango
])

View File

@ -0,0 +1,15 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libdoubango
Description : Doubango Telecom VoIP framework
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@ tinyNET = @PACKAGE_VERSION@ tinyDAV = @PACKAGE_VERSION@ tinyHTTP = @PACKAGE_VERSION@ tinyIPSec = @PACKAGE_VERSION@ tinyMEDIA = @PACKAGE_VERSION@ tinyMSRP = @PACKAGE_VERSION@ tinyRTP = @PACKAGE_VERSION@ tinySDP = @PACKAGE_VERSION@ tinySIGCOMP = @PACKAGE_VERSION@ tinySIP = @PACKAGE_VERSION@ tinySMS = @PACKAGE_VERSION@ tinyXCAP = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir} -I${includedir}/tinydav
Libs : -L${libdir} -ltinySAK
Libs.private: @LIBFFMPEG_LIBADD@ @LIBH264_LIBADD@ @LIBVPX_LIBADD@ @LIBOPUS_LIBADD@ @LIBAMR_LIBADD@ @LIBSPEEX_LIBADD@ @LIBSPEEXDSP_LIBADD@ @LIBGSM_LIBADD@ @LIBG729_LIBADD@ @LIBILBC_LIBADD@

View File

@ -28,8 +28,8 @@ libtinyDAV_la_LIBADD += ${LIBVPX_LIBADD}
endif
if USE_YUV
libtinyDAV_la_LIBADD += -lyuv
libtinyDAV_la_CPPFLAGS += -I${LIBYUV_INCLUDE} -I${LIBYUV_INCLUDE}/libyuv
libtinyDAV_la_LIBADD += ${LIBYUV_LIB}
libtinyDAV_la_CPPFLAGS += ${LIBYUV_INCLUDE} ${LIBYUV_INCLUDE}/libyuv
endif
if USE_OPUS
@ -144,3 +144,7 @@ audio_includedir = $(includedir)/tinydav/tinydav/audio
audio_include_HEADERS = include/tinydav/audio/*.h
video_includedir = $(includedir)/tinydav/tinydav/video
video_include_HEADERS = include/tinydav/video/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinyDAV.pc

View File

@ -51,7 +51,7 @@ typedef struct tdav_speex_denoise_s
SpeexEchoState *echo_state;
spx_int16_t* echo_output_frame;
uint32_t frame_size;
uint32_t frame_size_samples, frame_size_bytes;
}
tdav_speex_denoise_t;

View File

@ -95,7 +95,7 @@ typedef struct tdav_webrtc_denoise_s
uint32_t echo_tail;
uint32_t echo_skew;
uint32_t frame_size;
uint32_t frame_size_samples;
uint32_t sampling_rate;
WebRtc_Word16 *temp_rec_out;

View File

@ -76,6 +76,9 @@ typedef struct tdav_codec_h261_s
tdav_codec_h261_t;
TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h261_plugin_def_t;
tsk_bool_t tdav_codec_ffmpeg_h261_is_supported();
TDAV_END_DECLS

View File

@ -44,6 +44,10 @@ TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h263_plugin_def_t;
TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h263p_plugin_def_t;
TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h263pp_plugin_def_t;
tsk_bool_t tdav_codec_ffmpeg_h263_is_supported();
tsk_bool_t tdav_codec_ffmpeg_h263p_is_supported();
tsk_bool_t tdav_codec_ffmpeg_h263pp_is_supported();
TDAV_END_DECLS

View File

@ -32,7 +32,7 @@
#include "tinydav_config.h"
#if (HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)) || HAVE_H264_PASSTHROUGH
#if HAVE_FFMPEG || HAVE_H264_PASSTHROUGH
#include "tinydav/codecs/h264/tdav_codec_h264_common.h"
@ -41,6 +41,8 @@ TDAV_BEGIN_DECLS
TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h264_base_plugin_def_t;
TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h264_main_plugin_def_t;
tsk_bool_t tdav_codec_ffmpeg_h264_is_supported();
static inline tsk_bool_t tdav_codec_h264_is_ffmpeg_plugin(const tmedia_codec_plugin_def_t *plugin)
{
return(plugin && ((plugin == tdav_codec_h264_base_plugin_def_t) || (plugin == tdav_codec_h264_main_plugin_def_t)));
@ -50,4 +52,4 @@ TDAV_END_DECLS
#endif /* HAVE_FFMPEG || HAVE_H264_PASSTHROUGH */
#endif /* TINYDAV_CODEC_H264_H */
#endif /* TINYDAV_CODEC_H264_H */

View File

@ -99,8 +99,8 @@ static const tdav_codec_h264_common_level_size_xt tdav_codec_h264_common_level_s
{level_idc_4_0, 2048, 1024},
{level_idc_4_1, 2048, 1024},
{level_idc_4_2, 2048, 1080},
{level_idc_5_0, 20560, 1920},
{level_idc_5_1, 4096, 2048},
{level_idc_5_0, 2560, 1920},
{level_idc_5_1, 3840, 2160},
{level_idc_5_2, 4096, 2048}
};

View File

@ -42,6 +42,8 @@ TDAV_BEGIN_DECLS
TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_mp4ves_plugin_def_t;
tsk_bool_t tdav_codec_ffmpeg_mp4ves_is_supported();
TDAV_END_DECLS
#endif /* HAVE_FFMPEG */

View File

@ -33,12 +33,14 @@
#include "tinydav_config.h"
#if HAVE_FFMPEG && (!defined(HAVE_THEORA) || HAVE_THEORA)
#if HAVE_FFMPEG
#include "tinymedia/tmedia_codec.h"
TDAV_BEGIN_DECLS
tsk_bool_t tdav_codec_ffmpeg_theora_is_supported();
TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_theora_plugin_def_t;
TDAV_END_DECLS

View File

@ -35,12 +35,6 @@
#include "tinymedia/tmedia_codec.h"
#define VPX_CODEC_DISABLE_COMPAT 1 /* strict compliance with the latest SDK by disabling some backwards compatibility */
#include <vpx/vpx_encoder.h>
#include <vpx/vpx_decoder.h>
#include <vpx/vp8cx.h>
#include <vpx/vp8dx.h>
TDAV_BEGIN_DECLS
TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_vp8_plugin_def_t;

View File

@ -57,8 +57,9 @@ typedef struct tdav_session_av_s
tmedia_srtp_type_t srtp_type;
tmedia_srtp_mode_t srtp_mode;
int32_t bandwidth_max_upload;
int32_t bandwidth_max_download;
int32_t bandwidth_max_upload_kbps;
int32_t bandwidth_max_download_kbps;
tsk_bool_t congestion_ctrl_enabled;
/* sdp capabilities (RFC 5939) */
struct tdav_sdp_caps_s* sdp_caps;

View File

@ -45,6 +45,7 @@ typedef enum tdav_video_jb_cb_data_type_e
tdav_video_jb_cb_data_type_fl, // frame lost
tdav_video_jb_cb_data_type_tmfr, // too many frames removed
tdav_video_jb_cb_data_type_fdd, // average frame decoding duration
tdav_video_jb_cb_data_type_fps_changed, // fps changed, detection done using the timestamp
}
tdav_video_jb_cb_data_type_t;
@ -65,6 +66,10 @@ typedef struct tdav_video_jb_cb_data_xs
uint32_t x_dur; // expected duration in milliseconds
uint32_t a_dur; // actual duration in milliseconds
}fdd;
struct{
uint32_t old;
uint32_t new;
}fps;
};
}
tdav_video_jb_cb_data_xt;

View File

@ -50,6 +50,7 @@ typedef struct tdav_session_video_s
struct tdav_video_jb_s* jb;
tsk_bool_t jb_enabled;
tsk_bool_t zero_artifacts;
tsk_bool_t fps_changed;
struct{
const void* context;
@ -92,8 +93,9 @@ typedef struct tdav_session_video_s
uint64_t stream_corrupted_since;
uint32_t last_corrupted_timestamp;
uint8_t payload_type;
struct tmedia_codec_s* codec;
uint8_t codec_payload_type;
struct tmedia_codec_s* codec;
uint64_t codec_decoded_frames_count;
} decoder;
struct {

View File

@ -138,7 +138,8 @@ int tdav_consumer_audio_put(tdav_consumer_audio_t* self, const void* data, tsk_s
tsk_safeobj_lock(self);
if(!TMEDIA_JITTER_BUFFER(self->jitterbuffer)->opened){
if((ret = tmedia_jitterbuffer_open(self->jitterbuffer, TMEDIA_CONSUMER(self)->audio.ptime, TMEDIA_CONSUMER(self)->audio.in.rate))){
uint32_t rate = TMEDIA_CONSUMER(self)->audio.out.rate ? TMEDIA_CONSUMER(self)->audio.out.rate : TMEDIA_CONSUMER(self)->audio.in.rate;
if((ret = tmedia_jitterbuffer_open(self->jitterbuffer, TMEDIA_CONSUMER(self)->audio.ptime, rate))){
TSK_DEBUG_ERROR("Failed to open jitterbuffer (%d)", ret);
tsk_safeobj_unlock(self);
return ret;
@ -175,22 +176,26 @@ tsk_size_t tdav_consumer_audio_get(tdav_consumer_audio_t* self, void* out_data,
}
ret_size = tmedia_jitterbuffer_get(TMEDIA_JITTER_BUFFER(self->jitterbuffer), out_data, out_size);
tsk_safeobj_unlock(self);
// Echo process last frame
if(self->denoise && self->denoise->opened && TSK_BUFFER_SIZE(self->denoise->last_frame)){
tmedia_denoise_echo_playback(self->denoise, TSK_BUFFER_DATA(self->denoise->last_frame));
}
tsk_safeobj_unlock(self);
// denoiser
if(ret_size && self->denoise && self->denoise->opened){
if((self->denoise->echo_supp_enabled || self->denoise->noise_supp_enabled) && self->denoise && self->denoise->opened){
if(self->denoise->echo_supp_enabled){
// echo playback
tsk_buffer_copy(self->denoise->last_frame, 0, out_data, ret_size);
// Echo process last frame
if(self->denoise->last_frame && self->denoise->last_frame->size){
tmedia_denoise_echo_playback(self->denoise, self->denoise->last_frame->data, self->denoise->last_frame->size);
}
if(ret_size){
// save
tsk_buffer_copy(self->denoise->last_frame, 0, out_data, ret_size);
}
}
#if 1 // suppress noise if not supported by remote party's encoder
// suppress noise
tmedia_denoise_process_playback(self->denoise, out_data);
if(self->denoise->noise_supp_enabled){
tmedia_denoise_process_playback(self->denoise, out_data, out_size);
}
#endif
}

View File

@ -231,7 +231,7 @@ static int tdav_session_audio_producer_enc_cb(const void* callback_data, const v
if(audio->denoise){
tsk_bool_t silence_or_noise = tsk_false;
if(audio->denoise->echo_supp_enabled ){
ret = tmedia_denoise_process_record(TMEDIA_DENOISE(audio->denoise), (void*)buffer, &silence_or_noise);
ret = tmedia_denoise_process_record(TMEDIA_DENOISE(audio->denoise), (void*)buffer, size, &silence_or_noise);
}
}
// adjust the gain

View File

@ -57,7 +57,7 @@ static int tdav_speex_denoise_set(tmedia_denoise_t* _self, const tmedia_param_t*
return -1;
}
static int tdav_speex_denoise_open(tmedia_denoise_t* self, uint32_t frame_size, uint32_t sampling_rate)
static int tdav_speex_denoise_open(tmedia_denoise_t* self, uint32_t frame_size_samples, uint32_t sampling_rate)
{
tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
float f;
@ -65,17 +65,18 @@ static int tdav_speex_denoise_open(tmedia_denoise_t* self, uint32_t frame_size,
if(!denoiser->echo_state && TMEDIA_DENOISE(denoiser)->echo_supp_enabled){
TSK_DEBUG_INFO("Init Aec frame_size[%u] filter_length[%u] SampleRate[%u]",
(uint32_t)(frame_size* sizeof(spx_int16_t)),TMEDIA_DENOISE(denoiser)->echo_tail*frame_size,sampling_rate);
if((denoiser->echo_state = speex_echo_state_init(frame_size, TMEDIA_DENOISE(denoiser)->echo_tail))){
(uint32_t)(frame_size_samples),TMEDIA_DENOISE(denoiser)->echo_tail*frame_size_samples,sampling_rate);
if((denoiser->echo_state = speex_echo_state_init(frame_size_samples, TMEDIA_DENOISE(denoiser)->echo_tail))){
speex_echo_ctl(denoiser->echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &sampling_rate);
}
}
if(!denoiser->preprocess_state_record && !denoiser->preprocess_state_playback){
denoiser->frame_size = frame_size;
denoiser->frame_size_samples = frame_size_samples;
denoiser->frame_size_bytes = (frame_size_samples << 1);
if((denoiser->preprocess_state_record = speex_preprocess_state_init(frame_size, sampling_rate))
&& (denoiser->preprocess_state_playback = speex_preprocess_state_init(frame_size, sampling_rate))
if((denoiser->preprocess_state_record = speex_preprocess_state_init(frame_size_samples, sampling_rate))
&& (denoiser->preprocess_state_playback = speex_preprocess_state_init(frame_size_samples, sampling_rate))
){
// Echo suppression
@ -85,7 +86,7 @@ static int tdav_speex_denoise_open(tmedia_denoise_t* self, uint32_t frame_size,
speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_SET_ECHO_STATE, denoiser->echo_state);
TSK_FREE(denoiser->echo_output_frame);
denoiser->echo_output_frame = tsk_calloc(denoiser->frame_size, sizeof(spx_int16_t));
denoiser->echo_output_frame = tsk_calloc(denoiser->frame_size_samples, sizeof(spx_int16_t));
speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS , &echo_supp );
speex_preprocess_ctl(denoiser->preprocess_state_record, SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE , &echo_supp_active );
@ -146,9 +147,15 @@ static int tdav_speex_denoise_open(tmedia_denoise_t* self, uint32_t frame_size,
return 0;
}
static int tdav_speex_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame)
static int tdav_speex_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes)
{
tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
if(denoiser->frame_size_bytes != echo_frame_size_bytes){
TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->frame_size_bytes, echo_frame_size_bytes);
return -1;
}
if(denoiser->echo_state){
speex_echo_playback(denoiser->echo_state, echo_frame);
}
@ -157,15 +164,20 @@ static int tdav_speex_denoise_echo_playback(tmedia_denoise_t* self, const void*
static int tdav_speex_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, tsk_bool_t* silence_or_noise)
static int tdav_speex_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise)
{
tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
int vad;
if(denoiser->frame_size_bytes != audio_frame_size_bytes){
TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->frame_size_bytes, audio_frame_size_bytes);
return -1;
}
if(denoiser->preprocess_state_record){
if(denoiser->echo_state && denoiser->echo_output_frame){
speex_echo_capture(denoiser->echo_state, audio_frame, denoiser->echo_output_frame);
memcpy(audio_frame, denoiser->echo_output_frame, denoiser->frame_size*sizeof(spx_int16_t));
memcpy(audio_frame, denoiser->echo_output_frame, denoiser->frame_size_bytes);
}
vad = speex_preprocess_run(denoiser->preprocess_state_record, audio_frame);
if(!vad && TMEDIA_DENOISE(denoiser)->vad_enabled){
@ -176,10 +188,15 @@ static int tdav_speex_denoise_process_record(tmedia_denoise_t* self, void* audio
return 0;
}
static int tdav_speex_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame)
static int tdav_speex_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes)
{
tdav_speex_denoise_t *denoiser = (tdav_speex_denoise_t *)self;
if(denoiser->frame_size_bytes != audio_frame_size_bytes){
TSK_DEBUG_ERROR("Size mismatch: %u<>%u", denoiser->frame_size_bytes, audio_frame_size_bytes);
return -1;
}
if(denoiser->preprocess_state_playback){
speex_preprocess_run(denoiser->preprocess_state_playback, audio_frame);
}
@ -245,6 +262,8 @@ static tsk_object_t* tdav_speex_denoise_dtor(tsk_object_t * self)
denoise->echo_state = tsk_null;
}
TSK_FREE(denoise->echo_output_frame);
TSK_DEBUG_INFO("*** SpeexDSP denoiser destroyed ***");
}
return self;

View File

@ -49,6 +49,8 @@ static int tdav_speex_jitterbuffer_open(tmedia_jitterbuffer_t* self, uint32_t fr
tdav_speex_jitterbuffer_t *jitterbuffer = (tdav_speex_jitterbuffer_t *)self;
spx_int32_t tmp;
TSK_DEBUG_INFO("Open speex jb (ptime=%u, rate=%u)", frame_duration, rate);
if(!(jitterbuffer->state = jitter_buffer_init((int)frame_duration))){
TSK_DEBUG_ERROR("jitter_buffer_init() failed");
return -2;
@ -237,6 +239,8 @@ static tsk_object_t* tdav_speex_jitterbuffer_dtor(tsk_object_t * self)
jb->state = tsk_null;
}
TSK_FREE(jb->buff.ptr);
TSK_DEBUG_INFO("*** SpeexDSP jb destroyed ***");
}
return self;

View File

@ -35,11 +35,11 @@
#define TDAV_SPEEX_RESAMPLER_MAX_QUALITY 10
int tdav_speex_resampler_open(tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality)
static int tdav_speex_resampler_open(tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality)
{
tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
int ret = 0;
if(in_channels != 1 && in_channels != 2){
TSK_DEBUG_ERROR("%d not valid as input channel", in_channels);
return -1;
@ -70,7 +70,7 @@ int tdav_speex_resampler_open(tmedia_resampler_t* self, uint32_t in_freq, uint32
return 0;
}
tsk_size_t tdav_speex_resampler_process(tmedia_resampler_t* self, const uint16_t* in_data, tsk_size_t in_size, uint16_t* out_data, tsk_size_t out_size)
static tsk_size_t tdav_speex_resampler_process(tmedia_resampler_t* self, const uint16_t* in_data, tsk_size_t in_size, uint16_t* out_data, tsk_size_t out_size)
{
tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
spx_uint32_t out_len = (spx_uint32_t)out_size;
@ -112,7 +112,10 @@ tsk_size_t tdav_speex_resampler_process(tmedia_resampler_t* self, const uint16_t
}
}
else{
err = speex_resampler_process_int(resampler->state, 0, (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size, (spx_int16_t *)out_data, &out_len);
err = speex_resampler_process_interleaved_int(resampler->state,
(const spx_int16_t *)in_data, (spx_uint32_t *)&in_size,
(spx_int16_t *)out_data, &out_len);
// err = speex_resampler_process_int(resampler->state, 0, (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size, (spx_int16_t *)out_data, &out_len);
}
if(err != RESAMPLER_ERR_SUCCESS){
@ -122,7 +125,7 @@ tsk_size_t tdav_speex_resampler_process(tmedia_resampler_t* self, const uint16_t
return (tsk_size_t)out_len;
}
int tdav_speex_resampler_close(tmedia_resampler_t* self)
static int tdav_speex_resampler_close(tmedia_resampler_t* self)
{
tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
@ -163,6 +166,8 @@ static tsk_object_t* tdav_speex_resampler_dtor(tsk_object_t * self)
resampler->state = tsk_null;
}
TSK_FREE(resampler->tmp_buffer.ptr);
TSK_DEBUG_INFO("*** SpeexDSP resampler (plugin) destroyed ***");
}
return self;

View File

@ -69,7 +69,7 @@ static int tdav_webrtc_denoise_set(tmedia_denoise_t* _self, const tmedia_param_t
return -1;
}
static int tdav_webrtc_denoise_open(tmedia_denoise_t* self, uint32_t frame_size, uint32_t sampling_rate)
static int tdav_webrtc_denoise_open(tmedia_denoise_t* self, uint32_t frame_size_samples, uint32_t sampling_rate)
{
tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
int ret;
@ -93,7 +93,7 @@ static int tdav_webrtc_denoise_open(tmedia_denoise_t* self, uint32_t frame_size,
denoiser->echo_tail = TSK_CLAMP(WEBRTC_MIN_ECHO_TAIL, TMEDIA_DENOISE(denoiser)->echo_tail, WEBRTC_MAX_ECHO_TAIL);
TSK_DEBUG_INFO("echo_tail=%d", denoiser->echo_tail);
denoiser->echo_skew = TMEDIA_DENOISE(denoiser)->echo_skew;
denoiser->frame_size = frame_size;
denoiser->frame_size_samples = frame_size_samples;
denoiser->sampling_rate = sampling_rate;
//
@ -127,7 +127,7 @@ static int tdav_webrtc_denoise_open(tmedia_denoise_t* self, uint32_t frame_size,
//
if(TMEDIA_DENOISE(denoiser)->noise_supp_enabled){
#if HAVE_SPEEX_DSP && PREFER_SPEEX_DENOISER
if((denoiser->SpeexDenoiser_proc = speex_preprocess_state_init(denoiser->frame_size, denoiser->sampling_rate))){
if((denoiser->SpeexDenoiser_proc = speex_preprocess_state_init(denoiser->frame_size_samples, denoiser->sampling_rate))){
int i = 1;
speex_preprocess_ctl(denoiser->SpeexDenoiser_proc, SPEEX_PREPROCESS_SET_DENOISE, &i);
i = TMEDIA_DENOISE(denoiser)->noise_supp_level;
@ -146,7 +146,7 @@ static int tdav_webrtc_denoise_open(tmedia_denoise_t* self, uint32_t frame_size,
}
// allocate temp buffer for record processing
if(!(denoiser->temp_rec_out = tsk_realloc(denoiser->temp_rec_out, denoiser->frame_size * kSizeOfWord16))){
if(!(denoiser->temp_rec_out = tsk_realloc(denoiser->temp_rec_out, denoiser->frame_size_samples * kSizeOfWord16))){
TSK_DEBUG_ERROR("Failed to allocate new buffer");
return -3;
}
@ -156,7 +156,7 @@ static int tdav_webrtc_denoise_open(tmedia_denoise_t* self, uint32_t frame_size,
return ret;
}
static int tdav_webrtc_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame)
static int tdav_webrtc_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes)
{
tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
if(denoiser->AEC_inst){
@ -165,7 +165,7 @@ static int tdav_webrtc_denoise_echo_playback(tmedia_denoise_t* self, const void*
switch(denoiser->sampling_rate){
case 8000:
{
if((ret = TDAV_WebRtcAec_BufferFarend(denoiser->AEC_inst, pEchoFrame, denoiser->frame_size))){
if((ret = TDAV_WebRtcAec_BufferFarend(denoiser->AEC_inst, pEchoFrame, denoiser->frame_size_samples))){
TSK_DEBUG_ERROR("WebRtcAec_BufferFarend failed with error code = %d", ret);
return ret;
}
@ -176,8 +176,8 @@ static int tdav_webrtc_denoise_echo_playback(tmedia_denoise_t* self, const void*
{
// Split in several 160 samples
uint32_t i, k = (denoiser->sampling_rate == 16000 ? 1 : 2);
for(i = 0; i<denoiser->frame_size; i+=(denoiser->frame_size>>k)){
if((ret = TDAV_WebRtcAec_BufferFarend(denoiser->AEC_inst, &pEchoFrame[i], (denoiser->frame_size>>k)))){
for(i = 0; i<denoiser->frame_size_samples; i+=(denoiser->frame_size_samples>>k)){
if((ret = TDAV_WebRtcAec_BufferFarend(denoiser->AEC_inst, &pEchoFrame[i], (denoiser->frame_size_samples>>k)))){
TSK_DEBUG_ERROR("WebRtcAec_BufferFarend failed with error code = %d", ret);
return ret;
}
@ -196,7 +196,7 @@ static int tdav_webrtc_denoise_echo_playback(tmedia_denoise_t* self, const void*
static int tdav_webrtc_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, tsk_bool_t* silence_or_noise)
static int tdav_webrtc_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise)
{
tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;
int ret = 0;
@ -213,7 +213,7 @@ static int tdav_webrtc_denoise_process_record(tmedia_denoise_t* self, void* audi
if(denoiser->SpeexDenoiser_proc){
speex_preprocess_run(denoiser->SpeexDenoiser_proc, pAudioFrame);
}
memcpy(denoiser->temp_rec_out, pAudioFrame, denoiser->frame_size * sizeof(spx_int16_t));
memcpy(denoiser->temp_rec_out, pAudioFrame, denoiser->frame_size_samples * sizeof(spx_int16_t));
#else
// WebRTC NoiseSupp only accept 10ms frames
@ -237,7 +237,7 @@ static int tdav_webrtc_denoise_process_record(tmedia_denoise_t* self, void* audi
switch(denoiser->sampling_rate){
case 8000:
{
if((ret = TDAV_WebRtcAec_Process(denoiser->AEC_inst, denoiser->temp_rec_out, tsk_null, pAudioFrame, tsk_null, denoiser->frame_size, denoiser->echo_tail, denoiser->echo_skew))){
if((ret = TDAV_WebRtcAec_Process(denoiser->AEC_inst, denoiser->temp_rec_out, tsk_null, pAudioFrame, tsk_null, denoiser->frame_size_samples, denoiser->echo_tail, denoiser->echo_skew))){
TSK_DEBUG_ERROR("WebRtcAec_Process with error code = %d", ret);
goto bail;
}
@ -248,8 +248,8 @@ static int tdav_webrtc_denoise_process_record(tmedia_denoise_t* self, void* audi
{
// Split in several 160 samples
uint32_t i, k = (denoiser->sampling_rate == 16000 ? 1 : 2);
for(i = 0; i<denoiser->frame_size; i+=(denoiser->frame_size>>k)){
if((ret = TDAV_WebRtcAec_Process(denoiser->AEC_inst, &denoiser->temp_rec_out[i], tsk_null, &pAudioFrame[i], tsk_null, (denoiser->frame_size>>k), denoiser->echo_tail, denoiser->echo_skew))){
for(i = 0; i<denoiser->frame_size_samples; i+=(denoiser->frame_size_samples>>k)){
if((ret = TDAV_WebRtcAec_Process(denoiser->AEC_inst, &denoiser->temp_rec_out[i], tsk_null, &pAudioFrame[i], tsk_null, (denoiser->frame_size_samples>>k), denoiser->echo_tail, denoiser->echo_skew))){
TSK_DEBUG_ERROR("WebRtcAec_Process with error code = %d", ret);
goto bail;
}
@ -270,7 +270,7 @@ bail:
return ret;
}
static int tdav_webrtc_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame)
static int tdav_webrtc_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes)
{
tdav_webrtc_denoise_t *denoiser = (tdav_webrtc_denoise_t *)self;

View File

@ -305,7 +305,7 @@ static const tmedia_codec_plugin_def_t tdav_codec_amrnb_be_plugin_def_s =
{ /* audio */
1, // channels
20 // ptime
0 // ptime @deprecated
},
/* video */

View File

@ -230,7 +230,7 @@ static const tmedia_codec_plugin_def_t tdav_codec_bv16_plugin_def_s =
{ /* audio */
1, // channels
20 // ptime
0 // ptime @deprecated
},
/* video */

View File

@ -156,7 +156,7 @@ static const tmedia_codec_plugin_def_t tdav_codec_g711u_plugin_def_s =
{ /* audio */
1, // channels
20 // ptime
0 // ptime @deprecated
},
/* video */
@ -309,7 +309,7 @@ static const tmedia_codec_plugin_def_t tdav_codec_g711a_plugin_def_s =
{ /* audio */
1, // channels
20, // ptime
0 // ptime @deprecated
},
/* video */

View File

@ -207,7 +207,7 @@ static const tmedia_codec_plugin_def_t tdav_codec_g722_plugin_def_s =
{ /* audio */
1, // channels
20 // ptime
0 // ptime @deprecated
},
/* video */

View File

@ -444,7 +444,7 @@ static const tmedia_codec_plugin_def_t tdav_codec_g729ab_plugin_def_s =
{ /* audio */
1, // channels
20 // ptime
0 // ptime @deprecated
},
/* video */

View File

@ -189,7 +189,7 @@ static const tmedia_codec_plugin_def_t tdav_codec_gsm_plugin_def_s =
{ /* audio */
1, // channels
20 // ptime
0 // ptime @deprecated
},
/* video */

View File

@ -527,6 +527,10 @@ static void tdav_codec_h261_rtp_callback(tdav_codec_h261_t *self, const void *da
}
tsk_bool_t tdav_codec_ffmpeg_h261_is_supported()
{
return /*(avcodec_find_encoder(CODEC_ID_H261) && avcodec_find_decoder(CODEC_ID_H261))*/tsk_false /* @deprecated */;
}
#endif /* HAVE_FFMPEG */

View File

@ -39,6 +39,7 @@
#include "tnet_endianness.h"
#include "tinymedia/tmedia_params.h"
#include "tinymedia/tmedia_defaults.h"
#include "tsk_string.h"
#include "tsk_time.h"
@ -100,6 +101,7 @@ typedef struct tdav_codec_h263_s
void* buffer;
tsk_bool_t force_idr;
int32_t quality; // [1-31]
int32_t max_bw_kpbs;
} encoder;
// decoder
@ -204,6 +206,8 @@ int tdav_codec_h263_init(tdav_codec_h263_t* self, tdav_codec_h263_type_t type, e
TSK_DEBUG_ERROR("Failed to find [%d] decoder", decoder);
ret = -3;
}
self->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
/* allocations MUST be done by open() */
return ret;
@ -906,6 +910,7 @@ int tdav_codec_h263_open_encoder(tdav_codec_h263_t* self)
{
int ret;
int size;
int32_t max_bw_kpbs;
if(self->encoder.context){
TSK_DEBUG_ERROR("Encoder already opened");
return -1;
@ -927,8 +932,12 @@ int tdav_codec_h263_open_encoder(tdav_codec_h263_t* self)
self->encoder.context->mb_qmax = self->encoder.context->qmax;
#endif
self->encoder.context->mb_decision = FF_MB_DECISION_RD;
self->encoder.context->bit_rate = ((TMEDIA_CODEC_VIDEO(self)->out.width * TMEDIA_CODEC_VIDEO(self)->out.height * 256 / 320 / 240) * 1000);
max_bw_kpbs = TSK_CLAMP(
0,
tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
self->encoder.max_bw_kpbs
);
self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
//self->encoder.context->rc_lookahead = 0;
self->encoder.context->rtp_payload_size = RTP_PAYLOAD_SIZE;
self->encoder.context->opaque = tsk_null;
@ -998,6 +1007,8 @@ int tdav_codec_h263_open_encoder(tdav_codec_h263_t* self)
return ret;
}
TSK_DEBUG_INFO("[H.263] bitrate=%d bps", self->encoder.context->bit_rate);
return ret;
}
@ -1341,6 +1352,20 @@ static void tdav_codec_h263p_rtp_callback(tdav_codec_h263_t *self, const void *d
}
}
tsk_bool_t tdav_codec_ffmpeg_h263_is_supported()
{
return (avcodec_find_encoder(CODEC_ID_H263) && avcodec_find_decoder(CODEC_ID_H263));
}
tsk_bool_t tdav_codec_ffmpeg_h263p_is_supported()
{
return (avcodec_find_encoder(CODEC_ID_H263P) && avcodec_find_decoder(CODEC_ID_H263));
}
tsk_bool_t tdav_codec_ffmpeg_h263pp_is_supported()
{
return tdav_codec_ffmpeg_h263p_is_supported();
}
#endif /* HAVE_FFMPEG */

View File

@ -30,7 +30,7 @@
*/
#include "tinydav/codecs/h264/tdav_codec_h264.h"
#if (HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)) || HAVE_H264_PASSTHROUGH
#if HAVE_FFMPEG || HAVE_H264_PASSTHROUGH
#include "tinydav/codecs/h264/tdav_codec_h264_rtp.h"
#include "tinydav/video/tdav_converter_video.h"
@ -38,6 +38,7 @@
#include "tinyrtp/rtp/trtp_rtp_packet.h"
#include "tinymedia/tmedia_params.h"
#include "tinymedia/tmedia_defaults.h"
#include "tsk_params.h"
#include "tsk_memory.h"
@ -66,6 +67,7 @@ typedef struct tdav_codec_h264_s
tsk_bool_t force_idr;
int32_t quality; // [1-31]
int rotation;
int32_t max_bw_kpbs;
} encoder;
// decoder
@ -297,7 +299,7 @@ static tsk_size_t tdav_codec_h264_decode(tmedia_codec_t* self, const void* in_da
tsk_bool_t append_scp;
tsk_bool_t sps_or_pps;
tsk_size_t retsize = 0, size_to_copy = 0;
static tsk_size_t xmax_size = (1920 * 1080 * 3) >> 3;
static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
#if HAVE_FFMPEG
int got_picture_ptr = 0;
@ -747,6 +749,7 @@ int tdav_codec_h264_open_encoder(tdav_codec_h264_t* self)
#if HAVE_FFMPEG
int ret;
tsk_size_t size;
int32_t max_bw_kpbs;
if(self->encoder.context){
TSK_DEBUG_ERROR("Encoder already opened");
@ -776,8 +779,13 @@ int tdav_codec_h264_open_encoder(tdav_codec_h264_t* self)
self->encoder.context->time_base.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
self->encoder.context->width = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
self->encoder.context->height = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
self->encoder.context->bit_rate = ((TMEDIA_CODEC_VIDEO(self)->out.width * TMEDIA_CODEC_VIDEO(self)->out.height * 256 / 352 / 288) * 1000);
max_bw_kpbs = TSK_CLAMP(
0,
tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
self->encoder.max_bw_kpbs
);
self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
self->encoder.context->rc_min_rate = (self->encoder.context->bit_rate >> 3);
self->encoder.context->rc_max_rate = self->encoder.context->bit_rate;
@ -869,6 +877,8 @@ int tdav_codec_h264_open_encoder(tdav_codec_h264_t* self)
return ret;
}
TSK_DEBUG_INFO("[H.264] bitrate=%d bps", self->encoder.context->bit_rate);
return ret;
#elif HAVE_H264_PASSTHROUGH
return 0;
@ -983,7 +993,8 @@ int tdav_codec_h264_init(tdav_codec_h264_t* self, profile_idc_t profile)
TSK_DEBUG_ERROR("Failed to find level for size=[%u, %u]", TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height);
return ret;
}
(self)->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
TDAV_CODEC_H264_COMMON(self)->pack_mode = H264_PACKETIZATION_MODE;
TDAV_CODEC_H264_COMMON(self)->profile = profile;
TDAV_CODEC_H264_COMMON(self)->level = level;
@ -1067,4 +1078,13 @@ static void tdav_codec_h264_encap(const tdav_codec_h264_t* h264, const uint8_t*
}
}
#endif /* HAVE_FFMPEG */
tsk_bool_t tdav_codec_ffmpeg_h264_is_supported()
{
#if HAVE_FFMPEG
return (avcodec_find_encoder(CODEC_ID_H264) && avcodec_find_decoder(CODEC_ID_H264));
#else
return tsk_false;
#endif
}
#endif /* HAVE_FFMPEG || HAVE_H264_PASSTHROUGH */

View File

@ -40,6 +40,7 @@
#include "tnet_endianness.h"
#include "tinymedia/tmedia_params.h"
#include "tinymedia/tmedia_defaults.h"
#include "tsk_string.h"
#include "tsk_params.h"
@ -73,6 +74,7 @@ typedef struct tdav_codec_mp4ves_s
tsk_bool_t force_idr;
int quality; // [1-31]
int rotation;
int32_t max_bw_kpbs;
} encoder;
// decoder
@ -460,6 +462,7 @@ char* tdav_codec_mp4ves_sdp_att_get(const tmedia_codec_t* _self, const char* att
int tdav_codec_mp4ves_open_encoder(tdav_codec_mp4ves_t* self)
{
int ret, size;
int32_t max_bw_kpbs;
if(!self->encoder.codec && !(self->encoder.codec = avcodec_find_encoder(CODEC_ID_MPEG4))){
TSK_DEBUG_ERROR("Failed to find mp4v encoder");
return -1;
@ -481,8 +484,13 @@ int tdav_codec_mp4ves_open_encoder(tdav_codec_mp4ves_t* self)
self->encoder.context->noise_reduction = 250;
self->encoder.context->flags |= CODEC_FLAG_QSCALE;
self->encoder.context->global_quality = FF_QP2LAMBDA * self->encoder.quality;
self->encoder.context->bit_rate = ((TMEDIA_CODEC_VIDEO(self)->out.width * TMEDIA_CODEC_VIDEO(self)->out.height * 256 / 320 / 240) * 1000);
max_bw_kpbs = TSK_CLAMP(
0,
tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
self->encoder.max_bw_kpbs
);
self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
self->encoder.context->rtp_payload_size = MP4V_RTP_PAYLOAD_SIZE;
self->encoder.context->opaque = tsk_null;
self->encoder.context->profile = self->profile>>4;
@ -511,6 +519,8 @@ int tdav_codec_mp4ves_open_encoder(tdav_codec_mp4ves_t* self)
return ret;
}
TSK_DEBUG_INFO("[MP4V-ES] bitrate=%d bps", self->encoder.context->bit_rate);
return ret;
}
@ -742,6 +752,7 @@ static tsk_object_t* tdav_codec_mp4ves_ctor(tsk_object_t * _self, va_list * app)
/* init self */
self->profile = DEFAULT_PROFILE_LEVEL_ID;
self->encoder.quality = 1;
self->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
}
return self;
}
@ -796,6 +807,10 @@ static const tmedia_codec_plugin_def_t tdav_codec_mp4ves_plugin_def_s =
};
const tmedia_codec_plugin_def_t *tdav_codec_mp4ves_plugin_def_t = &tdav_codec_mp4ves_plugin_def_s;
tsk_bool_t tdav_codec_ffmpeg_mp4ves_is_supported()
{
return (avcodec_find_encoder(CODEC_ID_MPEG4) && avcodec_find_decoder(CODEC_ID_MPEG4));
}
#endif /* HAVE_FFMPEG */

View File

@ -342,7 +342,7 @@ static const tmedia_codec_plugin_def_t tdav_codec_opus_plugin_def_s =
{ /* audio */
2, // channels
20 // ptime
0 // ptime @deprecated
},
/* video */

View File

@ -219,7 +219,7 @@ tsk_bool_t tdav_codec_speex_sdp_att_match(const tmedia_codec_t* codec, const cha
\
{ /* audio */ \
1, /* channels*/ \
20 /* ptime*/ \
0 /* ptime @deprecated*/ \
}, \
\
/* video */ \

View File

@ -30,13 +30,14 @@
*/
#include "tinydav/codecs/theora/tdav_codec_theora.h"
#if HAVE_FFMPEG && (!defined(HAVE_THEORA) || HAVE_THEORA)
#if HAVE_FFMPEG
#include "tinydav/video/tdav_converter_video.h"
#include "tinyrtp/rtp/trtp_rtp_packet.h"
#include "tinymedia/tmedia_params.h"
#include "tinymedia/tmedia_defaults.h"
#include "tsk_string.h"
#include "tsk_buffer.h"
@ -75,6 +76,7 @@ typedef struct tdav_codec_theora_s
tsk_bool_t force_idr;
int quality;
int rotation;
int32_t max_bw_kpbs;
} encoder;
// decoder
@ -533,6 +535,7 @@ static tsk_object_t* tdav_codec_theora_ctor(tsk_object_t * self, va_list * app)
/* init base: called by tmedia_codec_create() */
/* init self */
theora->encoder.quality = 1;
theora->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
}
return self;
}
@ -593,6 +596,7 @@ const tmedia_codec_plugin_def_t *tdav_codec_theora_plugin_def_t = &tdav_codec_th
int tdav_codec_theora_open_encoder(tdav_codec_theora_t* self)
{
int ret, size;
int32_t max_bw_kpbs;
if(!self->encoder.codec && !(self->encoder.codec = avcodec_find_encoder(CODEC_ID_THEORA))){
TSK_DEBUG_ERROR("Failed to find Theora encoder");
return -1;
@ -612,7 +616,12 @@ int tdav_codec_theora_open_encoder(tdav_codec_theora_t* self)
self->encoder.context->mb_decision = FF_MB_DECISION_RD;
// Theoraenc doesn't honor 'CODEC_FLAG_QSCALE'
self->encoder.context->bit_rate = ((TMEDIA_CODEC_VIDEO(self)->out.width * TMEDIA_CODEC_VIDEO(self)->out.height * 256 / 320 / 240) * 1000);
max_bw_kpbs = TSK_CLAMP(
0,
tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self)->out.width, TMEDIA_CODEC_VIDEO(self)->out.height, TMEDIA_CODEC_VIDEO(self)->out.fps),
self->encoder.max_bw_kpbs
);
self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
#if LIBAVCODEC_VERSION_MAJOR <= 53
self->encoder.context->rc_lookahead = 0;
#endif
@ -645,6 +654,8 @@ int tdav_codec_theora_open_encoder(tdav_codec_theora_t* self)
self->encoder.conf_last = 0;
self->encoder.conf_count = 0;
TSK_DEBUG_INFO("[THEORA] bitrate=%d bps", self->encoder.context->bit_rate);
return ret;
}
@ -843,4 +854,9 @@ int tdav_codec_theora_send(tdav_codec_theora_t* self, const uint8_t* data, tsk_s
return 0;
}
tsk_bool_t tdav_codec_ffmpeg_theora_is_supported()
{
return (avcodec_find_encoder(CODEC_ID_THEORA) && avcodec_find_decoder(CODEC_ID_THEORA));
}
#endif /* HAVE_FFMPEG */

View File

@ -46,6 +46,12 @@
#include "tsk_time.h"
#include "tsk_debug.h"
#define VPX_CODEC_DISABLE_COMPAT 1 /* strict compliance with the latest SDK by disabling some backwards compatibility */
#include <vpx/vpx_encoder.h>
#include <vpx/vpx_decoder.h>
#include <vpx/vp8cx.h>
#include <vpx/vp8dx.h>
#if !defined(TDAV_VP8_DISABLE_EXTENSION)
# define TDAV_VP8_DISABLE_EXTENSION 0 /* Set X fied value to zero */
#endif
@ -305,7 +311,7 @@ static tsk_size_t tdav_codec_vp8_decode(tmedia_codec_t* self, const void* in_dat
const uint8_t* pdata = in_data;
const uint8_t* pdata_end = (pdata + in_size);
tsk_size_t ret = 0;
static const tsk_size_t xmax_size = (1920 * 1080 * 3) >> 3;
static const tsk_size_t xmax_size = (3840 * 2160 * 3) >> 3; // >>3 instead of >>1 (not an error)
uint8_t S, PartID;
if(!self || !in_data || in_size<1 || !out_data || !vp8->decoder.initialized){

View File

@ -223,16 +223,18 @@ int tdav_init()
}
#endif
#if HAVE_FFMPEG
tmedia_codec_plugin_register(tdav_codec_mp4ves_plugin_def_t);
# if !defined(HAVE_H264) || HAVE_H264
tmedia_codec_plugin_register(tdav_codec_h264_base_plugin_def_t);
tmedia_codec_plugin_register(tdav_codec_h264_main_plugin_def_t);
# endif
if(tdav_codec_ffmpeg_mp4ves_is_supported()){
tmedia_codec_plugin_register(tdav_codec_mp4ves_plugin_def_t);
}
if(tdav_codec_ffmpeg_h264_is_supported()){
tmedia_codec_plugin_register(tdav_codec_h264_base_plugin_def_t);
tmedia_codec_plugin_register(tdav_codec_h264_main_plugin_def_t);
}
tmedia_codec_plugin_register(tdav_codec_h263p_plugin_def_t);
tmedia_codec_plugin_register(tdav_codec_h263pp_plugin_def_t);
# if !defined(HAVE_THEORA) || HAVE_THEORA
tmedia_codec_plugin_register(tdav_codec_theora_plugin_def_t);
# endif
if(tdav_codec_ffmpeg_theora_is_supported()){
tmedia_codec_plugin_register(tdav_codec_theora_plugin_def_t);
}
tmedia_codec_plugin_register(tdav_codec_h263_plugin_def_t);
tmedia_codec_plugin_register(tdav_codec_h261_plugin_def_t);
#elif HAVE_H264_PASSTHROUGH
@ -367,16 +369,12 @@ static tdav_codec_decl_t __codecs[] = {
{ tdav_codec_id_h264_bp10, &tdav_codec_h264_cuda_bp10_plugin_def_t },
#endif
#if HAVE_FFMPEG
# if (!defined(HAVE_H264) || HAVE_H264) || HAVE_CUDA
{ tdav_codec_id_h264_bp, &tdav_codec_h264_base_plugin_def_t },
{ tdav_codec_id_h264_mp, &tdav_codec_h264_main_plugin_def_t },
# endif
{ tdav_codec_id_mp4ves_es, &tdav_codec_mp4ves_plugin_def_t },
{ tdav_codec_id_h263p, &tdav_codec_h263p_plugin_def_t },
{ tdav_codec_id_h263pp, &tdav_codec_h263pp_plugin_def_t },
# if !defined(HAVE_THEORA) || HAVE_THEORA
{ tdav_codec_id_theora, &tdav_codec_theora_plugin_def_t },
# endif
{ tdav_codec_id_h263, &tdav_codec_h263_plugin_def_t },
{ tdav_codec_id_h261, &tdav_codec_h261_plugin_def_t },
#elif HAVE_H264_PASSTHROUGH
@ -505,20 +503,34 @@ tsk_bool_t _tdav_codec_is_supported(tdav_codec_id_t codec, const tmedia_codec_pl
return tsk_false;
#endif
case tdav_codec_id_h261:
case tdav_codec_id_h263:
case tdav_codec_id_h263p:
case tdav_codec_id_h263pp:
#if HAVE_FFMPEG
return (codec == tdav_codec_id_h263)
? tdav_codec_ffmpeg_h263_is_supported()
: (codec == tdav_codec_id_h263p ? tdav_codec_ffmpeg_h263p_is_supported() : tdav_codec_ffmpeg_h263pp_is_supported());
#else
return tsk_false;
#endif
case tdav_codec_id_mp4ves_es:
#if HAVE_FFMPEG
return tsk_true;
return tdav_codec_ffmpeg_mp4ves_is_supported();
#else
return tsk_false;
#endif
case tdav_codec_id_h261:
#if HAVE_FFMPEG
return tdav_codec_ffmpeg_h261_is_supported();
#else
return tsk_false;
#endif
case tdav_codec_id_theora:
#if HAVE_FFMPEG && (!defined(HAVE_THEORA) || HAVE_THEORA)
return tsk_true;
#if HAVE_FFMPEG
return tdav_codec_ffmpeg_theora_is_supported();
#else
return tsk_false;
#endif
@ -530,8 +542,8 @@ tsk_bool_t _tdav_codec_is_supported(tdav_codec_id_t codec, const tmedia_codec_pl
#if HAVE_CUDA
if(tdav_codec_h264_is_cuda_plugin(plugin) && tdav_codec_h264_cuda_is_supported()) return tsk_true;
#endif
#if HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)
if(tdav_codec_h264_is_ffmpeg_plugin(plugin)) return tsk_true;
#if HAVE_FFMPEG
if(tdav_codec_h264_is_ffmpeg_plugin(plugin) && tdav_codec_ffmpeg_h264_is_supported()) return tsk_true;
#elif HAVE_H264_PASSTHROUGH
return tsk_true;
#endif
@ -540,8 +552,8 @@ tsk_bool_t _tdav_codec_is_supported(tdav_codec_id_t codec, const tmedia_codec_pl
#if HAVE_CUDA
if(tdav_codec_h264_cuda_is_supported()) return tsk_true;
#endif
#if (HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)) || HAVE_H264_PASSTHROUGH
return tsk_true;
#if HAVE_FFMPEG || HAVE_H264_PASSTHROUGH
return tdav_codec_ffmpeg_h264_is_supported();
#endif
}
return tsk_false;
@ -633,15 +645,11 @@ int tdav_deinit()
tmedia_codec_plugin_unregister(tdav_codec_mp4ves_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h261_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h263_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h263p_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h263pp_plugin_def_t);
# if !defined(HAVE_H264) || HAVE_H264
tmedia_codec_plugin_unregister(tdav_codec_h263p_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h263pp_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h264_base_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h264_main_plugin_def_t);
# endif
# if !defined(HAVE_THEORA) || HAVE_THEORA
tmedia_codec_plugin_unregister(tdav_codec_theora_plugin_def_t);
# endif
#elif HAVE_H264_PASSTHROUGH
tmedia_codec_plugin_unregister(tdav_codec_h264_base_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h264_main_plugin_def_t);

View File

@ -54,9 +54,10 @@ static const tsk_bool_t __have_libsrtp = tsk_true;
static const tsk_bool_t __have_libsrtp = tsk_false;
#endif
#define TDAV_IS_DTMF_CODEC(codec) (TMEDIA_CODEC((codec))->plugin == tdav_codec_dtmf_plugin_def_t)
#define TDAV_IS_ULPFEC_CODEC(codec) (TMEDIA_CODEC((codec))->plugin == tdav_codec_ulpfec_plugin_def_t)
#define TDAV_IS_RED_CODEC(codec) (TMEDIA_CODEC((codec))->plugin == tdav_codec_red_plugin_def_t)
#define TDAV_IS_DTMF_CODEC(codec) (codec && TMEDIA_CODEC((codec))->plugin == tdav_codec_dtmf_plugin_def_t)
#define TDAV_IS_ULPFEC_CODEC(codec) (codec && TMEDIA_CODEC((codec))->plugin == tdav_codec_ulpfec_plugin_def_t)
#define TDAV_IS_RED_CODEC(codec) (codec && TMEDIA_CODEC((codec))->plugin == tdav_codec_red_plugin_def_t)
#define TDAV_IS_VIDEO_CODEC(codec) (codec && TMEDIA_CODEC((codec))->plugin->type == tmedia_video)
#if !defined(TDAV_DFAULT_FP_HASH)
#define TDAV_DFAULT_FP_HASH tnet_dtls_hash_type_sha256
@ -212,8 +213,9 @@ int tdav_session_av_init(tdav_session_av_t* self, tmedia_type_t media_type)
self->use_rtcp = tmedia_defaults_get_rtcp_enabled();
self->use_rtcpmux = tmedia_defaults_get_rtcpmux_enabled();
self->use_avpf = (profile == tmedia_profile_rtcweb); // negotiate if not RTCWeb profile or RFC5939 is in action
self->bandwidth_max_upload = (media_type == tmedia_video ? tmedia_defaults_get_bandwidth_video_upload_max() : INT_MAX); // INT_MAX or <=0 means undefined
self->bandwidth_max_download = (media_type == tmedia_video ? tmedia_defaults_get_bandwidth_video_download_max() : INT_MAX); // INT_MAX or <=0 means undefined
self->bandwidth_max_upload_kbps = (media_type == tmedia_video ? tmedia_defaults_get_bandwidth_video_upload_max() : INT_MAX); // INT_MAX or <=0 means undefined
self->bandwidth_max_download_kbps = (media_type == tmedia_video ? tmedia_defaults_get_bandwidth_video_download_max() : INT_MAX); // INT_MAX or <=0 means undefined
self->congestion_ctrl_enabled = tmedia_defaults_get_congestion_ctrl_enabled(); // whether to enable draft-alvestrand-rtcweb-congestion-03 and draft-alvestrand-rmcat-remb-01
#if HAVE_SRTP
// this is the default value and can be updated by the user using "session_set('srtp-mode', mode_e)"
self->srtp_type = (profile == tmedia_profile_rtcweb) ? tmedia_srtp_type_sdes : tmedia_defaults_get_srtp_type();
@ -221,7 +223,7 @@ int tdav_session_av_init(tdav_session_av_t* self, tmedia_type_t media_type)
self->use_srtp = (self->srtp_mode == tmedia_srtp_mode_mandatory); // if optional -> negotiate
// remove DTLS-SRTP option if not supported
if((self->srtp_type & tmedia_srtp_type_dtls) && !tnet_dtls_is_srtp_supported()){
TSK_DEBUG_ERROR("DTLS-SRTP enabled but not supported. Please rebuild the code with this option enabled (requires OpenSSL 1.0.1+)");
TSK_DEBUG_WARN("DTLS-SRTP enabled but not supported. Please rebuild the code with this option enabled (requires OpenSSL 1.0.1+)");
if(!(self->srtp_type &= ~tmedia_srtp_type_dtls)){
// only DTLS-SRTP was enabled
self->srtp_mode = tmedia_srtp_mode_none;
@ -507,7 +509,30 @@ int tdav_session_av_start(tdav_session_av_t* self, const tmedia_codec_t* best_co
ret = trtp_manager_set_rtp_remote(self->rtp_manager, self->remote_ip, self->remote_port);
self->rtp_manager->use_rtcpmux = self->use_rtcpmux;
ret = trtp_manager_set_payload_type(self->rtp_manager, best_codec->neg_format ? atoi(best_codec->neg_format) : atoi(best_codec->format));
ret = trtp_manager_set_app_bandwidth_max(self->rtp_manager, self->bandwidth_max_upload, self->bandwidth_max_download);
{
int32_t bandwidth_max_upload_kbps = self->bandwidth_max_upload_kbps;
int32_t bandwidth_max_download_kbps = self->bandwidth_max_download_kbps;
if(self->media_type == tmedia_video){
if(self->congestion_ctrl_enabled){
const tmedia_codec_t* best_codec = tdav_session_av_get_best_neg_codec(self); // use for encoding for sure and probably for decoding
if(TDAV_IS_VIDEO_CODEC(best_codec)){
// the up bandwidth will be updated once the decode the first frame as the current values (width, height, fps) are not really correct and based on the SDP negotiation
bandwidth_max_download_kbps = TSK_MIN(
tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(best_codec)->in.width, TMEDIA_CODEC_VIDEO(best_codec)->in.height, TMEDIA_CODEC_VIDEO(best_codec)->in.fps),
bandwidth_max_download_kbps);
bandwidth_max_upload_kbps = TSK_MIN(
tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(best_codec)->out.width, TMEDIA_CODEC_VIDEO(best_codec)->out.height, TMEDIA_CODEC_VIDEO(best_codec)->out.fps),
bandwidth_max_upload_kbps);
}
else if(self->media_type == tmedia_video){
bandwidth_max_download_kbps = TSK_MIN(tmedia_get_video_bandwidth_kbps_3(), bandwidth_max_download_kbps);
bandwidth_max_upload_kbps = TSK_MIN(tmedia_get_video_bandwidth_kbps_3(), bandwidth_max_upload_kbps);
}
}
}
TSK_DEBUG_INFO("max_bw_up=%d kpbs, max_bw_down=%d kpbs, congestion_ctrl_enabled=%d, media_type=%d", bandwidth_max_upload_kbps, bandwidth_max_download_kbps, self->congestion_ctrl_enabled, self->media_type);
ret = trtp_manager_set_app_bandwidth_max(self->rtp_manager, bandwidth_max_upload_kbps, bandwidth_max_download_kbps);
}
ret = trtp_manager_start(self->rtp_manager);
// because of AudioUnit under iOS => prepare both consumer and producer then start() at the same time
@ -696,11 +721,13 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
flows that support both audio codec and DTMF payloads in RTP packets as described in RFC 4733 [23].
*/
if(self->media_type == tmedia_audio){
tsk_istr_t ptime;
tsk_itoa(tmedia_defaults_get_audio_ptime(), &ptime);
tsdp_header_M_add_headers(base->M.lo,
/* rfc3551 section 4.5 says the default ptime is 20 */
TSDP_HEADER_A_VA_ARGS("ptime", "20"),
TSDP_HEADER_A_VA_ARGS("minptime", "20"),
TSDP_HEADER_A_VA_ARGS("maxptime", "20"),
TSDP_HEADER_A_VA_ARGS("ptime", ptime),
TSDP_HEADER_A_VA_ARGS("minptime", "1"),
TSDP_HEADER_A_VA_ARGS("maxptime", "255"),
TSDP_HEADER_A_VA_ARGS("silenceSupp", "off - - - -"),
tsk_null);
// the "telephone-event" fmt/rtpmap is added below
@ -712,9 +739,9 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
TSDP_HEADER_A_VA_ARGS("rtcp-fb", "* ccm fir"),
tsk_null);
// http://tools.ietf.org/html/rfc3556
if(self->bandwidth_max_download > 0 && self->bandwidth_max_download != INT_MAX){ // INT_MAX or <=0 means undefined
if(self->bandwidth_max_download_kbps > 0 && self->bandwidth_max_download_kbps != INT_MAX){ // INT_MAX or <=0 means undefined
tsdp_header_M_add_headers(base->M.lo,
TSDP_HEADER_B_VA_ARGS("AS", self->bandwidth_max_download),
TSDP_HEADER_B_VA_ARGS("AS", self->bandwidth_max_download_kbps),
tsk_null);
}
}

View File

@ -319,12 +319,20 @@ int tdav_video_jb_put(tdav_video_jb_t* self, trtp_rtp_packet_t* rtp_pkt)
}
if(self->fps_prob <= 0 && self->avg_duration){
// compute FPS using timestamp values
int32_t fps = (1000 / self->avg_duration);
self->fps = TSK_CLAMP(TDAV_VIDEO_JB_FPS_MIN, fps, TDAV_VIDEO_JB_FPS_MAX);
int32_t fps_new = (1000 / self->avg_duration);
int32_t fps_old = self->fps;
self->fps = TSK_CLAMP(TDAV_VIDEO_JB_FPS_MIN, fps_new, TDAV_VIDEO_JB_FPS_MAX);
self->tail_max = (self->fps << TDAV_VIDEO_JB_TAIL_MAX_LOG2); // maximum delay = 2 seconds
self->latency_max = self->fps; // maximum = 1 second
TSK_DEBUG_INFO("According to rtp-timestamps ...FPS = %d (clipped to %d) tail_max=%d, latency_max=%u", fps, self->fps, self->tail_max, self->latency_max);
TSK_DEBUG_INFO("According to rtp-timestamps ...FPS = %d (clipped to %d) tail_max=%d, latency_max=%u", fps_new, self->fps, self->tail_max, self->latency_max);
tdav_video_jb_reset_fps_prob(self);
if(self->callback && (fps_old != self->fps)){
self->cb_data_any.type = tdav_video_jb_cb_data_type_fps_changed;
self->cb_data_any.ssrc = rtp_pkt->header->ssrc;
self->cb_data_any.fps.new = self->fps; // clipped value
self->cb_data_any.fps.old = fps_old;
self->callback(&self->cb_data_any);
}
}
}
else{

View File

@ -678,6 +678,17 @@ static int _tdav_session_video_jb_cb(const tdav_video_jb_cb_data_xt* data)
}
break;
}
case tdav_video_jb_cb_data_type_fps_changed:
{
if(base->congestion_ctrl_enabled){
video->fps_changed = tsk_true;
if(video->decoder.codec){
TSK_DEBUG_INFO("Congestion control enabled and fps updated from %u to %u", data->fps.old, data->fps.new);
TMEDIA_CODEC_VIDEO(video->decoder.codec)->in.fps = data->fps.new;
}
}
break;
}
}
return 0;
@ -687,7 +698,7 @@ int _tdav_session_video_open_decoder(tdav_session_video_t* self, uint8_t payload
{
int ret = 0;
if((self->decoder.payload_type != payload_type) || !self->decoder.codec){
if((self->decoder.codec_payload_type != payload_type) || !self->decoder.codec){
tsk_istr_t format;
TSK_OBJECT_SAFE_FREE(self->decoder.codec);
tsk_itoa(payload_type, &format);
@ -696,7 +707,8 @@ int _tdav_session_video_open_decoder(tdav_session_video_t* self, uint8_t payload
ret = -2;
goto bail;
}
self->decoder.payload_type = payload_type;
self->decoder.codec_payload_type = payload_type;
self->decoder.codec_decoded_frames_count = 0; // because we switched the codecs
}
// Open codec if not already done
if(!TMEDIA_CODEC(self->decoder.codec)->opened){
@ -704,6 +716,7 @@ int _tdav_session_video_open_decoder(tdav_session_video_t* self, uint8_t payload
TSK_DEBUG_ERROR("Failed to open [%s] codec", self->decoder.codec->plugin->desc);
goto bail;
}
self->decoder.codec_decoded_frames_count = 0; // because first time to use
}
bail:
@ -730,7 +743,7 @@ static int _tdav_session_video_decode(tdav_session_video_t* self, const trtp_rtp
tdav_session_video_t* video = (tdav_session_video_t*)base;
// Find the codec to use to decode the RTP payload
if(!self->decoder.codec || self->decoder.payload_type != packet->header->payload_type){
if(!self->decoder.codec || self->decoder.codec_payload_type != packet->header->payload_type){
if((ret = _tdav_session_video_open_decoder(self, packet->header->payload_type))){
goto bail;
}
@ -845,6 +858,29 @@ static int _tdav_session_video_decode(tdav_session_video_t* self, const trtp_rtp
_size = out_size;
}
// congetion control
// send RTCP-REMB if:
// - fps changed
// - first frame
// - approximately every 5 minutes (300 = 60 * 5)
if(self->fps_changed || base->congestion_ctrl_enabled && base->rtp_manager && (self->decoder.codec_decoded_frames_count == 0 || ((self->decoder.codec_decoded_frames_count % (TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.fps * 300)) == 0))){
int32_t bandwidth_max_upload_kbps = base->bandwidth_max_upload_kbps;
int32_t bandwidth_max_download_kbps = base->bandwidth_max_download_kbps;
// bandwidth already computed in start() be the decoded video size was not correct and based on the SDP negotiation
bandwidth_max_download_kbps = TSK_MIN(
tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.width, TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.height, TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.fps),
bandwidth_max_download_kbps);
if(self->encoder.codec){
bandwidth_max_upload_kbps = TSK_MIN(
tmedia_get_video_bandwidth_kbps_2(TMEDIA_CODEC_VIDEO(self->encoder.codec)->out.width, TMEDIA_CODEC_VIDEO(self->encoder.codec)->out.height, TMEDIA_CODEC_VIDEO(self->encoder.codec)->out.fps),
bandwidth_max_upload_kbps);
}
self->fps_changed = tsk_false; // reset
TSK_DEBUG_INFO("video with congestion control enabled: max_bw_up=%d kpbs, max_bw_down=%d kpbs", bandwidth_max_upload_kbps, bandwidth_max_download_kbps);
ret = trtp_manager_set_app_bandwidth_max(base->rtp_manager, bandwidth_max_upload_kbps, bandwidth_max_download_kbps);
}
// inc() frame count and consume decoded video
++self->decoder.codec_decoded_frames_count;
ret = tmedia_consumer_consume(base->consumer, _buffer, _size, __rtp_header);
}
else if(!base->consumer->is_started){

View File

@ -0,0 +1,15 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinyDAV
Description : Doubango Telecom tinyDAV (Audio/Video) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@ tinyNET = @PACKAGE_VERSION@ tinySDP = @PACKAGE_VERSION@ tinyRTP = @PACKAGE_VERSION@ tinyMEDIA = @PACKAGE_VERSION@ tinyMSRP = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinydav
Libs : -L${libdir} -ltinyDAV
Libs.private: @LIBFFMPEG_LIBADD@ @LIBH264_LIBADD@ @LIBVPX_LIBADD@ @LIBOPUS_LIBADD@ @LIBAMR_LIBADD@ @LIBSPEEX_LIBADD@ @LIBSPEEXDSP_LIBADD@ @LIBGSM_LIBADD@ @LIBG729_LIBADD@ @LIBILBC_LIBADD@

View File

@ -42,4 +42,7 @@ auth_include_HEADERS = include/tinyhttp/auth/*.h
headers_includedir = $(includedir)/tinyhttp/tinyhttp/headers
headers_include_HEADERS = include/tinyhttp/headers/*.h
parsers_includedir = $(includedir)/tinyhttp/tinyhttp/parsers
parsers_include_HEADERS = include/tinyhttp/parsers/*.h
parsers_include_HEADERS = include/tinyhttp/parsers/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinyHTTP.pc

View File

@ -0,0 +1,15 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinyHTTP
Description : Doubango Telecom tinyHTTP (HTTP/HTTPS protocols) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@ tinyNET = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinyhttp
Libs : -L${libdir} -ltinyHTTP
Libs.private:

View File

@ -15,3 +15,6 @@ libtinyIPSec_la_LDFLAGS = $LDFLAGS -no-undefined
# Headers file to install
libtinyIPSec_la_HEADERS = src/*.h
libtinyIPSec_ladir = $(includedir)/tinyipsec
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinyIPSec.pc

View File

@ -0,0 +1,15 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinyIPSec
Description : Doubango Telecom tinyIPSec (IPSec) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinyipsec
Libs : -L${libdir} -ltinyIPSec
Libs.private:

View File

@ -34,4 +34,8 @@ _include_HEADERS = include/*.h
__includedir = $(includedir)/tinymedia/tinymedia
__include_HEADERS = include/tinymedia/*.h
content_includedir = $(includedir)/tinymedia/tinymedia/content
content_include_HEADERS = include/tinymedia/content/*.h
content_include_HEADERS = include/tinymedia/content/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinyMEDIA.pc

View File

@ -130,6 +130,7 @@ typedef enum tmedia_pref_video_size_s
tmedia_pref_video_size_720p, // 1280 x 720
tmedia_pref_video_size_16cif, // 1408 x 1152
tmedia_pref_video_size_1080p, // 1920 x 1080
tmedia_pref_video_size_2160p, // 3840 x 2160
}
tmedia_pref_video_size_t;
@ -254,6 +255,7 @@ TINYMEDIA_API char* tmedia_get_video_imageattr(tmedia_pref_video_size_t pref_vs,
TINYMEDIA_API int tmedia_get_video_quality(tmedia_bandwidth_level_t bl);
TINYMEDIA_API int32_t tmedia_get_video_bandwidth_kbps(unsigned width, unsigned height, unsigned fps, unsigned motion_rank);
TINYMEDIA_API int32_t tmedia_get_video_bandwidth_kbps_2(unsigned width, unsigned height, unsigned fps);
TINYMEDIA_API int32_t tmedia_get_video_bandwidth_kbps_3();
#define tmedia_get_video_qscale tmedia_get_video_quality
TMEDIA_END_DECLS

View File

@ -40,7 +40,7 @@ TMEDIA_BEGIN_DECLS
#define TMEDIA_CONSUMER_BITS_PER_SAMPLE_DEFAULT 16
#define TMEDIA_CONSUMER_CHANNELS_DEFAULT 2
#define TMEDIA_CONSUMER_RATE_DEFAULT 8000
#define TMEDIA_CONSUMER_PTIME_DEFAULT 20
/**Max number of plugins (consumer types) we can create */
#if !defined(TMED_CONSUMER_MAX_PLUGINS)

View File

@ -33,6 +33,10 @@ TINYMEDIA_API int tmedia_defaults_set_profile(tmedia_profile_t profile);
TINYMEDIA_API tmedia_profile_t tmedia_defaults_get_profile();
TINYMEDIA_API int tmedia_defaults_set_bl(tmedia_bandwidth_level_t bl); // @deprecated
TINYMEDIA_API tmedia_bandwidth_level_t tmedia_defaults_get_bl(); // @deprecated
TINYMEDIA_API int tmedia_defaults_set_congestion_ctrl_enabled(tsk_bool_t enabled);
TINYMEDIA_API tsk_bool_t tmedia_defaults_get_congestion_ctrl_enabled();
TINYMEDIA_API int tmedia_defaults_set_video_fps(int32_t video_fps);
TINYMEDIA_API int32_t tmedia_defaults_get_video_fps();
TINYMEDIA_API int tmedia_defaults_set_video_motion_rank(int32_t video_motion_rank);
TINYMEDIA_API int32_t tmedia_defaults_get_video_motion_rank();
TINYMEDIA_API int tmedia_defaults_set_bandwidth_video_upload_max(int32_t bw_video_up_max_kbps);
@ -66,6 +70,11 @@ TINYMEDIA_API tsk_bool_t tmedia_defaults_get_100rel_enabled();
TINYMEDIA_API int tmedia_defaults_set_screen_size(int32_t sx, int32_t sy);
TINYMEDIA_API int32_t tmedia_defaults_get_screen_x();
TINYMEDIA_API int32_t tmedia_defaults_get_screen_y();
TINYMEDIA_API int tmedia_defaults_set_audio_ptime(int32_t audio_ptime);
TINYMEDIA_API int32_t tmedia_defaults_get_audio_ptime();
TINYMEDIA_API int tmedia_defaults_set_audio_channels(int32_t channels_playback, int32_t channels_record);
TINYMEDIA_API int32_t tmedia_defaults_get_audio_channels_playback();
TINYMEDIA_API int32_t tmedia_defaults_get_audio_channels_record();
TINYMEDIA_API int tmedia_defaults_set_audio_gain(int32_t audio_producer_gain, int32_t audio_consumer_gain);
TINYMEDIA_API int32_t tmedia_defaults_get_audio_producer_gain();
TINYMEDIA_API int32_t tmedia_defaults_get_audio_consumer_gain();

View File

@ -71,22 +71,22 @@ typedef struct tmedia_denoise_plugin_def_s
const char* desc;
int (*set) (tmedia_denoise_t* , const tmedia_param_t*);
int (* open) (tmedia_denoise_t*, uint32_t frame_size, uint32_t sampling_rate);
int (*echo_playback) (tmedia_denoise_t* self, const void* echo_frame);
int (* open) (tmedia_denoise_t*, uint32_t frame_size_samples, uint32_t sampling_rate);
int (*echo_playback) (tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes);
//! aec, vad, noise suppression, echo cancellation before sending packet over network
int (* process_record) (tmedia_denoise_t*, void* audio_frame, tsk_bool_t* silence_or_noise);
int (* process_record) (tmedia_denoise_t*, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise);
//! noise suppression before playing sound
int (* process_playback) (tmedia_denoise_t*, void* audio_frame);
int (* process_playback) (tmedia_denoise_t*, void* audio_frame, uint32_t audio_frame_size_bytes);
int (* close) (tmedia_denoise_t* );
}
tmedia_denoise_plugin_def_t;
TINYMEDIA_API int tmedia_denoise_init(tmedia_denoise_t* self);
TINYMEDIA_API int tmedia_denoise_set(tmedia_denoise_t* self, const tmedia_param_t* param);
TINYMEDIA_API int tmedia_denoise_open(tmedia_denoise_t* self, uint32_t frame_size, uint32_t sampling_rate);
TINYMEDIA_API int tmedia_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame);
TINYMEDIA_API int tmedia_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, tsk_bool_t* silence_or_noise);
TINYMEDIA_API int tmedia_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame);
TINYMEDIA_API int tmedia_denoise_open(tmedia_denoise_t* self, uint32_t frame_size_samples, uint32_t sampling_rate);
TINYMEDIA_API int tmedia_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes);
TINYMEDIA_API int tmedia_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise);
TINYMEDIA_API int tmedia_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes);
TINYMEDIA_API int tmedia_denoise_close(tmedia_denoise_t* self);
TINYMEDIA_API int tmedia_denoise_deinit(tmedia_denoise_t* self);

View File

@ -89,8 +89,8 @@ int tmedia_codec_init(tmedia_codec_t* self, tmedia_type_t type, const char* name
if(type & tmedia_audio){
tmedia_codec_audio_t* audio = TMEDIA_CODEC_AUDIO(self);
if(!audio->in.ptime) audio->in.ptime = self->plugin->audio.ptime;
if(!audio->out.ptime) audio->out.ptime = self->plugin->audio.ptime;
if(!audio->in.ptime) audio->in.ptime = (self->plugin->audio.ptime ? self->plugin->audio.ptime : tmedia_defaults_get_audio_ptime());
if(!audio->out.ptime) audio->out.ptime = (self->plugin->audio.ptime ? self->plugin->audio.ptime : tmedia_defaults_get_audio_ptime());
if(!audio->in.channels) audio->in.channels = self->plugin->audio.channels;
if(!audio->out.channels) audio->out.channels = self->plugin->audio.channels;
if(!audio->in.timestamp_multiplier) audio->in.timestamp_multiplier = tmedia_codec_audio_get_timestamp_multiplier(self->id, self->in.rate);

View File

@ -48,6 +48,7 @@ typedef struct fmtp_size_s{
static const fmtp_size_t fmtp_sizes[] =
{
/* must be sorted like this */
{"2160P", tmedia_pref_video_size_2160p, tsk_false, 3840, 2160},
{"1080P", tmedia_pref_video_size_1080p, tsk_false, 1920, 1080},
{"16CIF", tmedia_pref_video_size_16cif, tsk_true, 1408, 1152},
{"720P", tmedia_pref_video_size_720p, tsk_false, 1280, 720},
@ -324,4 +325,11 @@ int32_t tmedia_get_video_bandwidth_kbps(unsigned width, unsigned height, unsigne
int32_t tmedia_get_video_bandwidth_kbps_2(unsigned width, unsigned height, unsigned fps)
{
return tmedia_get_video_bandwidth_kbps(width, height, fps, tmedia_defaults_get_video_motion_rank());
}
int32_t tmedia_get_video_bandwidth_kbps_3()
{
unsigned width = 3840;
unsigned height = 2160;
tmedia_video_get_size(tmedia_defaults_get_pref_video_size(), &width, &height);
return tmedia_get_video_bandwidth_kbps(width, height, tmedia_defaults_get_video_fps(), tmedia_defaults_get_video_motion_rank());
}

View File

@ -57,7 +57,7 @@ int tmedia_consumer_init(tmedia_consumer_t* self)
self->video.display.chroma = TMEDIA_CONSUMER_CHROMA_DEFAULT;
self->audio.bits_per_sample = TMEDIA_CONSUMER_BITS_PER_SAMPLE_DEFAULT;
self->audio.ptime = TMEDIA_CONSUMER_PTIME_DEFAULT;
self->audio.ptime = tmedia_defaults_get_audio_ptime();
self->audio.volume = tmedia_defaults_get_volume();
return 0;

View File

@ -30,6 +30,8 @@
static tmedia_profile_t __profile = tmedia_profile_default;
static tmedia_bandwidth_level_t __bl = tmedia_bl_unrestricted;
static tsk_bool_t __congestion_ctrl_enabled = tsk_false;
static int32_t __video_fps = 15; // allowed values: ]0 - 120]
static int32_t __video_motion_rank = 2; // allowed values: 1(low), 2(medium) or 4(high)
static int32_t __bw_video_up_max_kbps = INT_MAX; // <= 0: unrestricted, Unit: kbps
static int32_t __bw_video_down_max_kbps = INT_MAX; // <= 0: unrestricted, Unit: kbps
@ -49,6 +51,9 @@ static int32_t __sx = -1;
static int32_t __sy = -1;
static int32_t __audio_producer_gain = 0;
static int32_t __audio_consumer_gain = 0;
static int32_t __audio_channels_playback = 1;
static int32_t __audio_channels_record = 1;
static int32_t __audio_ptime = 20;
static uint16_t __rtp_port_range_start = 1024;
static uint16_t __rtp_port_range_stop = 65535;
static tsk_bool_t __rtp_symetric_enabled = tsk_false; // This option is force symetric RTP for remote size. Local: always ON
@ -95,6 +100,26 @@ tmedia_bandwidth_level_t tmedia_defaults_get_bl(){
return __bl;
}
int tmedia_defaults_set_congestion_ctrl_enabled(tsk_bool_t enabled){
__congestion_ctrl_enabled = enabled;
return 0;
}
tsk_bool_t tmedia_defaults_get_congestion_ctrl_enabled(){
return __congestion_ctrl_enabled;
}
int tmedia_defaults_set_video_fps(int32_t video_fps){
if(video_fps > 0 && video_fps <= 120){
__video_fps = video_fps;
return 0;
}
TSK_DEBUG_ERROR("%d not valid for video fps", video_fps);
return -1;
}
int32_t tmedia_defaults_get_video_fps(){
return __video_fps;
}
int tmedia_defaults_set_video_motion_rank(int32_t video_motion_rank){
switch(video_motion_rank){
case 1/*low*/: case 2/*medium*/: case 4/*high*/: __video_motion_rank = video_motion_rank; return 0;
@ -243,6 +268,31 @@ int32_t tmedia_defaults_get_screen_y(){
return __sy;
}
int tmedia_defaults_set_audio_ptime(int32_t audio_ptime){
if(audio_ptime > 0){
__audio_ptime = audio_ptime;
return 0;
}
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
int32_t tmedia_defaults_get_audio_ptime(){
return __audio_ptime;
}
int tmedia_defaults_set_audio_channels(int32_t channels_playback, int32_t channels_record){
if(channels_playback != 1 && channels_playback != 2) { TSK_DEBUG_ERROR("Invalid parameter"); return -1; }
if(channels_record != 1 && channels_record != 2) { TSK_DEBUG_ERROR("Invalid parameter"); return -1; }
__audio_channels_playback = channels_playback;
__audio_channels_record = channels_record;
return 0;
}
int32_t tmedia_defaults_get_audio_channels_playback(){
return __audio_channels_playback;
}
int32_t tmedia_defaults_get_audio_channels_record(){
return __audio_channels_record;
}
int tmedia_defaults_set_audio_gain(int32_t audio_producer_gain, int32_t audio_consumer_gain){
__audio_producer_gain = audio_producer_gain;
__audio_consumer_gain = audio_consumer_gain;

View File

@ -106,7 +106,7 @@ int tmedia_denoise_open(tmedia_denoise_t* self, uint32_t frame_size, uint32_t sa
}
}
int tmedia_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame)
int tmedia_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame, uint32_t echo_frame_size_bytes)
{
if(!self || !self->plugin){
TSK_DEBUG_ERROR("Invalid parameter");
@ -119,14 +119,14 @@ int tmedia_denoise_echo_playback(tmedia_denoise_t* self, const void* echo_frame)
}
if(self->plugin->echo_playback){
return self->plugin->echo_playback(self, echo_frame);
return self->plugin->echo_playback(self, echo_frame, echo_frame_size_bytes);
}
else{
return 0;
}
}
int tmedia_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, tsk_bool_t* silence_or_noise)
int tmedia_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes, tsk_bool_t* silence_or_noise)
{
if(!self || !self->plugin || !silence_or_noise){
TSK_DEBUG_ERROR("Invalid parameter");
@ -139,7 +139,7 @@ int tmedia_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, tsk
}
if(self->plugin->process_record){
return self->plugin->process_record(self, audio_frame, silence_or_noise);
return self->plugin->process_record(self, audio_frame, audio_frame_size_bytes, silence_or_noise);
}
else{
*silence_or_noise = tsk_false;
@ -147,7 +147,7 @@ int tmedia_denoise_process_record(tmedia_denoise_t* self, void* audio_frame, tsk
}
}
int tmedia_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame)
int tmedia_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame, uint32_t audio_frame_size_bytes)
{
if(!self || !self->plugin){
TSK_DEBUG_ERROR("Invalid parameter");
@ -160,7 +160,7 @@ int tmedia_denoise_process_playback(tmedia_denoise_t* self, void* audio_frame)
}
if(self->plugin->process_playback){
return self->plugin->process_playback(self, audio_frame);
return self->plugin->process_playback(self, audio_frame, audio_frame_size_bytes);
}
return 0;
}

View File

@ -0,0 +1,15 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinyMEDIA
Description : Doubango Telecom tinyMEDIA (Plugins definition) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@ tinyNET = @PACKAGE_VERSION@ tinySDP = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinymedia
Libs : -L${libdir} -ltinyMEDIA
Libs.private:

View File

@ -45,4 +45,8 @@ headers_include_HEADERS = include/tinymsrp/headers/*.h
parsers_includedir = $(includedir)/tinymsrp/tinymsrp/parsers
parsers_include_HEADERS = include/tinymsrp/parsers/*.h
session_includedir = $(includedir)/tinymsrp/tinymsrp/session
session_include_HEADERS = include/tinymsrp/session/*.h
session_include_HEADERS = include/tinymsrp/session/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinyMSRP.pc

View File

@ -0,0 +1,16 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinyMSRP
Description : Doubango Telecom tinyMSRP (MSRP protocol) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@ tinyNET = @PACKAGE_VERSION@ tinySDP = @PACKAGE_VERSION@ tinyHTTP = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinymsrp
Libs : -L${libdir} -ltinyMSRP
Libs.private:

View File

@ -85,3 +85,7 @@ tls_includedir = $(includedir)/tinynet/tls
tls_include_HEADERS = src/tls/*.h
turn_includedir = $(includedir)/tinynet/turn
turn_include_HEADERS = src/turn/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinyNET.pc

View File

@ -0,0 +1,16 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinyNET
Description : Doubango Telecom tinyNET (Networking) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinynet
Libs : -L${libdir} -ltinyNET
Libs.private:

View File

@ -40,4 +40,7 @@ __include_HEADERS = include/tinyrtp/*.h
rtcp_includedir = $(includedir)/tinyrtp/tinyrtp/rtcp
rtcp_include_HEADERS = include/tinyrtp/rtcp/*.h
rtp_includedir = $(includedir)/tinyrtp/tinyrtp/rtp
rtp_include_HEADERS = include/tinyrtp/rtp/*.h
rtp_include_HEADERS = include/tinyrtp/rtp/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinyRTP.pc

View File

@ -440,12 +440,47 @@ int trtp_rtcp_session_set_srtp_sess(trtp_rtcp_session_t* self, const srtp_t* ses
int trtp_rtcp_session_set_app_bandwidth_max(trtp_rtcp_session_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps)
{
trtp_rtcp_report_rr_t* rr;
if(!self){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
tsk_safeobj_lock(self);
self->app_bw_max_upload = bw_upload_kbps;
self->app_bw_max_download = bw_download_kbps;
if(self->started && self->source_local && self->app_bw_max_download > 0 && self->app_bw_max_download != INT_MAX){ // INT_MAX or <=0 means undefined
tsk_list_item_t* item;
uint32_t media_ssrc_list[256] = {0};
uint32_t media_ssrc_list_count = 0;
// retrieve sources as array
tsk_list_foreach(item, self->sources){
if(!item->data){
continue;
}
if((media_ssrc_list_count + 1) < sizeof(media_ssrc_list)/sizeof(media_ssrc_list[0])){
media_ssrc_list[media_ssrc_list_count++] = TRTP_RTCP_SOURCE(item->data)->ssrc;
}
}
// create RTCP-RR packet and send it over the network
if(media_ssrc_list_count > 0 && (rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))){
// app_bw_max_download unit is kbps while create_afb_remb() expect bps
trtp_rtcp_report_psfb_t* psfb_afb_remb = trtp_rtcp_report_psfb_create_afb_remb(self->source_local->ssrc/*sender SSRC*/, media_ssrc_list, media_ssrc_list_count, (self->app_bw_max_download * 1024));
if(psfb_afb_remb){
TSK_DEBUG_INFO("Packing RTCP-AFB-REMB (bw_dwn=%d kbps) for outgoing RTCP-RR", self->app_bw_max_download);
if(trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)rr, (trtp_rtcp_packet_t*)psfb_afb_remb, tsk_false) == 0){
_trtp_rtcp_session_send_pkt(self, (trtp_rtcp_packet_t*)rr);
}
TSK_OBJECT_SAFE_FREE(psfb_afb_remb);
}
TSK_OBJECT_SAFE_FREE(rr);
}
}
tsk_safeobj_unlock(self);
return 0;
}
@ -655,7 +690,13 @@ int trtp_rtcp_session_signal_pkt_loss(trtp_rtcp_session_t* self, uint32_t ssrc_m
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
if(!self->started){
TSK_DEBUG_ERROR("Not started");
return -1;
}
tsk_safeobj_lock(self);
if((rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))){
trtp_rtcp_report_rtpfb_t* rtpfb;
if((rtpfb = trtp_rtcp_report_rtpfb_create_nack(self->source_local->ssrc, ssrc_media, seq_nums, count))){
@ -665,6 +706,9 @@ int trtp_rtcp_session_signal_pkt_loss(trtp_rtcp_session_t* self, uint32_t ssrc_m
}
TSK_OBJECT_SAFE_FREE(rr);
}
tsk_safeobj_unlock(self);
return 0;
}
@ -676,6 +720,12 @@ int trtp_rtcp_session_signal_frame_corrupted(trtp_rtcp_session_t* self, uint32_t
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
if(!self->started){
TSK_DEBUG_ERROR("Not started");
return -1;
}
tsk_safeobj_lock(self);
if((rr = trtp_rtcp_report_rr_create_2(self->source_local->ssrc))){
trtp_rtcp_report_psfb_t* psfb_fir = trtp_rtcp_report_psfb_create_fir(self->fir_seqnr++, self->source_local->ssrc, ssrc_media);
@ -686,6 +736,8 @@ int trtp_rtcp_session_signal_frame_corrupted(trtp_rtcp_session_t* self, uint32_t
}
TSK_OBJECT_SAFE_FREE(rr);
}
tsk_safeobj_unlock(self);
return 0;
}
@ -1187,7 +1239,8 @@ static tsk_size_t SendRTCPReport(trtp_rtcp_session_t* session, event_ e)
if((media_ssrc_list_count + 1) < sizeof(media_ssrc_list)/sizeof(media_ssrc_list[0])){
media_ssrc_list[media_ssrc_list_count++] = source->ssrc;
} }
}
}
if(media_ssrc_list_count > 0){
// draft-alvestrand-rmcat-remb-02
@ -1195,6 +1248,7 @@ static tsk_size_t SendRTCPReport(trtp_rtcp_session_t* session, event_ e)
// app_bw_max_download unit is kbps while create_afb_remb() expect bps
trtp_rtcp_report_psfb_t* psfb_afb_remb = trtp_rtcp_report_psfb_create_afb_remb(session->source_local->ssrc/*sender SSRC*/, media_ssrc_list, media_ssrc_list_count, (session->app_bw_max_download * 1024));
if(psfb_afb_remb){
TSK_DEBUG_INFO("Packing RTCP-AFB-REMB (bw_dwn=%d kbps) for outgoing RTCP-SR", session->app_bw_max_download);
trtp_rtcp_packet_add_packet((trtp_rtcp_packet_t*)sr, (trtp_rtcp_packet_t*)psfb_afb_remb, tsk_false);
TSK_OBJECT_SAFE_FREE(psfb_afb_remb);
}

View File

@ -0,0 +1,14 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinyRTP
Description : Doubango Telecom tinyRTP ((S)RTP/(S)RTCP protocols) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@ tinyNET = @PACKAGE_VERSION@ tinyMEDIA = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinyrtp
Libs : -L${libdir} -ltinyRTP
Libs.private:

View File

@ -39,4 +39,7 @@ libtinySAK_la_SOURCES = \
libtinySAK_la_LDFLAGS = $LDFLAGS -no-undefined
libtinySAK_la_HEADERS = src/*.h
libtinySAK_ladir = $(includedir)/tinysak
libtinySAK_ladir = $(includedir)/tinysak
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinySAK.pc

View File

@ -285,7 +285,7 @@ int tsk_buffer_copy(tsk_buffer_t* self, tsk_size_t start, const void* data, tsk_
}
// realloc the buffer to match the overral size
if((ret = tsk_buffer_realloc(self, (start + size)))){
if(self->size != (start + size) && (ret = tsk_buffer_realloc(self, (start + size)))){
TSK_DEBUG_ERROR("failed to realloc the buffer");
return ret;
}

View File

@ -0,0 +1,14 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinySAK
Description : Doubango Telecom tinySAK (Swiss Army Knife) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private:
Conflicts:
Cflags : -I${includedir}/tinysak
Libs : -L${libdir} -ltinySAK
Libs.private:

View File

@ -36,4 +36,7 @@ __include_HEADERS = include/tinysdp/*.h
headers_includedir = $(includedir)/tinysdp/tinysdp/headers
headers_include_HEADERS = include/tinysdp/headers/*.h
parsers_includedir = $(includedir)/tinysdp/tinysdp/parsers
parsers_include_HEADERS = include/tinysdp/parsers/*.h
parsers_include_HEADERS = include/tinysdp/parsers/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinySDP.pc

View File

@ -0,0 +1,14 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinySDP
Description : Doubango Telecom tinySDP (SDP protocol) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinysdp
Libs : -L${libdir} -ltinySDP
Libs.private:

View File

@ -38,3 +38,6 @@ libtinySIGCOMP_la_SOURCES = \
libtinySIGCOMP_la_LDFLAGS = $LDFLAGS -no-undefined
libtinySIGCOMP_la_HEADERS = src/*.h
libtinySIGCOMP_ladir = $(includedir)/tinysigcomp
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinySIGCOMP.pc

View File

@ -0,0 +1,14 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinySIGCOMP
Description : Doubango Telecom tinySIGCOMP (Signaling Compression) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinysigcomp
Libs : -L${libdir} -ltinySIGCOMP
Libs.private:

View File

@ -200,7 +200,8 @@ transactions_include_HEADERS = include/tinysip/transactions/*.h
transports_includedir = $(includedir)/tinysip/tinysip/transports
transports_include_HEADERS = include/tinysip/transports/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinySIP.pc

View File

@ -0,0 +1,16 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinySIP
Description : Doubango Telecom tinyIP (SIP protocol) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@ tinyNET = @PACKAGE_VERSION@ tinyHTTP = @PACKAGE_VERSION@ tinyIPSec = @PACKAGE_VERSION@ tinySDP = @PACKAGE_VERSION@ tinyMEDIA = @PACKAGE_VERSION@ tinySIGCOMP = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinysip
Libs : -L${libdir} -ltinySIP
Libs.private:

View File

@ -26,3 +26,6 @@ rpdu_includedir = $(includedir)/tinysms/tinysms/rpdu
rpdu_include_HEADERS = include/tinysms/rpdu/*.h
tpdu_includedir = $(includedir)/tinysms/tinysms/tpdu
tpdu_include_HEADERS = include/tinysms/tpdu/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinySMS.pc

View File

@ -0,0 +1,14 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
Name : libtinySMS
Description : Doubango Telecom tinySMS (3GPP SMS) library
Version : @PACKAGE_VERSION@
Requires:
Requires.private: tinySAK = @PACKAGE_VERSION@
Conflicts:
Cflags : -I${includedir}/tinysms
Libs : -L${libdir} -ltinySMS
Libs.private:

View File

@ -16,4 +16,7 @@ libtinyXCAP_la_LDFLAGS = $LDFLAGS -no-undefined
_includedir = $(includedir)/tinyxcap
_include_HEADERS = include/*.h
__includedir = $(includedir)/tinyxcap/tinyxcap
__include_HEADERS = include/tinyxcap/*.h
__include_HEADERS = include/tinyxcap/*.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinyXCAP.pc

Some files were not shown because too many files have changed in this diff Show More