From 6a0b67f9b55df4db3b3a7ea70e6eaa560c1fd3da Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 2 Oct 2012 16:51:31 +0200 Subject: [PATCH] add low bandwidth call param --- coreapi/linphonecall.c | 3 +++ coreapi/linphonecore.h | 9 ++++++++- coreapi/misc.c | 2 +- coreapi/private.h | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index a3709669..95bc6210 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -854,6 +854,9 @@ const PayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallP return cp->video_codec; } +bool_t linphone_call_params_low_bandwidth_enabled(const LinphoneCallParams *cp) { + return cp->low_bandwidth; +} /** * Returns whether video is enabled. **/ diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 5196d93d..0209a377 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -204,7 +204,14 @@ bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp); void linphone_call_params_set_audio_bandwidth_limit(LinphoneCallParams *cp, int bw); void linphone_call_params_destroy(LinphoneCallParams *cp); - +/** + * @ingroup call_control + * Use to know if this call has been configured in low bandwidth mode. + * This mode can be automatically discovered thanks to a stun server when activate_edge_workarounds=1 in section [net] of configuration file + *
When enabled, this param may transform a call request with video in audio only mode. + * @return TRUE if low bandwidth has been configured/detected + */ +bool_t linphone_call_params_low_bandwidth_enabled(const LinphoneCallParams *cp); /** * Enum describing failure reasons. * @ingroup initializing diff --git a/coreapi/misc.c b/coreapi/misc.c index 6f7aff69..e85005f2 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -586,7 +586,7 @@ void linphone_core_adapt_to_network(LinphoneCore *lc, int ping_time_ms, Linphone params->up_bw=params->down_bw=edge_bw; params->up_ptime=params->down_ptime=edge_ptime; params->has_video=FALSE; - + params->low_bandwidth=TRUE; }/*else use default settings */ } } diff --git a/coreapi/private.h b/coreapi/private.h index ea21a967..0cefb147 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -79,7 +79,7 @@ struct _LinphoneCallParams{ bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/ bool_t in_conference; /*in conference mode */ bool_t pad; - + bool_t low_bandwidth; }; typedef struct _CallCallbackObj -- 2.39.2