From c519c4a6675d137a59f8d8eceb8055ccfc36f351 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Thu, 31 Mar 2011 10:50:41 +0200 Subject: [PATCH 1/5] Conditionnal compilation of x264 for Android. --- build/android/Android.mk | 15 +++++++++++---- coreapi/linphonecore_jni.cc | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/build/android/Android.mk b/build/android/Android.mk index 48a4c75be..c2c13beb9 100755 --- a/build/android/Android.mk +++ b/build/android/Android.mk @@ -59,10 +59,13 @@ LOCAL_CFLAGS += \ LOCAL_CFLAGS += -DIN_LINPHONE + ifeq ($(LINPHONE_VIDEO),1) LOCAL_CFLAGS += -DVIDEO_ENABLED +ifeq ($(BUILD_X264),1) +LOCAL_CFLAGS += -DHAVE_X264 +endif endif - LOCAL_C_INCLUDES += \ $(LOCAL_PATH) \ $(LOCAL_PATH)/include \ @@ -82,14 +85,18 @@ LOCAL_STATIC_LIBRARIES := \ libosip2 \ libgsm + ifeq ($(LINPHONE_VIDEO),1) +ifeq ($(BUILD_X264),1) +LOCAL_STATIC_LIBRARIES += \ + libmsx264 \ + libx264 +endif LOCAL_STATIC_LIBRARIES += \ libavcodec \ libswscale \ libavcore \ - libavutil \ - libmsx264 \ - libx264 + libavutil endif LOCAL_STATIC_LIBRARIES += libspeex diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index adb2a92b1..07acaf08a 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -24,7 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef ANDROID #include extern "C" void libmsilbc_init(); +#ifdef HAVE_X264 extern "C" void libmsx264_init(); +#endif #endif /*ANDROID*/ static JavaVM *jvm=0; @@ -335,7 +337,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv* #ifdef HAVE_ILBC libmsilbc_init(); // requires an fpu #endif -#ifdef VIDEO_ENABLED +#ifdef HAVE_X264 libmsx264_init(); #endif jlong nativePtr = (jlong)linphone_core_new( &ldata->vTable @@ -1200,4 +1202,4 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSignalingTransportPor tr.tls_port = tls; linphone_core_set_sip_transports(lc, &tr); // tr will be copied -} \ No newline at end of file +} From e3674ddf2ec0663db942b68f2da12e84de25ae2f Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 31 Mar 2011 17:09:24 +0200 Subject: [PATCH 2/5] fix uncompliant sdp while refusing a video m line --- coreapi/offeranswer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index cbc88c2c1..10d062abf 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -232,6 +232,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities result->streams[i].dir=SalStreamInactive; result->streams[i].port=0; result->streams[i].type=rs->type; + result->streams[i].payloads=remote_offer->streams[i].payloads; if (rs->type==SalOther){ strncpy(result->streams[i].typeother,rs->typeother,sizeof(rs->typeother)-1); } From 49c5f14698e33bcb142cfcca4e0aeaf6c6e4e464 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 31 Mar 2011 17:54:17 +0200 Subject: [PATCH 3/5] update mediastreamer2 for enabling plugin on macosx --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 5c2fe9432..92316f7a8 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 5c2fe943251c5af493d18133251abf91e0ce5e83 +Subproject commit 92316f7a8793fe30e0d111d4b9043b76dcb8e726 From d9e5d1038a04412358b93570ee72b5a871e8e6ca Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 31 Mar 2011 18:32:16 +0200 Subject: [PATCH 4/5] fix empty mline again and update ms2 --- coreapi/linphonecall.c | 4 ++-- coreapi/offeranswer.c | 1 - coreapi/sal_eXosip2_sdp.c | 10 ++++++++-- mediastreamer2 | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index c3264d99b..97c1245a5 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -859,7 +859,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut { const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc, SalProtoRtpAvp,SalAudio); - if (stream && stream->dir!=SalStreamInactive){ + if (stream && stream->dir!=SalStreamInactive && stream->port!=0){ MSSndCard *playcard=lc->sound_conf.lsd_card ? lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard; MSSndCard *captcard=lc->sound_conf.capt_sndcard; @@ -941,7 +941,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut lc->previewstream=NULL; } call->current_params.has_video=FALSE; - if (vstream && vstream->dir!=SalStreamInactive) { + if (vstream && vstream->dir!=SalStreamInactive && vstream->port!=0) { const char *addr=vstream->addr[0]!='\0' ? vstream->addr : call->resultdesc->addr; call->video_profile=make_profile(call,call->resultdesc,vstream,&used_pt); if (used_pt!=-1){ diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index 10d062abf..cbc88c2c1 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -232,7 +232,6 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities result->streams[i].dir=SalStreamInactive; result->streams[i].port=0; result->streams[i].type=rs->type; - result->streams[i].payloads=remote_offer->streams[i].payloads; if (rs->type==SalOther){ strncpy(result->streams[i].typeother,rs->typeother,sizeof(rs->typeother)-1); } diff --git a/coreapi/sal_eXosip2_sdp.c b/coreapi/sal_eXosip2_sdp.c index 82e1fb509..3993e66f8 100644 --- a/coreapi/sal_eXosip2_sdp.c +++ b/coreapi/sal_eXosip2_sdp.c @@ -241,8 +241,14 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription 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,strip_well_known_rtpmaps); + if (desc->payloads){ + for(elem=desc->payloads;elem!=NULL;elem=elem->next){ + add_payload(msg, lineno, (PayloadType*)elem->data,strip_well_known_rtpmaps); + } + }else{ + /* to comply with SDP we cannot have an empty payload type number list */ + /* as it happens only when mline is declined with a zero port, it does not matter to put whatever codec*/ + sdp_message_m_payload_add (msg,lineno, int_2char (0)); } switch(desc->dir){ case SalStreamSendRecv: diff --git a/mediastreamer2 b/mediastreamer2 index 92316f7a8..8b9173fca 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 92316f7a8793fe30e0d111d4b9043b76dcb8e726 +Subproject commit 8b9173fca31595a48c7ef597edb412aea2d2871f From 693aa43ed57ad8d2972bb086066b19d1b1f4e4d2 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 1 Apr 2011 08:31:48 +0200 Subject: [PATCH 5/5] update ms2 with macsnd fix for wrong card detection --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 8b9173fca..a93ef32f7 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 8b9173fca31595a48c7ef597edb412aea2d2871f +Subproject commit a93ef32f726edd5707d6aef0fa930da573070504