Commit 36df948b authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added expected_bandwidth parameter

parent b3b1d63b
......@@ -4791,6 +4791,9 @@ void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index){
if (ms) handle_ice_events(call, ev);
} else if (evt==ORTP_EVENT_TELEPHONE_EVENT){
linphone_core_dtmf_received(call,evd->info.telephone_event);
} else if (evt == ORTP_EVENT_NEW_VIDEO_BANDWIDTH_ESTIMATION_AVAILABLE) {
ms_message("Video bandwidth estimation is %i kbit/s", (int)evd->info.video_bandwidth_available / 1000);
//TODO
}
ortp_event_destroy(ev);
}
......
......@@ -1054,6 +1054,8 @@ static void net_config_read(LinphoneCore *lc) {
linphone_core_set_download_bandwidth(lc,tmp);
tmp=lp_config_get_int(config,"net","upload_bw",0);
linphone_core_set_upload_bandwidth(lc,tmp);
tmp=lp_config_get_int(config, "net", "expected_bw", 0);
linphone_core_set_expected_bandwidth(lc, tmp);
tmpstr=lp_config_get_string(lc->config,"net","nat_address",NULL);
if (tmpstr!=NULL && (strlen(tmpstr)<1)) tmpstr=NULL;
......@@ -1814,6 +1816,11 @@ void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw){
if (linphone_core_ready(lc)) lp_config_set_int(lc->config,"net","upload_bw",bw);
}
void linphone_core_set_expected_bandwidth(LinphoneCore *lc, int bw){
ms_factory_set_expected_bandwidth(lc->factory, bw * 1000); // In linphone we use kbits/s, in ms2 bits/s
if (linphone_core_ready(lc)) lp_config_set_int(lc->config,"net","expected_bw",bw);
}
void linphone_core_set_sip_transport_timeout(LinphoneCore *lc, int timeout_ms) {
sal_set_transport_timeout(lc->sal, timeout_ms);
if (linphone_core_ready(lc))
......@@ -1855,6 +1862,7 @@ int linphone_core_get_download_bandwidth(const LinphoneCore *lc){
int linphone_core_get_upload_bandwidth(const LinphoneCore *lc){
return lc->net_conf.upload_bw;
}
void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime) {
lp_config_set_int(lc->config,"rtp","download_ptime",ptime);
}
......
......@@ -1467,6 +1467,19 @@ LINPHONE_PUBLIC void linphone_core_set_download_bandwidth(LinphoneCore *lc, int
*/
LINPHONE_PUBLIC void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);
/**
* Sets expected available upload bandwidth
* This is IP bandwidth, in kbit/s.
* This information is used by liblinphone together with remote
* side available bandwidth signaled in SDP messages to properly
* configure audio & video codec's output bitrate.
*
* @param lc the LinphoneCore object
* @param bw the bandwidth in kbits/s, 0 for infinite
* @ingroup media_parameters
*/
LINPHONE_PUBLIC void linphone_core_set_expected_bandwidth(LinphoneCore *lc, int bw);
/**
* Retrieve the maximum available download bandwidth.
* This value was set by linphone_core_set_download_bandwidth().
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment