From 02afae59ebfd054bfc3ed972877e4b292385826b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 16 Apr 2014 11:25:20 +0200 Subject: [PATCH] integrate permissive patch of openh264 --- Classes/LinphoneManager.m | 22 +++----- README | 4 +- submodules/build/Makefile | 4 -- .../builders.d/openh264-permissive.patch | 53 +++++++++++++++++++ submodules/build/builders.d/openh264.mk | 13 +++-- submodules/externals/openh264 | 2 +- submodules/msopenh264 | 2 +- 7 files changed, 73 insertions(+), 27 deletions(-) create mode 100644 submodules/build/builders.d/openh264-permissive.patch diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 752f99051..c289ae2d5 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -63,27 +63,17 @@ NSString *const kLinphoneConfiguringStateUpdate = @"LinphoneConfiguringStateUpda NSString *const kLinphoneGlobalStateUpdate = @"LinphoneGlobalStateUpdate"; -extern void libmsilbc_init(); -#ifdef HAVE_AMR -extern void libmsamr_init(); -#endif +extern void libmsilbc_init(void); +extern void libmsamr_init(void); +extern void libmsx264_init(void); +extern void libmsopenh264_init(void); +extern void libmssilk_init(void); +extern void libmsbcg729_init(void); -#ifdef HAVE_X264 -extern void libmsx264_init(); -#endif -#ifdef HAVE_OPENH264 -extern void libmsopenh264_init(); -#endif #define FRONT_CAM_NAME "AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:1" /*"AV Capture: Front Camera"*/ #define BACK_CAM_NAME "AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:0" /*"AV Capture: Back Camera"*/ -#if defined (HAVE_SILK) -extern void libmssilk_init(); -#endif -#if HAVE_G729 -extern void libmsbcg729_init(); -#endif @implementation LinphoneCallAppData - (id)init { if ((self = [super init])) { diff --git a/README b/README index d62528903..c3eac41ec 100644 --- a/README +++ b/README @@ -71,8 +71,8 @@ After the SDK is built, just open the linphone xcode project with Xcode, and pre * Note regarding third party components subject to license -The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and X264 codecs. -Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_X264 positioned in xcode project. +The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs. +Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_OPENH264 positioned in xcode project. Before embeding these 4 codecs in the final application, make sure to have the right to do so. LIMITATIONS, KNOWN BUGS diff --git a/submodules/build/Makefile b/submodules/build/Makefile index e05559eea..bdf569abe 100644 --- a/submodules/build/Makefile +++ b/submodules/build/Makefile @@ -30,10 +30,6 @@ enable_debug=no # check that the selected options are correct CHECKOPT_MSG := "" -ifeq ($(enable_gpl_third_parties)$(enable_zrtp),noyes) - CHECKOPT_MSG += "ZRTP is not available in non-gpl build. disabling\n" - enable_zrtp=no -endif ifeq ($(enable_gpl_third_parties)$(enable_ffmpeg),noyes) # ffmpeg is not compatible with no GPL. diff --git a/submodules/build/builders.d/openh264-permissive.patch b/submodules/build/builders.d/openh264-permissive.patch new file mode 100644 index 000000000..859db1ee1 --- /dev/null +++ b/submodules/build/builders.d/openh264-permissive.patch @@ -0,0 +1,53 @@ +commit 6b3de978d928b6c0baec3305c9803c21a4367d0c +Author: Simon Morlat +Date: Tue Apr 15 15:19:37 2014 +0200 + + permissive mode: allow reference frames to be used even if there were lost slices. + +diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp +index c19f501..a14e971 100644 +--- a/codec/decoder/core/src/decoder_core.cpp ++++ b/codec/decoder/core/src/decoder_core.cpp +@@ -58,7 +58,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t + WelsLog (pCtx, WELS_LOG_WARNING, + "DecodeFrameConstruction():::iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d --\n", + pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight); +- return -1; ++ //return -1; + } + #ifdef NO_WAITING_AU + pCtx->iTotalNumMbRec = 0; +diff --git a/codec/decoder/core/src/manage_dec_ref.cpp b/codec/decoder/core/src/manage_dec_ref.cpp +index dcf61ca..5582ec9 100644 +--- a/codec/decoder/core/src/manage_dec_ref.cpp ++++ b/codec/decoder/core/src/manage_dec_ref.cpp +@@ -165,6 +165,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) { + && (pSliceHeader->iSpsId != ppRefList[i]->iSpsId)) { //check; + WelsLog (pCtx, WELS_LOG_WARNING, "WelsReorderRefList()-1::::BASE LAYER::::iSpsId:%d, ref_sps_id:%d\n", + pSliceHeader->iSpsId, ppRefList[i]->iSpsId); ++ return ERR_NONE; + pCtx->iErrorCode = dsNoParamSets; //cross-IDR reference frame selection, SHOULD request IDR.-- + return ERR_INFO_REFERENCE_PIC_LOST; + } else { + +commit a1f3b95ad18d0788c2c803fac80e78d6365673ce +Author: Simon Morlat +Date: Tue Apr 15 17:54:58 2014 +0200 + + permissive mode (2) + +diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp +index a14e971..e742dbf 100644 +--- a/codec/decoder/core/src/decoder_core.cpp ++++ b/codec/decoder/core/src/decoder_core.cpp +@@ -1738,8 +1738,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 + if ((iLastIdD < 0) || //case 1: first layer + (iLastIdD == iCurrIdD)) { //case 2: same uiDId + InitDqLayerInfo (dq_cur, &pLayerInfo, pNalCur, pCtx->pDec); +- +- if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) { ++ if (0){ ++ //if (!dq_cur->sLayerInfo.pSps->bGapsInFrameNumValueAllowedFlag) { + const bool kbIdrFlag = dq_cur->sLayerInfo.sNalHeaderExt.bIdrFlag + || (dq_cur->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR); + // Subclause 8.2.5.2 Decoding process for gaps in frame_num diff --git a/submodules/build/builders.d/openh264.mk b/submodules/build/builders.d/openh264.mk index 9ce4517dd..b229d2899 100644 --- a/submodules/build/builders.d/openh264.mk +++ b/submodules/build/builders.d/openh264.mk @@ -32,12 +32,19 @@ endif openh264_dir?=externals/openh264 -$(BUILDER_BUILD_DIR)/$(openh264_dir)/Makefile: +$(BUILDER_SRC_DIR)/$(openh264_dir)/openh264-permissive.patch.stamp: + cd $(BUILDER_SRC_DIR)/$(openh264_dir) \ + && patch -p1 < $(BUILDER_SRC_DIR)/build/builders.d/openh264-permissive.patch + touch $(BUILDER_SRC_DIR)/$(openh264_dir)/openh264-permissive.patch.stamp + +patch-openh264: $(BUILDER_SRC_DIR)/$(openh264_dir)/openh264-permissive.patch.stamp + +update-openh264: patch-openh264 mkdir -p $(BUILDER_BUILD_DIR)/$(openh264_dir) \ && cd $(BUILDER_BUILD_DIR)/$(openh264_dir)/ \ - && rsync -rvLpgoc --exclude ".git" $(BUILDER_SRC_DIR)/$(openh264_dir)/* . + && rsync -rvLpgoc --exclude ".git" $(BUILDER_SRC_DIR)/$(openh264_dir)/* . -build-openh264: $(BUILDER_BUILD_DIR)/$(openh264_dir)/Makefile +build-openh264: update-openh264 cd $(BUILDER_BUILD_DIR)/$(openh264_dir) \ && make libraries OS=ios ARCH=$(ARCH) PREFIX=$(prefix)\ && make install OS=ios ARCH=$(ARCH) PREFIX=$(prefix) diff --git a/submodules/externals/openh264 b/submodules/externals/openh264 index fb5700bd5..b2f7191fa 160000 --- a/submodules/externals/openh264 +++ b/submodules/externals/openh264 @@ -1 +1 @@ -Subproject commit fb5700bd5cc18dd33c120ce9dd5f79b8f1f35f3a +Subproject commit b2f7191fa7e213f5b63b8e31936b962bae6adc2f diff --git a/submodules/msopenh264 b/submodules/msopenh264 index 863889de4..1dc44eb5b 160000 --- a/submodules/msopenh264 +++ b/submodules/msopenh264 @@ -1 +1 @@ -Subproject commit 863889de427c70806d6bda87e2f95c3f38662c23 +Subproject commit 1dc44eb5b824d104f96562e4b5bd28a1ac461525