diff --git a/build/android/Android.mk b/build/android/Android.mk index 4a2add8f61fd0857b60f62a2fb072a7a38b5bae8..a6a6ae97f8b8b987d0ce701c569fadf7c53d5020 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,15 +85,18 @@ LOCAL_STATIC_LIBRARIES := \ libosip2 \ libgsm + ifeq ($(LINPHONE_VIDEO),1) +ifeq ($(BUILD_X264),1) +LOCAL_STATIC_LIBRARIES += \ + libmsx264 \ + libx264 +endif LOCAL_SHARED_LIBRARIES += \ libavcodec \ libswscale \ libavcore \ - libavutil -LOCAL_STATIC_LIBRARIES += \ - libmsx264 \ - libx264 + libavutil endif LOCAL_STATIC_LIBRARIES += libspeex diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 3640345fa82517f272ba8d6047981d19ba8a2009..02854fed20ac12f3299af9403fa37b8340235818 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -863,7 +863,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; @@ -945,7 +945,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/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index adb2a92b131941c1dd17bc606283a257e9814524..07acaf08af737b1a6edc87e8a1a89690f2ebb6d6 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 <android/log.h> 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 +} diff --git a/coreapi/sal_eXosip2_sdp.c b/coreapi/sal_eXosip2_sdp.c index 82e1fb5091d4d3e219490cc853582749b94b42a0..3993e66f8179514c9b2e2b8b742d4791e9dbd9e4 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: