Allow setting video fps, bw_up and bw_dow per session.
This commit is contained in:
parent
c79abd37d2
commit
6f2eafef1f
|
@ -503,6 +503,36 @@ bool CallSession::setSTUNCred(const char* username, const char* password)
|
|||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
|
||||
bool CallSession::setVideoFps(int32_t fps)
|
||||
{
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_VIDEO_FPS(fps),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
|
||||
bool CallSession::setVideoBandwidthUploadMax(int32_t max)
|
||||
{
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_VIDEO_BW_UP(max),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
|
||||
bool CallSession::setVideoBandwidthDownloadMax(int32_t max)
|
||||
{
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_VIDEO_BW_DOWN(max),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
|
||||
bool CallSession::setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength)
|
||||
{
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
|
|
|
@ -198,6 +198,9 @@ public: /* Public functions */
|
|||
bool setICETurn(bool enabled);
|
||||
bool setSTUNServer(const char* hostname, uint16_t port);
|
||||
bool setSTUNCred(const char* username, const char* password);
|
||||
bool setVideoFps(int32_t fps);
|
||||
bool setVideoBandwidthUploadMax(int32_t max);
|
||||
bool setVideoBandwidthDownloadMax(int32_t max);
|
||||
bool setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength);
|
||||
bool hold(ActionConfig* config=tsk_null);
|
||||
bool resume(ActionConfig* config=tsk_null);
|
||||
|
|
|
@ -178,6 +178,21 @@ public class CallSession : InviteSession {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public bool setVideoFps(int fps) {
|
||||
bool ret = tinyWRAPPINVOKE.CallSession_setVideoFps(swigCPtr, fps);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool setVideoBandwidthUploadMax(int max) {
|
||||
bool ret = tinyWRAPPINVOKE.CallSession_setVideoBandwidthUploadMax(swigCPtr, max);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool setVideoBandwidthDownloadMax(int max) {
|
||||
bool ret = tinyWRAPPINVOKE.CallSession_setVideoBandwidthDownloadMax(swigCPtr, max);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength) {
|
||||
bool ret = tinyWRAPPINVOKE.CallSession_setQoS(swigCPtr, (int)type, (int)strength);
|
||||
return ret;
|
||||
|
|
|
@ -966,6 +966,15 @@ class tinyWRAPPINVOKE {
|
|||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_setSTUNCred")]
|
||||
public static extern bool CallSession_setSTUNCred(HandleRef jarg1, string jarg2, string jarg3);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_setVideoFps")]
|
||||
public static extern bool CallSession_setVideoFps(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_setVideoBandwidthUploadMax")]
|
||||
public static extern bool CallSession_setVideoBandwidthUploadMax(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_setVideoBandwidthDownloadMax")]
|
||||
public static extern bool CallSession_setVideoBandwidthDownloadMax(HandleRef jarg1, int jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_setQoS")]
|
||||
public static extern bool CallSession_setQoS(HandleRef jarg1, int jarg2, int jarg3);
|
||||
|
||||
|
|
|
@ -4416,6 +4416,48 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_setSTUNCred(void * jarg1,
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_setVideoFps(void * jarg1, int jarg2) {
|
||||
unsigned int jresult ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (CallSession *)jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoFps(arg2);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_setVideoBandwidthUploadMax(void * jarg1, int jarg2) {
|
||||
unsigned int jresult ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (CallSession *)jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoBandwidthUploadMax(arg2);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_setVideoBandwidthDownloadMax(void * jarg1, int jarg2) {
|
||||
unsigned int jresult ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (CallSession *)jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoBandwidthDownloadMax(arg2);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_setQoS(void * jarg1, int jarg2, int jarg3) {
|
||||
unsigned int jresult ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
|
|
@ -147,6 +147,18 @@ public class CallSession extends InviteSession {
|
|||
return tinyWRAPJNI.CallSession_setSTUNCred(swigCPtr, this, username, password);
|
||||
}
|
||||
|
||||
public boolean setVideoFps(int fps) {
|
||||
return tinyWRAPJNI.CallSession_setVideoFps(swigCPtr, this, fps);
|
||||
}
|
||||
|
||||
public boolean setVideoBandwidthUploadMax(int max) {
|
||||
return tinyWRAPJNI.CallSession_setVideoBandwidthUploadMax(swigCPtr, this, max);
|
||||
}
|
||||
|
||||
public boolean setVideoBandwidthDownloadMax(int max) {
|
||||
return tinyWRAPJNI.CallSession_setVideoBandwidthDownloadMax(swigCPtr, this, max);
|
||||
}
|
||||
|
||||
public boolean setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength) {
|
||||
return tinyWRAPJNI.CallSession_setQoS(swigCPtr, this, type.swigValue(), strength.swigValue());
|
||||
}
|
||||
|
|
|
@ -147,6 +147,18 @@ public class CallSession extends InviteSession {
|
|||
return tinyWRAPJNI.CallSession_setSTUNCred(swigCPtr, this, username, password);
|
||||
}
|
||||
|
||||
public boolean setVideoFps(int fps) {
|
||||
return tinyWRAPJNI.CallSession_setVideoFps(swigCPtr, this, fps);
|
||||
}
|
||||
|
||||
public boolean setVideoBandwidthUploadMax(int max) {
|
||||
return tinyWRAPJNI.CallSession_setVideoBandwidthUploadMax(swigCPtr, this, max);
|
||||
}
|
||||
|
||||
public boolean setVideoBandwidthDownloadMax(int max) {
|
||||
return tinyWRAPJNI.CallSession_setVideoBandwidthDownloadMax(swigCPtr, this, max);
|
||||
}
|
||||
|
||||
public boolean setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength) {
|
||||
return tinyWRAPJNI.CallSession_setQoS(swigCPtr, this, type.swigValue(), strength.swigValue());
|
||||
}
|
||||
|
|
|
@ -270,6 +270,9 @@ public class tinyWRAPJNI {
|
|||
public final static native boolean CallSession_setICETurn(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setSTUNServer(long jarg1, CallSession jarg1_, String jarg2, int jarg3);
|
||||
public final static native boolean CallSession_setSTUNCred(long jarg1, CallSession jarg1_, String jarg2, String jarg3);
|
||||
public final static native boolean CallSession_setVideoFps(long jarg1, CallSession jarg1_, int jarg2);
|
||||
public final static native boolean CallSession_setVideoBandwidthUploadMax(long jarg1, CallSession jarg1_, int jarg2);
|
||||
public final static native boolean CallSession_setVideoBandwidthDownloadMax(long jarg1, CallSession jarg1_, int jarg2);
|
||||
public final static native boolean CallSession_setQoS(long jarg1, CallSession jarg1_, int jarg2, int jarg3);
|
||||
public final static native boolean CallSession_hold__SWIG_0(long jarg1, CallSession jarg1_, long jarg2, ActionConfig jarg2_);
|
||||
public final static native boolean CallSession_hold__SWIG_1(long jarg1, CallSession jarg1_);
|
||||
|
|
|
@ -6259,6 +6259,57 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setVideoFps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoFps(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setVideoBandwidthUploadMax(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoBandwidthUploadMax(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setVideoBandwidthDownloadMax(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoBandwidthDownloadMax(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setQoS(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
|
|
@ -270,6 +270,9 @@ public class tinyWRAPJNI {
|
|||
public final static native boolean CallSession_setICETurn(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setSTUNServer(long jarg1, CallSession jarg1_, String jarg2, int jarg3);
|
||||
public final static native boolean CallSession_setSTUNCred(long jarg1, CallSession jarg1_, String jarg2, String jarg3);
|
||||
public final static native boolean CallSession_setVideoFps(long jarg1, CallSession jarg1_, int jarg2);
|
||||
public final static native boolean CallSession_setVideoBandwidthUploadMax(long jarg1, CallSession jarg1_, int jarg2);
|
||||
public final static native boolean CallSession_setVideoBandwidthDownloadMax(long jarg1, CallSession jarg1_, int jarg2);
|
||||
public final static native boolean CallSession_setQoS(long jarg1, CallSession jarg1_, int jarg2, int jarg3);
|
||||
public final static native boolean CallSession_hold__SWIG_0(long jarg1, CallSession jarg1_, long jarg2, ActionConfig jarg2_);
|
||||
public final static native boolean CallSession_hold__SWIG_1(long jarg1, CallSession jarg1_);
|
||||
|
|
|
@ -6259,6 +6259,57 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setVideoFps(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoFps(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setVideoBandwidthUploadMax(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoBandwidthUploadMax(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setVideoBandwidthDownloadMax(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = (int32_t)jarg2;
|
||||
result = (bool)(arg1)->setVideoBandwidthDownloadMax(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setQoS(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
|
|
@ -1064,6 +1064,9 @@ sub DESTROY {
|
|||
*setICETurn = *tinyWRAPc::CallSession_setICETurn;
|
||||
*setSTUNServer = *tinyWRAPc::CallSession_setSTUNServer;
|
||||
*setSTUNCred = *tinyWRAPc::CallSession_setSTUNCred;
|
||||
*setVideoFps = *tinyWRAPc::CallSession_setVideoFps;
|
||||
*setVideoBandwidthUploadMax = *tinyWRAPc::CallSession_setVideoBandwidthUploadMax;
|
||||
*setVideoBandwidthDownloadMax = *tinyWRAPc::CallSession_setVideoBandwidthDownloadMax;
|
||||
*setQoS = *tinyWRAPc::CallSession_setQoS;
|
||||
*hold = *tinyWRAPc::CallSession_hold;
|
||||
*resume = *tinyWRAPc::CallSession_resume;
|
||||
|
|
|
@ -12418,6 +12418,120 @@ XS(_wrap_CallSession_setSTUNCred) {
|
|||
}
|
||||
|
||||
|
||||
XS(_wrap_CallSession_setVideoFps) {
|
||||
{
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: CallSession_setVideoFps(self,fps);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setVideoFps" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(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 '" "CallSession_setVideoFps" "', argument " "2"" of type '" "int32_t""'");
|
||||
}
|
||||
arg2 = static_cast< int32_t >(val2);
|
||||
result = (bool)(arg1)->setVideoFps(arg2);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_CallSession_setVideoBandwidthUploadMax) {
|
||||
{
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: CallSession_setVideoBandwidthUploadMax(self,max);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setVideoBandwidthUploadMax" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(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 '" "CallSession_setVideoBandwidthUploadMax" "', argument " "2"" of type '" "int32_t""'");
|
||||
}
|
||||
arg2 = static_cast< int32_t >(val2);
|
||||
result = (bool)(arg1)->setVideoBandwidthUploadMax(arg2);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_CallSession_setVideoBandwidthDownloadMax) {
|
||||
{
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: CallSession_setVideoBandwidthDownloadMax(self,max);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setVideoBandwidthDownloadMax" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(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 '" "CallSession_setVideoBandwidthDownloadMax" "', argument " "2"" of type '" "int32_t""'");
|
||||
}
|
||||
arg2 = static_cast< int32_t >(val2);
|
||||
result = (bool)(arg1)->setVideoBandwidthDownloadMax(arg2);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_CallSession_setQoS) {
|
||||
{
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
@ -27972,6 +28086,9 @@ static swig_command_info swig_commands[] = {
|
|||
{"tinyWRAPc::CallSession_setICETurn", _wrap_CallSession_setICETurn},
|
||||
{"tinyWRAPc::CallSession_setSTUNServer", _wrap_CallSession_setSTUNServer},
|
||||
{"tinyWRAPc::CallSession_setSTUNCred", _wrap_CallSession_setSTUNCred},
|
||||
{"tinyWRAPc::CallSession_setVideoFps", _wrap_CallSession_setVideoFps},
|
||||
{"tinyWRAPc::CallSession_setVideoBandwidthUploadMax", _wrap_CallSession_setVideoBandwidthUploadMax},
|
||||
{"tinyWRAPc::CallSession_setVideoBandwidthDownloadMax", _wrap_CallSession_setVideoBandwidthDownloadMax},
|
||||
{"tinyWRAPc::CallSession_setQoS", _wrap_CallSession_setQoS},
|
||||
{"tinyWRAPc::CallSession_hold", _wrap_CallSession_hold},
|
||||
{"tinyWRAPc::CallSession_resume", _wrap_CallSession_resume},
|
||||
|
|
|
@ -993,6 +993,9 @@ class CallSession(InviteSession):
|
|||
def setICETurn(self, *args): return _tinyWRAP.CallSession_setICETurn(self, *args)
|
||||
def setSTUNServer(self, *args): return _tinyWRAP.CallSession_setSTUNServer(self, *args)
|
||||
def setSTUNCred(self, *args): return _tinyWRAP.CallSession_setSTUNCred(self, *args)
|
||||
def setVideoFps(self, *args): return _tinyWRAP.CallSession_setVideoFps(self, *args)
|
||||
def setVideoBandwidthUploadMax(self, *args): return _tinyWRAP.CallSession_setVideoBandwidthUploadMax(self, *args)
|
||||
def setVideoBandwidthDownloadMax(self, *args): return _tinyWRAP.CallSession_setVideoBandwidthDownloadMax(self, *args)
|
||||
def setQoS(self, *args): return _tinyWRAP.CallSession_setQoS(self, *args)
|
||||
def hold(self, *args): return _tinyWRAP.CallSession_hold(self, *args)
|
||||
def resume(self, *args): return _tinyWRAP.CallSession_resume(self, *args)
|
||||
|
|
|
@ -13629,6 +13629,99 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_CallSession_setVideoFps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:CallSession_setVideoFps",&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setVideoFps" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(argp1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CallSession_setVideoFps" "', argument " "2"" of type '" "int32_t""'");
|
||||
}
|
||||
arg2 = static_cast< int32_t >(val2);
|
||||
result = (bool)(arg1)->setVideoFps(arg2);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_CallSession_setVideoBandwidthUploadMax(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:CallSession_setVideoBandwidthUploadMax",&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setVideoBandwidthUploadMax" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(argp1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CallSession_setVideoBandwidthUploadMax" "', argument " "2"" of type '" "int32_t""'");
|
||||
}
|
||||
arg2 = static_cast< int32_t >(val2);
|
||||
result = (bool)(arg1)->setVideoBandwidthUploadMax(arg2);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_CallSession_setVideoBandwidthDownloadMax(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
int32_t arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:CallSession_setVideoBandwidthDownloadMax",&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setVideoBandwidthDownloadMax" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(argp1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CallSession_setVideoBandwidthDownloadMax" "', argument " "2"" of type '" "int32_t""'");
|
||||
}
|
||||
arg2 = static_cast< int32_t >(val2);
|
||||
result = (bool)(arg1)->setVideoBandwidthDownloadMax(arg2);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_CallSession_setQoS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
@ -26381,6 +26474,9 @@ static PyMethodDef SwigMethods[] = {
|
|||
{ (char *)"CallSession_setICETurn", _wrap_CallSession_setICETurn, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setSTUNServer", _wrap_CallSession_setSTUNServer, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setSTUNCred", _wrap_CallSession_setSTUNCred, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setVideoFps", _wrap_CallSession_setVideoFps, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setVideoBandwidthUploadMax", _wrap_CallSession_setVideoBandwidthUploadMax, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setVideoBandwidthDownloadMax", _wrap_CallSession_setVideoBandwidthDownloadMax, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setQoS", _wrap_CallSession_setQoS, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_hold", _wrap_CallSession_hold, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_resume", _wrap_CallSession_resume, METH_VARARGS, NULL},
|
||||
|
|
|
@ -61,6 +61,7 @@ typedef struct tdav_session_av_s
|
|||
|
||||
int32_t bandwidth_max_upload_kbps;
|
||||
int32_t bandwidth_max_download_kbps;
|
||||
int32_t fps;
|
||||
tsk_bool_t congestion_ctrl_enabled;
|
||||
|
||||
/* sdp capabilities (RFC 5939) */
|
||||
|
@ -127,6 +128,7 @@ int tdav_session_av_init(tdav_session_av_t* self, tmedia_type_t media_type);
|
|||
tsk_bool_t tdav_session_av_set(tdav_session_av_t* self, const struct tmedia_param_s* param);
|
||||
tsk_bool_t tdav_session_av_get(tdav_session_av_t* self, struct tmedia_param_s* param);
|
||||
int tdav_session_av_prepare(tdav_session_av_t* self);
|
||||
int tdav_session_av_init_encoder(tdav_session_av_t* self, struct tmedia_codec_s* encoder);
|
||||
int tdav_session_av_start(tdav_session_av_t* self, const struct tmedia_codec_s* best_codec);
|
||||
int tdav_session_av_stop(tdav_session_av_t* self);
|
||||
int tdav_session_av_pause(tdav_session_av_t* self);
|
||||
|
|
|
@ -134,7 +134,7 @@ static int tdav_codec_h264_set(tmedia_codec_t* self, const tmedia_param_t* param
|
|||
return 0;
|
||||
}
|
||||
else if(tsk_striequals(param->key, "bw_kbps")){
|
||||
int32_t max_bw_userdefine = tmedia_defaults_get_bandwidth_video_upload_max();
|
||||
int32_t max_bw_userdefine = self->bandwidth_max_upload;
|
||||
int32_t max_bw_new = *((int32_t*)param->value);
|
||||
if (max_bw_userdefine > 0) {
|
||||
// do not use more than what the user defined in it's configuration
|
||||
|
@ -675,7 +675,6 @@ 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");
|
||||
|
@ -706,12 +705,12 @@ 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;
|
||||
max_bw_kpbs = TSK_CLAMP(
|
||||
self->encoder.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
|
||||
TMEDIA_CODEC(self)->bandwidth_max_upload
|
||||
);
|
||||
self->encoder.context->bit_rate = (max_bw_kpbs * 1024);// bps
|
||||
self->encoder.context->bit_rate = (self->encoder.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;
|
||||
|
@ -914,7 +913,7 @@ int tdav_codec_h264_init(tdav_codec_h264_t* self, profile_idc_t profile)
|
|||
return ret;
|
||||
}
|
||||
|
||||
(self)->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
|
||||
(self)->encoder.max_bw_kpbs = TMEDIA_CODEC(self)->bandwidth_max_upload;
|
||||
TDAV_CODEC_H264_COMMON(self)->pack_mode_local = H264_PACKETIZATION_MODE;
|
||||
TDAV_CODEC_H264_COMMON(self)->profile = profile;
|
||||
TDAV_CODEC_H264_COMMON(self)->level = level;
|
||||
|
|
|
@ -60,8 +60,6 @@ typedef struct tdav_codec_h264_cisco_s
|
|||
int neg_width;
|
||||
int neg_height;
|
||||
int neg_fps;
|
||||
int max_bitrate_bps;
|
||||
int32_t max_bw_kpbs;
|
||||
tsk_mutex_handle_t* mutex;
|
||||
} encoder;
|
||||
|
||||
|
@ -606,7 +604,7 @@ const tmedia_codec_plugin_def_t *tdav_codec_h264_cisco_base_plugin_def_t = &tdav
|
|||
|
||||
static int tdav_codec_h264_cisco_open_encoder(tdav_codec_h264_cisco_t* self)
|
||||
{
|
||||
int ret = -1;
|
||||
int ret = -1, max_bitrate_bps;
|
||||
long err;
|
||||
SSpatialLayerConfig* layer;
|
||||
|
||||
|
@ -637,16 +635,16 @@ static int tdav_codec_h264_cisco_open_encoder(tdav_codec_h264_cisco_t* self)
|
|||
self->encoder.neg_fps = TMEDIA_CODEC_VIDEO(self)->out.fps;
|
||||
max_bw_kpbs = TSK_CLAMP(
|
||||
0,
|
||||
tmedia_get_video_bandwidth_kbps_2(self->encoder.neg_width, self->encoder.neg_height, self->encoder.neg_fps),
|
||||
self->encoder.max_bw_kpbs
|
||||
tmedia_get_video_bandwidth_kbps_2(self->encoder.neg_width, self->encoder.neg_height, self->encoder.neg_fps),
|
||||
TMEDIA_CODEC(self)->bandwidth_max_upload
|
||||
);
|
||||
self->encoder.max_bitrate_bps = (max_bw_kpbs * 1024);
|
||||
max_bitrate_bps = (max_bw_kpbs * 1024);
|
||||
|
||||
TSK_DEBUG_INFO("[H.264 OpenH264 Encoder] neg_width=%d, neg_height=%d, neg_fps=%d, max_bitrate_bps=%d",
|
||||
self->encoder.neg_width,
|
||||
self->encoder.neg_height,
|
||||
self->encoder.neg_fps,
|
||||
self->encoder.max_bitrate_bps
|
||||
max_bitrate_bps
|
||||
);
|
||||
|
||||
self->encoder.sEncParam.iInputCsp = videoFormatI420;
|
||||
|
@ -656,8 +654,8 @@ static int tdav_codec_h264_cisco_open_encoder(tdav_codec_h264_cisco_t* self)
|
|||
self->encoder.sEncParam.iUsageType = CAMERA_VIDEO_REAL_TIME; // TODO: use "SCREEN_CONTENT_REAL_TIME" screencast
|
||||
self->encoder.sEncParam.iPicWidth = self->encoder.neg_width;
|
||||
self->encoder.sEncParam.iPicHeight = self->encoder.neg_height;
|
||||
self->encoder.sEncParam.iTargetBitrate = self->encoder.max_bitrate_bps;
|
||||
self->encoder.sEncParam.iMaxBitrate = self->encoder.max_bitrate_bps;
|
||||
self->encoder.sEncParam.iTargetBitrate = max_bitrate_bps;
|
||||
self->encoder.sEncParam.iMaxBitrate = max_bitrate_bps;
|
||||
self->encoder.sEncParam.fMaxFrameRate = (float)self->encoder.neg_fps;
|
||||
self->encoder.sEncParam.uiMaxNalSize = H264_RTP_PAYLOAD_SIZE;
|
||||
self->encoder.sEncParam.bEnableSpsPpsIdAddition = true;
|
||||
|
@ -809,7 +807,6 @@ static int tdav_codec_h264_cisco_init(tdav_codec_h264_cisco_t* self, profile_idc
|
|||
goto bail;
|
||||
}
|
||||
|
||||
(self)->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
|
||||
common->pack_mode_local = H264_PACKETIZATION_MODE;
|
||||
common->profile = profile;
|
||||
common->level = level;
|
||||
|
@ -819,7 +816,7 @@ static int tdav_codec_h264_cisco_init(tdav_codec_h264_cisco_t* self, profile_idc
|
|||
common->profile_iop = 0xe0; // "constraint_set0_flag=1 and constraint_set1_flag=1" -> Constrained Baseline profile
|
||||
TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
|
||||
TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
|
||||
|
||||
|
||||
TMEDIA_CODEC_VIDEO(self)->in.chroma = tmedia_chroma_yuv420p;
|
||||
TMEDIA_CODEC_VIDEO(self)->out.chroma = tmedia_chroma_yuv420p;
|
||||
|
||||
|
|
|
@ -115,7 +115,6 @@ typedef struct tdav_codec_h264_intel_s
|
|||
int neg_height;
|
||||
int neg_fps;
|
||||
int max_bitrate_bps;
|
||||
int32_t max_bw_kpbs;
|
||||
} encoder;
|
||||
|
||||
// decoder
|
||||
|
@ -464,7 +463,7 @@ public:
|
|||
max_bw_kpbs = TSK_CLAMP(
|
||||
0,
|
||||
tmedia_get_video_bandwidth_kbps_2(pWrappedCodec->encoder.neg_width, pWrappedCodec->encoder.neg_height, pWrappedCodec->encoder.neg_fps),
|
||||
pWrappedCodec->encoder.max_bw_kpbs
|
||||
TMEDIA_CODEC(pWrappedCodec)->bandwidth_max_upload
|
||||
);
|
||||
pWrappedCodec->encoder.max_bitrate_bps = (max_bw_kpbs * 1024);
|
||||
|
||||
|
@ -1704,7 +1703,6 @@ static int tdav_codec_h264_intel_init(tdav_codec_h264_intel_t* self, profile_idc
|
|||
goto bail;
|
||||
}
|
||||
|
||||
(self)->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
|
||||
if (/*MFUtils::IsLowLatencyH264SupportsMaxSliceSize()*/0) { // TODO: MSDK doesn't support PM=0. Neg. PM=1 but try to do the best to produce SingleNalUnits
|
||||
common->pack_mode_local = H264_PACKETIZATION_MODE;
|
||||
}
|
||||
|
|
|
@ -85,9 +85,7 @@ typedef struct tdav_codec_vp8_s
|
|||
unsigned pic_id:15;
|
||||
uint64_t frame_count;
|
||||
tsk_bool_t force_idr;
|
||||
uint32_t target_bitrate;
|
||||
int rotation;
|
||||
int32_t max_bw_kpbs;
|
||||
|
||||
struct{
|
||||
uint8_t* ptr;
|
||||
|
@ -618,7 +616,6 @@ static tsk_object_t* tdav_codec_vp8_ctor(tsk_object_t * self, va_list * app)
|
|||
if(vp8){
|
||||
/* init base: called by tmedia_codec_create() */
|
||||
/* init self */
|
||||
vp8->encoder.max_bw_kpbs = tmedia_defaults_get_bandwidth_video_upload_max();
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -706,10 +703,10 @@ int tdav_codec_vp8_open_encoder(tdav_codec_vp8_t* self)
|
|||
}
|
||||
self->encoder.cfg.g_timebase.num = 1;
|
||||
self->encoder.cfg.g_timebase.den = TMEDIA_CODEC_VIDEO(self)->out.fps;
|
||||
self->encoder.cfg.rc_target_bitrate = self->encoder.target_bitrate = TSK_CLAMP(
|
||||
self->encoder.cfg.rc_target_bitrate = 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
|
||||
TMEDIA_CODEC(self)->bandwidth_max_upload
|
||||
);
|
||||
self->encoder.cfg.g_w = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.height : TMEDIA_CODEC_VIDEO(self)->out.width;
|
||||
self->encoder.cfg.g_h = (self->encoder.rotation == 90 || self->encoder.rotation == 270) ? TMEDIA_CODEC_VIDEO(self)->out.width : TMEDIA_CODEC_VIDEO(self)->out.height;
|
||||
|
@ -781,7 +778,7 @@ int tdav_codec_vp8_open_encoder(tdav_codec_vp8_t* self)
|
|||
#endif
|
||||
|
||||
|
||||
TSK_DEBUG_INFO("[VP8] target_bitrate=%d kbps", self->encoder.target_bitrate);
|
||||
TSK_DEBUG_INFO("[VP8] target_bitrate=%d kbps", self->encoder.cfg.rc_target_bitrate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -225,6 +225,7 @@ 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->avpf_mode_set = self->avpf_mode_neg = tmedia_defaults_get_avpf_mode();
|
||||
self->fps = -1; // use what is negotiated by the codec unless overrided by the user
|
||||
self->bandwidth_max_upload_kbps = ((media_type & tmedia_video || (media_type & tmedia_bfcp_video) == tmedia_bfcp_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 || (media_type & tmedia_bfcp_video) == tmedia_bfcp_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
|
||||
|
@ -345,6 +346,18 @@ tsk_bool_t tdav_session_av_set(tdav_session_av_t* self, const tmedia_param_t* pa
|
|||
self->is_webrtc2sip_mode_enabled = (TSK_TO_INT32((uint8_t*)param->value) != 0);
|
||||
return tsk_true;
|
||||
}
|
||||
else if (tsk_striequals(param->key, "bandwidth-max-upload")) {
|
||||
self->bandwidth_max_upload_kbps = TSK_TO_INT32((uint8_t*)param->value);
|
||||
return tsk_true;
|
||||
}
|
||||
else if (tsk_striequals(param->key, "bandwidth-max-download")) {
|
||||
self->bandwidth_max_download_kbps = TSK_TO_INT32((uint8_t*)param->value);
|
||||
return tsk_true;
|
||||
}
|
||||
else if (tsk_striequals(param->key, "fps")) {
|
||||
self->fps = TSK_TO_INT32((uint8_t*)param->value);
|
||||
return tsk_true;
|
||||
}
|
||||
}
|
||||
else if(param->value_type == tmedia_pvt_pobject){
|
||||
if(tsk_striequals(param->key, "natt-ctx")){
|
||||
|
@ -414,6 +427,23 @@ tsk_bool_t tdav_session_av_get(tdav_session_av_t* self, tmedia_param_t* param)
|
|||
return tsk_false;
|
||||
}
|
||||
|
||||
int tdav_session_av_init_encoder(tdav_session_av_t* self, struct tmedia_codec_s* encoder)
|
||||
{
|
||||
if (!self || !encoder) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return -1;
|
||||
}
|
||||
encoder->bandwidth_max_upload = self->bandwidth_max_upload_kbps;
|
||||
encoder->bandwidth_max_download = self->bandwidth_max_download_kbps;
|
||||
if ((encoder->type & tmedia_video) || (encoder->type & tmedia_bfcp_video)) {
|
||||
if (self->fps > 0) {
|
||||
tmedia_codec_video_t* video = TMEDIA_CODEC_VIDEO(encoder);
|
||||
video->out.fps = self->fps;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tdav_session_av_prepare(tdav_session_av_t* self)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
@ -732,11 +732,11 @@ int _tdav_session_video_open_decoder(tdav_session_video_t* self, uint8_t payload
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if((self->decoder.codec_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);
|
||||
if(!(self->decoder.codec = tmedia_codec_find_by_format(TMEDIA_SESSION(self)->neg_codecs, format)) || !self->decoder.codec->plugin || !self->decoder.codec->plugin->decode){
|
||||
if (!(self->decoder.codec = tmedia_codec_find_by_format(TMEDIA_SESSION(self)->neg_codecs, format)) || !self->decoder.codec->plugin || !self->decoder.codec->plugin->decode) {
|
||||
TSK_DEBUG_ERROR("%s is not a valid payload for this session", format);
|
||||
ret = -2;
|
||||
goto bail;
|
||||
|
@ -745,8 +745,8 @@ int _tdav_session_video_open_decoder(tdav_session_video_t* self, uint8_t payload
|
|||
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){
|
||||
if((ret = tmedia_codec_open(self->decoder.codec))){
|
||||
if (!TMEDIA_CODEC(self->decoder.codec)->opened){
|
||||
if ((ret = tmedia_codec_open(self->decoder.codec))) {
|
||||
TSK_DEBUG_ERROR("Failed to open [%s] codec", self->decoder.codec->plugin->desc);
|
||||
goto bail;
|
||||
}
|
||||
|
@ -1045,7 +1045,6 @@ static int tdav_session_video_start(tmedia_session_t* self)
|
|||
tdav_session_video_t* video;
|
||||
const tmedia_codec_t* codec;
|
||||
tdav_session_av_t* base;
|
||||
tmedia_param_t* media_param;
|
||||
|
||||
if (!self) {
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
|
@ -1063,10 +1062,10 @@ static int tdav_session_video_start(tmedia_session_t* self)
|
|||
tsk_mutex_lock(video->encoder.h_mutex);
|
||||
TSK_OBJECT_SAFE_FREE(video->encoder.codec);
|
||||
video->encoder.codec = tsk_object_ref((tsk_object_t*)codec);
|
||||
// forward up bandwidth info to the codec
|
||||
if ((media_param = tmedia_param_create(tmedia_pat_set, tmedia_video, tmedia_ppt_codec, tmedia_pvt_int32, "bw_kbps", (void*)&base->bandwidth_max_upload_kbps))) {
|
||||
tmedia_codec_set(TMEDIA_CODEC(video->encoder.codec), media_param);
|
||||
TSK_OBJECT_SAFE_FREE(media_param);
|
||||
// initialize the encoder using user-defined values
|
||||
if ((ret = tdav_session_av_init_encoder(base, video->encoder.codec))) {
|
||||
TSK_DEBUG_ERROR("Failed to initialize the encoder [%s] codec", video->encoder.codec->plugin->desc);
|
||||
return ret;
|
||||
}
|
||||
if (!TMEDIA_CODEC(video->encoder.codec)->opened) {
|
||||
if((ret = tmedia_codec_open(video->encoder.codec))){
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
Optimization="3"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\thirdparties\common\include;..\thirdparties\win32\include;include;..\tinyMSRP\include;..\tinyRTP\include;..\tinyMEDIA\include;..\tinyBFCP\include;..\tinySDP\include;..\tinyIPSec\src;..\tinyNET\src;..\tinySAK\src;..\thirdparties\win32\include\BroadVoice16\bvcommon;..\thirdparties\win32\include\BroadVoice16\bv16"
|
||||
PreprocessorDefinitions="DEBUG_LEVEL=DEBUG_LEVEL_WARN;WIN32;NDEBUG;_WINDOWS;_USRDLL;TINYDAV_EXPORTS;HAVE_SRTP=1;HAVE_G729=0;HAVE_BV16=0;HAVE_H264=1;HAVE_OPENH264=1;HAVE_OPENCORE_AMR=1;HAVE_ILBC=0;HAVE_LIBGSM=1;HAVE_LIBOPUS=1;HAVE_DSOUND_H=1;HAVE_WAVE_API=1;HAVE_FFMPEG=1;HAVE_WEBRTC=1;HAVE_SPEEX_DSP=1;HAVE_SPEEX_JB=1;HAVE_LIB_SPEEX=1;HAVE_LIBVPX=1;HAVE_LIBYUV=1;G192BITSTREAM=0;_WIN32_WINNT=0x0501"
|
||||
PreprocessorDefinitions="DEBUG_LEVEL=DEBUG_LEVEL_WARN;WIN32;NDEBUG;_WINDOWS;_USRDLL;TINYDAV_EXPORTS;HAVE_SRTP=1;HAVE_G729=0;HAVE_BV16=0;HAVE_H264=1;HAVE_OPENH264=1;HAVE_OPENCORE_AMR=0;HAVE_ILBC=0;HAVE_LIBGSM=1;HAVE_LIBOPUS=1;HAVE_DSOUND_H=1;HAVE_WAVE_API=1;HAVE_FFMPEG=0;HAVE_WEBRTC=1;HAVE_SPEEX_DSP=1;HAVE_SPEEX_JB=1;HAVE_LIB_SPEEX=1;HAVE_LIBVPX=1;HAVE_LIBYUV=1;G192BITSTREAM=0;_WIN32_WINNT=0x0501"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="false"
|
||||
UsePrecompiledHeader="0"
|
||||
|
@ -686,6 +686,10 @@
|
|||
RelativePath=".\src\codecs\h264\tdav_codec_h264_cuda.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\codecs\h264\tdav_codec_h264_intel.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\codecs\h264\tdav_codec_h264_rtp.c"
|
||||
>
|
||||
|
|
|
@ -122,6 +122,10 @@ typedef enum tsip_msession_param_type_e
|
|||
mstype_set_stun_server,
|
||||
mstype_set_stun_cred,
|
||||
|
||||
mstype_set_video_fps,
|
||||
mstype_set_video_bw_up,
|
||||
mstype_set_video_bw_down,
|
||||
|
||||
mstype_set_qos,
|
||||
mstype_unset_qos,
|
||||
|
||||
|
@ -152,6 +156,9 @@ tsip_msession_param_type_t;
|
|||
#define TSIP_MSESSION_SET_STUN_CRED(USERNAME, PASSWORD) mstype_set_stun_cred, (const char*)USERNAME, (const char*)PASSWORD
|
||||
#define TSIP_MSESSION_SET_QOS(TYPE_ENUM, STRENGTH_ENUM) mstype_set_qos, (tmedia_qos_stype_t)TYPE_ENUM, (tmedia_qos_strength_t)STRENGTH_ENUM
|
||||
#define TSIP_MSESSION_UNSET_QOS() mstype_unset_qos
|
||||
#define TSIP_MSESSION_SET_VIDEO_FPS(FPS_INT) mstype_set_video_fps, (int32_t)FPS_INT
|
||||
#define TSIP_MSESSION_SET_VIDEO_BW_UP(BW_INT) mstype_set_video_bw_up, (int32_t)(BW_INT)
|
||||
#define TSIP_MSESSION_SET_VIDEO_BW_DOWN(BW_INT) mstype_set_video_bw_down, (int32_t)(BW_INT)
|
||||
#define TSIP_MSESSION_SET_TIMERS(TIMEOUT_UINT, REFRESHER_STR) mstype_set_timers, (unsigned)TIMEOUT_UINT, (const char*)REFRESHER_STR
|
||||
#define TSIP_MSESSION_UNSET_TIMERS() mstype_unset_timers
|
||||
#define TSIP_MSESSION_SET_CODECS(CODECS_INT) mstype_set_codecs, (signed)CODECS_INT
|
||||
|
@ -216,6 +223,11 @@ typedef struct tsip_ssession_s
|
|||
tsk_bool_t bypass_encoding;
|
||||
tsk_bool_t bypass_decoding;
|
||||
|
||||
/* Video */
|
||||
int32_t video_fps;
|
||||
int32_t video_bw_up;
|
||||
int32_t video_bw_down;
|
||||
|
||||
/* RTP*/
|
||||
struct{
|
||||
struct{
|
||||
|
|
|
@ -1103,6 +1103,10 @@ int tsip_dialog_invite_msession_configure(tsip_dialog_invite_t *self)
|
|||
TMEDIA_SESSION_SET_STR(self->msession_mgr->type, "dtls-file-pvk", TSIP_DIALOG_GET_STACK(self)->security.tls.pvk),
|
||||
TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "dtls-cert-verify", TSIP_DIALOG_GET_STACK(self)->security.tls.verify),
|
||||
|
||||
TMEDIA_SESSION_SET_INT32(tmedia_video, "fps", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_fps),
|
||||
TMEDIA_SESSION_SET_INT32(tmedia_video, "bandwidth-max-upload", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_bw_up),
|
||||
TMEDIA_SESSION_SET_INT32(tmedia_video, "bandwidth-max-download", ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.video_bw_down),
|
||||
|
||||
tsk_null);
|
||||
}
|
||||
|
||||
|
|
|
@ -368,6 +368,21 @@ int __tsip_ssession_set(tsip_ssession_t *self, va_list *app)
|
|||
tsk_strupdate(&self->media.stun.password, PASSWORD);
|
||||
break;
|
||||
}
|
||||
case mstype_set_video_fps:
|
||||
{/* (signed)FPS_INT */
|
||||
self->media.video_fps = va_arg(*app, signed);
|
||||
break;
|
||||
}
|
||||
case mstype_set_video_bw_up:
|
||||
{/* (signed)BW_INT */
|
||||
self->media.video_bw_up = va_arg(*app, signed);
|
||||
break;
|
||||
}
|
||||
case mstype_set_video_bw_down:
|
||||
{/* (signed)BW_INT */
|
||||
self->media.video_bw_down = va_arg(*app, signed);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
/* va_list will be unsafe => exit */
|
||||
TSK_DEBUG_ERROR("%d NOT a valid MEDIA pname", mscurr);
|
||||
|
@ -683,6 +698,9 @@ static tsk_object_t* tsip_ssession_ctor(tsk_object_t * self, va_list * app)
|
|||
ss->media.codecs = tmedia_codec_id_all;
|
||||
ss->media.bypass_encoding = tmedia_defaults_get_bypass_encoding();
|
||||
ss->media.bypass_decoding = tmedia_defaults_get_bypass_decoding();
|
||||
ss->media.video_fps = tmedia_defaults_get_video_fps();
|
||||
ss->media.video_bw_down = tmedia_defaults_get_bandwidth_video_download_max();
|
||||
ss->media.video_bw_up = tmedia_defaults_get_bandwidth_video_upload_max();
|
||||
{
|
||||
const char *stun_hostname, *stun_username, *stun_password;
|
||||
uint16_t stun_port;
|
||||
|
|
Loading…
Reference in New Issue