From 8d23daf39c4872bbe7d3c6a38231d43539964d1c Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 4 Apr 2014 15:39:09 +0200 Subject: [PATCH] Build OpenH264 in the SDK. --- .gitmodules | 6 +++ submodules/build/builder-iphone-os.mk | 4 +- submodules/build/builders.d/msopenh264.mk | 44 +++++++++++++++++++ submodules/build/builders.d/openh264.mk | 53 +++++++++++++++++++++++ submodules/externals/openh264 | 1 + submodules/msopenh264 | 1 + 6 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 submodules/build/builders.d/msopenh264.mk create mode 100644 submodules/build/builders.d/openh264.mk create mode 160000 submodules/externals/openh264 create mode 160000 submodules/msopenh264 diff --git a/.gitmodules b/.gitmodules index 7bd25d80b..9db29456b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,3 +64,9 @@ [submodule "submodules/cunit"] path = submodules/cunit url = git://git.linphone.org/cunit.git +[submodule "submodules/externals/openh264"] + path = submodules/externals/openh264 + url = https://github.com/cisco/openh264 +[submodule "submodules/msopenh264"] + path = submodules/msopenh264 + url = git://git.linphone.org/msopenh264.git diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index a202fe74f..1781501a0 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -55,7 +55,7 @@ endif LINPHONE_SRC_DIR=$(BUILDER_SRC_DIR)/linphone LINPHONE_BUILD_DIR=$(BUILDER_BUILD_DIR)/linphone -all: build-linphone build-msilbc build-msamr build-msx264 build-mssilk build-msbcg729 build-msisac +all: build-linphone build-msilbc build-msamr build-msx264 build-mssilk build-msbcg729 build-msisac build-msopenh264 # setup the switches that might trigger a linphone reconfiguration @@ -133,7 +133,7 @@ veryclean: veryclean-linphone veryclean-msbcg729 rm -rf $(BUILDER_BUILD_DIR) # list of the submodules to build -MS_MODULES := msilbc libilbc msamr mssilk msx264 msisac +MS_MODULES := msilbc libilbc msamr mssilk msx264 msisac msopenh264 SUBMODULES_LIST := polarssl libantlr cunit belle-sip srtp speex libgsm libvpx libxml2 bzrtp ffmpeg opus .NOTPARALLEL build-linphone: init $(addprefix build-,$(SUBMODULES_LIST)) mode_switch_check $(LINPHONE_BUILD_DIR)/Makefile diff --git a/submodules/build/builders.d/msopenh264.mk b/submodules/build/builders.d/msopenh264.mk new file mode 100644 index 000000000..7421c3319 --- /dev/null +++ b/submodules/build/builders.d/msopenh264.mk @@ -0,0 +1,44 @@ +############################################################################ +# msopenh264.mk +# Copyright (C) 2011 Belledonne Communications,Grenoble France +# +############################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ +msopenh264_dir?=msopenh264 +$(BUILDER_SRC_DIR)/$(msopenh264_dir)/configure: + cd $(BUILDER_SRC_DIR)/$(msopenh264_dir) && ./autogen.sh + +$(BUILDER_BUILD_DIR)/$(msopenh264_dir)/Makefile: $(BUILDER_SRC_DIR)/$(msopenh264_dir)/configure + mkdir -p $(BUILDER_BUILD_DIR)/$(msopenh264_dir) + cd $(BUILDER_BUILD_DIR)/$(msopenh264_dir)/ \ + && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + $(BUILDER_SRC_DIR)/$(msopenh264_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} + +build-msopenh264: build-openh264 $(BUILDER_BUILD_DIR)/$(msopenh264_dir)/Makefile + cd $(BUILDER_BUILD_DIR)/$(msopenh264_dir) && PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make && make install + +clean-msopenh264: clean-openh264 + cd $(BUILDER_BUILD_DIR)/$(msopenh264_dir) && make clean + +veryclean-msopenh264: veryclean-openh264 + -cd $(BUILDER_BUILD_DIR)/$(msopenh264_dir) && make distclean + -cd $(BUILDER_SRC_DIR)/$(msopenh264_dir) && rm -f configure + +clean-makefile-msopenh264: clean-makefile-openh264 + cd $(BUILDER_BUILD_DIR)/$(msopenh264_dir) && rm -f Makefile + diff --git a/submodules/build/builders.d/openh264.mk b/submodules/build/builders.d/openh264.mk new file mode 100644 index 000000000..5659357b0 --- /dev/null +++ b/submodules/build/builders.d/openh264.mk @@ -0,0 +1,53 @@ +############################################################################ +# openh264.mk +# Copyright (C) 2011 Belledonne Communications,Grenoble France +# +############################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ + +ifneq (,$(findstring i386-,$(host))) + ARCH=i386 +endif +ifneq (,$(findstring armv7-,$(host))) + ARCH=armv7 +endif +ifneq (,$(findstring armv7s-,$(host))) + ARCH=armv7s +endif + +openh264_dir?=externals/openh264 + +$(BUILDER_BUILD_DIR)/$(openh264_dir)/Makefile: + mkdir -p $(BUILDER_BUILD_DIR)/$(openh264_dir) \ + && cd $(BUILDER_BUILD_DIR)/$(openh264_dir)/ \ + && rsync -rvLpgoc --exclude ".git" $(BUILDER_SRC_DIR)/$(openh264_dir)/* . + +build-openh264: $(BUILDER_BUILD_DIR)/$(openh264_dir)/Makefile + cd $(BUILDER_BUILD_DIR)/$(openh264_dir) \ + && make libraries OS=ios ARCH=$(ARCH) PREFIX=$(prefix)\ + && make install OS=ios ARCH=$(ARCH) PREFIX=$(prefix) + +clean-openh264: + cd $(BUILDER_BUILD_DIR)/$(openh264_dir) \ + && make clean OS=ios ARCH=$(ARCH) + +veryclean-openh264: + cd $(BUILDER_SRC_DIR)/$(openh264_dir)/ \ + && git clean -f && git reset --hard \ + rm -rf $(BUILDER_BUILD_DIR)/$(openh264_dir) + diff --git a/submodules/externals/openh264 b/submodules/externals/openh264 new file mode 160000 index 000000000..fb5700bd5 --- /dev/null +++ b/submodules/externals/openh264 @@ -0,0 +1 @@ +Subproject commit fb5700bd5cc18dd33c120ce9dd5f79b8f1f35f3a diff --git a/submodules/msopenh264 b/submodules/msopenh264 new file mode 160000 index 000000000..863889de4 --- /dev/null +++ b/submodules/msopenh264 @@ -0,0 +1 @@ +Subproject commit 863889de427c70806d6bda87e2f95c3f38662c23