Merge branch 'master' into dev_sal

Conflicts:
	coreapi/linphonecore.h
This commit is contained in:
Simon Morlat 2010-03-15 15:10:42 +01:00
commit 42cf5e94ad
9 changed files with 501 additions and 536 deletions

View file

@ -482,6 +482,10 @@ int linphone_set_audio_offer(sdp_context_t *ctx)
payload.a_rtpmap="telephone-event/8000";
payload.a_fmtp="0-11";
if (lc->dw_audio_bw>0) payload.b_as_bandwidth=lc->dw_audio_bw;
if (lc->down_ptime>0) {
payload.a_ptime=lc->down_ptime;
ms_message("ptime [%i]",payload.a_ptime);
}
sdp_context_add_audio_payload(ctx,&payload);
return 0;
}

View file

@ -89,6 +89,7 @@ static SalMediaDescription *create_local_media_description(LinphoneCore *lc,
md->streams[0].port=linphone_core_get_audio_port(lc);
md->streams[0].proto=SalProtoRtpAvp;
md->streams[0].type=SalAudio;
md->streams[0].ptime=lc->net_conf.down_ptime;
l=make_codec_list(lc->codecs_conf.audio_codecs,only_one_codec);
pt=payload_type_clone(rtp_profile_get_payload_from_mime(&av_profile,"telephone-event"));
l=ms_list_append(l,pt);
@ -494,6 +495,9 @@ net_config_read (LinphoneCore *lc)
lc->net_conf.nat_sdp_only=tmp;
tmp=lp_config_get_int(lc->config,"net","mtu",0);
linphone_core_set_mtu(lc,tmp);
tmp=lp_config_get_int(lc->config,"net","download_ptime",0);
linphone_core_set_download_ptime(lc,tmp);
}
static void build_sound_devices_table(LinphoneCore *lc){
@ -943,6 +947,17 @@ int linphone_core_get_download_bandwidth(const LinphoneCore *lc){
int linphone_core_get_upload_bandwidth(const LinphoneCore *lc){
return lc->net_conf.upload_bw;
}
/**
* set audio packetization time linphone expect to received from peer
*/
void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime) {
lc->net_conf.down_ptime=ptime;
}
int linphone_core_get_download_ptime(LinphoneCore *lc) {
return lc->net_conf.down_ptime;
}
/**
* Returns liblinphone's version as a string.
@ -1045,6 +1060,7 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
lc->vtable.display_status(lc,_("Ready"));
gstate_new_state(lc, GSTATE_POWER_ON, NULL);
lc->auto_net_state_mon=TRUE;
lc->ready=TRUE;
}

View file

@ -450,6 +450,7 @@ typedef struct _LinphoneCore LinphoneCore;
*/
bool_t auto_net_state_mon;
bool_t network_reachable;
int down_ptime;
/* THE main API */
@ -498,7 +499,17 @@ void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);
int linphone_core_get_download_bandwidth(const LinphoneCore *lc);
int linphone_core_get_upload_bandwidth(const LinphoneCore *lc);
/**
* set audio packetization time linphone expect to received from peer
* @ingroup media_parameters
*
*/
void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime);
/**
* get audio packetization time linphone expect to received from peer, 0 means unspecified
* @ingroup media_parameters
*/
int linphone_core_get_download_ptime(LinphoneCore *lc);
#ifdef VINCENT_MAURY_RSVP
/* QoS functions */

View file

@ -279,6 +279,7 @@ typedef struct net_config
int upload_bw;
int firewall_policy;
int mtu;
int down_ptime;
bool_t nat_sdp_only;
}net_config_t;

View file

@ -179,6 +179,8 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription
osip_strdup ("RTP/AVP"));
if (desc->bandwidth>0) sdp_message_b_bandwidth_add (msg, lineno, osip_strdup ("AS"),
int_2char(desc->bandwidth));
if (desc->ptime>0) sdp_message_a_attribute_add(msg,lineno,osip_strdup("ptime"),
int_2char(desc->ptime));
for(elem=desc->payloads;elem!=NULL;elem=elem->next){
add_payload(msg, lineno, (PayloadType*)elem->data);
}

View file

@ -238,6 +238,11 @@ sdp_context_add_payload (sdp_context_t * ctx, sdp_payload_t * payload, char *med
attr_field);
}
}
if (payload->a_ptime !=0) {
attr_field = sstrdup_sprintf ("%i", payload->a_ptime);
sdp_message_a_attribute_add(offer, payload->line,osip_strdup ("ptime"),attr_field);
ms_message("adding ptime [%s]",attr_field);
}
}
void

View file

@ -38,18 +38,36 @@ gboolean linphone_gtk_use_in_call_view(){
void linphone_gtk_show_in_call_view(void){
GtkWidget *main_window=linphone_gtk_get_main_window();
GtkWidget *idle_frame=linphone_gtk_get_widget(main_window,"idle_frame");
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
GtkWidget *in_call_frame=linphone_gtk_get_widget(main_window,"in_call_frame");
gtk_widget_hide(idle_frame);
gint idx;
/* Make the in call frame visible and arrange for the notebook to
show that page */
gtk_widget_show(in_call_frame);
idx = gtk_notebook_page_num(notebook, in_call_frame);
if (idx >= 0) {
gtk_notebook_set_current_page(notebook, idx);
}
}
void linphone_gtk_show_idle_view(void){
GtkWidget *main_window=linphone_gtk_get_main_window();
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
GtkWidget *idle_frame=linphone_gtk_get_widget(main_window,"idle_frame");
GtkWidget *in_call_frame=linphone_gtk_get_widget(main_window,"in_call_frame");
gtk_widget_show(idle_frame);
gtk_widget_hide(in_call_frame);
gint idx;
/* Switch back to the idle frame page, maybe we should have
remembered where we were in gtk_show_in_call_view() to switch
back to that page of the notebook, but this should do in most
cases. */
gtk_widget_show(idle_frame); /* Make sure it is visible... */
idx = gtk_notebook_page_num(notebook, idle_frame);
if (idx >= 0) {
gtk_notebook_set_current_page(notebook, idx);
gtk_widget_hide(in_call_frame);
}
}
void display_peer_name_in_label(GtkWidget *label, const char *uri){
@ -91,13 +109,11 @@ void linphone_gtk_in_call_view_set_calling(const char *uri){
GtkWidget *duration=linphone_gtk_get_widget(main_window,"in_call_duration");
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
GtkWidget *terminate_button=linphone_gtk_get_widget(main_window,"in_call_terminate");
gtk_widget_set_sensitive(terminate_button,TRUE);
gtk_label_set_markup(GTK_LABEL(status),_("<b>Calling...</b>"));
display_peer_name_in_label(callee,uri);
gtk_label_set_text(GTK_LABEL(duration),"00:00:00");
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
if (pbuf!=NULL){
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
g_object_unref(G_OBJECT(pbuf));
@ -112,13 +128,11 @@ void linphone_gtk_in_call_view_set_in_call(){
GtkWidget *duration=linphone_gtk_get_widget(main_window,"in_call_duration");
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
GtkWidget *terminate_button=linphone_gtk_get_widget(main_window,"in_call_terminate");
const LinphoneAddress *uri=linphone_core_get_remote_uri(lc);
char *tmp=linphone_address_as_string(uri);
display_peer_name_in_label(callee,tmp);
ms_free(tmp);
gtk_widget_set_sensitive(terminate_button,TRUE);
gtk_label_set_markup(GTK_LABEL(status),_("<b>In call with</b>"));
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
@ -150,10 +164,8 @@ void linphone_gtk_in_call_view_terminate(const char *error_msg){
GtkWidget *main_window=linphone_gtk_get_main_window();
GtkWidget *status=linphone_gtk_get_widget(main_window,"in_call_status");
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
GtkWidget *terminate_button=linphone_gtk_get_widget(main_window,"in_call_terminate");
GdkPixbuf *pbuf=create_pixbuf(linphone_gtk_get_ui_config("stop_call_icon","red.png"));
gtk_widget_set_sensitive(terminate_button,FALSE);
if (error_msg==NULL)
gtk_label_set_markup(GTK_LABEL(status),_("<b>Call ended.</b>"));
else{
@ -174,11 +186,17 @@ void linphone_gtk_draw_mute_button(GtkToggleButton *button, gboolean active){
if (active){
GtkWidget *image=create_pixmap("mic_muted.png");
gtk_button_set_label(GTK_BUTTON(button),_("Unmute"));
if (image!=NULL) gtk_button_set_image(GTK_BUTTON(button),image);
if (image!=NULL) {
gtk_button_set_image(GTK_BUTTON(button),image);
gtk_widget_show(image);
}
}else{
GtkWidget *image=create_pixmap("mic_active.png");
gtk_button_set_label(GTK_BUTTON(button),_("Mute"));
if (image!=NULL) gtk_button_set_image(GTK_BUTTON(button),image);
if (image!=NULL) {
gtk_button_set_image(GTK_BUTTON(button),image);
gtk_widget_show(image);
}
}
}
@ -190,5 +208,6 @@ void linphone_gtk_mute_toggled(GtkToggleButton *button){
void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive){
gtk_widget_set_sensitive(GTK_WIDGET(button),sensitive);
gtk_object_set(GTK_OBJECT(button),"gtk-button-images",TRUE,NULL);
linphone_gtk_draw_mute_button(button,FALSE);
}

View file

@ -552,7 +552,6 @@ void linphone_gtk_call_terminated(const char *error){
GtkWidget *icw;
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),FALSE);
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"start_call"),TRUE);
gtk_widget_hide_all(linphone_gtk_get_widget(mw,"go_to_call_view_box"));
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"main_mute")),FALSE);
if (linphone_gtk_use_in_call_view())
linphone_gtk_in_call_view_terminate(error);
@ -576,7 +575,6 @@ static gboolean in_call_timer(){
static void linphone_gtk_call_started(GtkWidget *mw){
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"start_call"),FALSE);
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),TRUE);
gtk_widget_show_all(linphone_gtk_get_widget(mw,"go_to_call_view_box"));
update_video_title();
if (linphone_gtk_use_in_call_view())
g_timeout_add(250,(GSourceFunc)in_call_timer,NULL);
@ -1063,7 +1061,6 @@ static void linphone_gtk_configure_main_window(){
if (stop_call_icon){
GdkPixbuf *pbuf=create_pixbuf(stop_call_icon);
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"terminate_call_icon")),pbuf);
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"in_call_terminate_icon")),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
if (search_icon){
@ -1097,6 +1094,8 @@ void linphone_gtk_manage_login(void){
}
static void linphone_gtk_init_main_window(){
GtkWidget *main_window;
linphone_gtk_configure_main_window();
linphone_gtk_manage_login();
load_uri_history();
@ -1105,10 +1104,14 @@ static void linphone_gtk_init_main_window(){
linphone_gtk_show_friends();
linphone_gtk_connect_digits();
linphone_gtk_check_menu_items();
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),
main_window=linphone_gtk_get_main_window();
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,
"main_mute")),FALSE);
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,
"incall_mute")),FALSE);
if (!linphone_gtk_use_in_call_view()) {
gtk_widget_show(linphone_gtk_get_widget(main_window, "main_mute"));
}
if (linphone_core_in_call(linphone_gtk_get_core())) linphone_gtk_call_started(
linphone_gtk_get_main_window());/*hide the call button, show terminate button*/
}

File diff suppressed because it is too large Load diff