Commit 8809d593 authored by Simon Morlat's avatar Simon Morlat
Browse files

Merge branch 'master' of git.sv.gnu.org:/srv/git/linphone

parents e4d85e56 c1a5f641
......@@ -30,5 +30,15 @@ Steps:
* install to /opt/local
sudo make install
*********************
Using gtk-osx (jhbuild environnment)
After installing jhbuild and get gtk built,
$ jhbuild shell
$ PKG_CONFIG_PATH=/Users/smorlat/gtk/inst/lib/pkgconfig:/opt/local/lib/pkgconfig/ ./configure --disable-video --disable-gtk_ui --disable-strict
......@@ -110,7 +110,7 @@ void update_local_media_description(LinphoneCore *lc, LinphoneCall *call, SalMed
}
SalMediaDescription *create_local_media_description(LinphoneCore *lc, LinphoneCall *call){
unsigned int id=rand();
unsigned int id=rand() & 0xfff;
return _create_local_media_description(lc,call,id,id);
}
......
......@@ -658,6 +658,7 @@ static const char *codec_pref_order[]={
"theora",
"H263-1998",
"H263",
"x-snow",
NULL,
};
......@@ -692,7 +693,10 @@ static MSList *add_missing_codecs(SalStreamType mtype, MSList *l){
}
if (pt && ms_filter_codec_supported(pt->mime_type)){
if (ms_list_find(l,pt)==NULL){
payload_type_set_flag(pt,PAYLOAD_TYPE_ENABLED);
/*do not enable old or experimental codecs by default*/
if (strcasecmp(pt->mime_type,"H263")!=0 && strcasecmp(pt->mime_type,"x-snow")!=0){
payload_type_set_flag(pt,PAYLOAD_TYPE_ENABLED);
}
ms_message("Adding new codec %s/%i with fmtp %s",
pt->mime_type,pt->clock_rate,pt->recv_fmtp ? pt->recv_fmtp : "");
l=ms_list_insert_sorted(l,pt,(int (*)(const void *, const void *))codec_compare);
......@@ -959,7 +963,8 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
linphone_core_assign_payload_type(&payload_type_mp4v,99,"profile-level-id=3");
linphone_core_assign_payload_type(&payload_type_x_snow,100,NULL);
linphone_core_assign_payload_type(&payload_type_h264,102,"profile-level-id=428014");
linphone_core_assign_payload_type(&payload_type_h264,103,"packetization-mode=1;profile-level-id=428014");
/* due to limited space in SDP, we have to disable this h264 line which is normally no more necessary */
/* linphone_core_assign_payload_type(&payload_type_h264,103,"packetization-mode=1;profile-level-id=428014");*/
#endif
ms_init();
......
......@@ -1846,12 +1846,32 @@ int sal_iterate(Sal *sal){
return 0;
}
static void register_set_contact(osip_message_t *msg, const char *contact){
osip_uri_param_t *param = NULL;
osip_contact_t *ct=NULL;
char *line=NULL;
/*we get the line parameter choosed by exosip, and add it to our own contact*/
osip_message_get_contact(msg,0,&ct);
if (ct!=NULL){
osip_uri_uparam_get_byname(ct->url, "line", &param);
if (param && param->gvalue)
line=osip_strdup(param->gvalue);
}
_osip_list_set_empty(&msg->contacts,(void (*)(void*))osip_contact_free);
osip_message_set_contact(msg,contact);
osip_message_get_contact(msg,0,&ct);
osip_uri_uparam_add(ct->url,osip_strdup("line"),line);
}
int sal_register(SalOp *h, const char *proxy, const char *from, int expires){
osip_message_t *msg;
const char *contact=sal_op_get_contact(h);
sal_op_set_route(h,proxy);
if (h->rid==-1){
eXosip_lock();
h->rid=eXosip_register_build_initial_register(from,proxy,sal_op_get_contact(h),expires,&msg);
h->rid=eXosip_register_build_initial_register(from,proxy,NULL,expires,&msg);
if (contact) register_set_contact(msg,contact);
sal_add_register(h->base.root,h);
}else{
eXosip_lock();
......
......@@ -141,7 +141,7 @@ static sdp_message_t *create_generic_sdp(const SalMediaDescription *desc)
osip_strdup (sessid), osip_strdup (sessver),
osip_strdup ("IN"), inet6 ? osip_strdup("IP6") : osip_strdup ("IP4"),
osip_strdup (desc->addr));
sdp_message_s_name_set (local, osip_strdup ("A conversation"));
sdp_message_s_name_set (local, osip_strdup ("Talk"));
if(!sal_media_description_has_dir (desc,SalStreamSendOnly))
{
sdp_message_c_connection_add (local, -1,
......@@ -161,19 +161,32 @@ static sdp_message_t *create_generic_sdp(const SalMediaDescription *desc)
}
static bool_t is_known_rtpmap(const PayloadType *pt){
switch(payload_type_get_number(pt)){
case 0:
case 8:
case 3:
case 34:
return TRUE;
}
return FALSE;
}
static void add_payload(sdp_message_t *msg, int line, const PayloadType *pt)
static void add_payload(sdp_message_t *msg, int line, const PayloadType *pt, bool_t strip_well_known_rtpmaps)
{
char attr[256];
sdp_message_m_payload_add (msg,line, int_2char (payload_type_get_number(pt)));
if (pt->channels>0)
snprintf (attr,sizeof(attr),"%i %s/%i/%i", payload_type_get_number(pt),
pt->mime_type, pt->clock_rate,pt->channels);
else
snprintf (attr,sizeof(attr),"%i %s/%i", payload_type_get_number(pt),
pt->mime_type, pt->clock_rate);
sdp_message_a_attribute_add (msg, line,
osip_strdup ("rtpmap"), osip_strdup(attr));
if (!strip_well_known_rtpmaps || !is_known_rtpmap(pt)){
if (pt->channels>1)
snprintf (attr,sizeof(attr),"%i %s/%i/%i", payload_type_get_number(pt),
pt->mime_type, pt->clock_rate,pt->channels);
else
snprintf (attr,sizeof(attr),"%i %s/%i", payload_type_get_number(pt),
pt->mime_type, pt->clock_rate);
sdp_message_a_attribute_add (msg, line,
osip_strdup ("rtpmap"), osip_strdup(attr));
}
if (pt->recv_fmtp != NULL)
{
......@@ -190,6 +203,7 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription
const char *addr;
const char *dir="sendrecv";
int port;
bool_t strip_well_known_rtpmaps;
switch (desc->type) {
case SalAudio:
......@@ -226,12 +240,14 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription
int_2char(desc->bandwidth));
if (desc->ptime>0) sdp_message_a_attribute_add(msg,lineno,osip_strdup("ptime"),
int_2char(desc->ptime));
strip_well_known_rtpmaps=ms_list_size(desc->payloads)>5;
for(elem=desc->payloads;elem!=NULL;elem=elem->next){
add_payload(msg, lineno, (PayloadType*)elem->data);
add_payload(msg, lineno, (PayloadType*)elem->data,strip_well_known_rtpmaps);
}
switch(desc->dir){
case SalStreamSendRecv:
dir="sendrecv";
/*dir="sendrecv";*/
dir=NULL;
break;
case SalStreamRecvOnly:
dir="recvonly";
......@@ -243,7 +259,7 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription
dir="inactive";
break;
}
sdp_message_a_attribute_add (msg, lineno, osip_strdup (dir),NULL);
if (dir) sdp_message_a_attribute_add (msg, lineno, osip_strdup (dir),NULL);
}
sdp_message_t *media_description_to_sdp(const SalMediaDescription *desc){
......
......@@ -29,6 +29,8 @@ static GtkWidget *log_window=NULL;
static GStaticMutex log_mutex=G_STATIC_MUTEX_INIT;
static GList *log_queue=NULL;
#define LOG_MAX_CHARS 1000000 /*1 mega bytes of traces*/
typedef struct _LinphoneGtkLog{
OrtpLogLevel lev;
gchar *msg;
......@@ -275,6 +277,7 @@ static void linphone_gtk_display_log(OrtpLogLevel lev, const char *msg){
default:
g_error("Bad level !");
}
gtk_text_buffer_get_end_iter(b,&iter);
off=gtk_text_iter_get_offset(&iter);
gtk_text_buffer_insert(b,&iter,lname,-1);
......@@ -288,8 +291,18 @@ static void linphone_gtk_display_log(OrtpLogLevel lev, const char *msg){
gtk_text_buffer_get_iter_at_offset(b,&begin,off);
if (lev==ORTP_ERROR || lev==ORTP_FATAL) gtk_text_buffer_apply_tag_by_name(b,"red",&begin,&iter);
else if (lev==ORTP_WARNING) gtk_text_buffer_apply_tag_by_name(b,"orange",&begin,&iter);
/*
gtk_text_buffer_get_end_iter(b,&iter);
//gtk_text_view_scroll_to_iter(v,&iter,0,FALSE,0,0);
gtk_text_view_scroll_to_iter(v,&iter,0,FALSE,0,0);
*/
while(gtk_text_buffer_get_char_count(b)>LOG_MAX_CHARS){
GtkTextIter iter_line_after;
gtk_text_buffer_get_start_iter(b,&iter);
iter_line_after=iter;
if (gtk_text_iter_forward_line(&iter_line_after)){
gtk_text_buffer_delete(b,&iter,&iter_line_after);
}
}
}
gboolean linphone_gtk_check_logs(){
......
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