shithub: openh264

Download patch

ref: d6ac7f4a6022b1a2f29e3210fa42364391cb3d3e
parent: 51b2ff84fc7845e211d76561453637694b91e93c
author: zhuling13 <[email protected]>
date: Wed Jun 4 21:20:50 EDT 2014

add iosutdemo

--- a/Makefile
+++ b/Makefile
@@ -113,12 +113,12 @@
 ifeq ($(HAVE_GTEST),Yes)
 
 test: codec_unittest$(EXEEXT)
-ifeq (android, $(OS))
-
-else
-
+ifneq (android,$(OS)) 
+ifneq (ios,$(OS))
 	./codec_unittest
 endif
+endif
+
 else
 test:
 	@echo "./gtest : No such file or directory."
@@ -137,7 +137,12 @@
 endif
 endif
 
+ifneq (ios, $(OS))
 libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX)
+else
+libraries: $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX)
+endif
+
 LIBRARIES += $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX) $(LIBPREFIX)$(PROJECT_NAME).$(SHAREDLIBSUFFIX)
 
 $(LIBPREFIX)$(PROJECT_NAME).$(LIBSUFFIX): $(ENCODER_OBJS) $(DECODER_OBJS) $(PROCESSING_OBJS) $(COMMON_OBJS)
@@ -173,7 +178,12 @@
 include test/encoder/targets.mk
 include test/processing/targets.mk
 
+LIBRARIES += $(LIBPREFIX)ut.$(LIBSUFFX)
+$(LIBPREFIX)ut.$(LIBSUFFIX): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) 
+	$(QUIET)rm -f $@
+	$(QUIET_AR)$(AR) $(AR_OPTS) $+
 
+
 LIBRARIES +=$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX)
 $(LIBPREFIX)ut.$(SHAREDLIBSUFFIX): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) $(CODEC_UNITTEST_DEPS)
 	$(QUIET)rm -f $@
@@ -182,10 +192,12 @@
 binaries: codec_unittest$(EXEEXT)
 BINARIES += codec_unittest$(EXEEXT)
 
-ifeq (android,$(OS))
+ifeq (ios,$(OS))
+codec_unittest$(EXEEXT): $(LIBPREFIX)ut.$(LIBSUFFIX)
 
-
-codec_unittest$(EXEEXT):$(LIBPREFIX)ut.$(SHAREDLIBSUFFIX)
+else
+ifeq (android,$(OS))
+codec_unittest$(EXEEXT): $(LIBPREFIX)ut.$(SHAREDLIBSUFFIX)
 	cd ./test/build/android && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug
 
 clean_Android: clean_Android_ut
@@ -196,7 +208,10 @@
 codec_unittest$(EXEEXT): $(DECODER_UNITTEST_OBJS) $(ENCODER_UNITTEST_OBJS) $(PROCESSING_UNITTEST_OBJS) $(API_TEST_OBJS) $(CODEC_UNITTEST_DEPS)
 	$(QUIET)rm -f $@
 	$(QUIET_CXX)$(CXX) $(CXX_LINK_O) $+ $(CODEC_UNITTEST_LDFLAGS) $(LDFLAGS)
+
 endif
+endif
+
 else
 binaries:
 	@:
--- a/build/platform-ios.mk
+++ b/build/platform-ios.mk
@@ -1,4 +1,6 @@
-ARCH = armv7
+#ifeq ($(filter %86 armv7 armv7s arm64, $(ARCH)),)
+#$(error Default ARCH is the build platform not ios devices platform,should pass ARCH to make,only support ARCH of %86 armv7 armv7s arm64)
+#endif
 include build/platform-darwin.mk
 CXX = clang++
 CC = clang
@@ -10,7 +12,8 @@
 SDK = $(shell xcrun --sdk $(shell echo $(SDKTYPE) | tr A-Z a-z) --show-sdk-version)
 SDK_MIN = 5.1
 
-SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/$(SDKTYPE).platform/Developer/SDKs/$(SDKTYPE)$(SDK).sdk
+XCODE=$(shell xcode-select -p)
+SDKROOT = $(XCODE)/Platforms/$(SDKTYPE).platform/Developer/SDKs/$(SDKTYPE)$(SDK).sdk
 CFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN) -DAPPLE_IOS
 LDFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN)
 
--- a/test/api/simple_test.cpp
+++ b/test/api/simple_test.cpp
@@ -4,8 +4,7 @@
 #endif
 
 
-
-#if defined(ANDROID_NDK)
+#if (defined(ANDROID_NDK)||defined(APPLE_IOS))
 int CodecUtMain(int argc , char** argv ) {
 #else
 int main (int argc, char** argv) {