728x90

출처 : HOW TO INSTALL CRACKED APPS ON iOS 7+ AppSync for iPhone-5S, iPad-Air, iPad-mini 2,1
iOS Developer Program (IDP) 없이 아이폰 디바이스에 디버깅 및 배포하기 (How To Deploy/Debug on iPhone Without IDP) UPDATE: Xcode 5

AppSync 설치(iPod Touch)

하단에 [Manage] 선택 -> [Sources] 선택

상단우측의 [Edit] 버튼 선택

상단좌측의 [Add] 버튼 선택

http://repo.hackyouriphone.org 입력 후, [Add Source] 버튼 선택

상단우측의 [Done] 버튼 선택

AppSync 설치

  

인증서 생성 (Mac)

인증서 이름 : iPhone Developer

  • 인증서 이름은 iPhone Developer로 지정. 만일, 동일한 이름의 인증서가 이미 존재하고 있다면 삭제 후 진행하기를 권장.
    • 이름 : iPhone Developer
    • 신원 유형 : 자체 서명 루트 (Self signed Root)
    • 인증서 유형 : 코드 서명 ( Code Signing )
    • 기본값 덮어쓰기 체크

유효기간(일) 은 기본 365일로 설정되는데, 넉넉하게 설정.

이메일 주소: 항목을 지우고 진행.

생성 완료될 때까지 [계속] 버튼 선택하여 인증서 생성 완료.

Xcode.plist 파일 수정

SDKSettings.plist, info.plist 두개 파일의 수정 필요.

SDKSettings.plist 파일 수정

바로 수정이 되지 않으므로 바탕화면에 복사 후 수정후 파일을 덮어 쓴다.

경로 : /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk

수정내용

DefaultProperties의 CODE_SIGNING_REQUIREDENTITLEMENTS_REQUIRED Key의 Value를 YES에서 NO로 수정.

DictionaryKeyValue(Org)Value(Mod)
DefaultPropertiesCODE_SIGNING_REQUIREDYESNO
DefaultPropertiesENTITLEMENTS_REQUIREDYESNO

Info.plist 파일 수정



프로젝트 수정

[Build Phases] 텝 선택

[Editor] -> [Add Build Phase] -> [Add Run Script Build Phase] 메뉴 선택


 

export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ] || [ "${PLATFORM_NAME}" == "ipados" ]; then /Applications/Xcode.app/Contents/Developer/iphoneentitlements/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent"; 
codesign -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"
fi

[Use for Development] 버튼 선택

 

728x90
728x90

출처
Apple LLVM compilerと無名カテゴリ
Building static C++ lib for use with Objective-c app in Xcode 4
static library 빌드 및 라이브러리 사용 어플리케이션 통합 디버깅하기 - 아이폰 4.x
Using C/C++ static libraries from iPhone ObjectiveC Apps
Xcode architectureエラー
objective c에서 STL 사용하기
아이폰에서 C로 된 정적 라이브러리 사용하기
Xcode 4.0 에서 c로 된 static library link error 조치

testlib.h 파일

/*
 * testlib.h
 *
 *  Created on: 2012. 9. 6.
 *      Author: bluexmas
 */

#ifndef LIBTEST_H_
#define LIBTEST_H_

#if defined(_WIN32) || defined(__WIN32__)
	#define DLL_CALLCONV __stdcall
	#ifdef LIBTEST_EXPORTS
		#define DLL_API __declspec(dllexport)
	#else
		#define DLL_API __declspec(dllimport)
	#endif // LIBTEST_EXPORTS
#else 
	// try the gcc visibility support (see http://gcc.gnu.org/wiki/Visibility)
	#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
		#ifndef GCC_HASCLASSVISIBILITY
			#define GCC_HASCLASSVISIBILITY
		#endif
	#endif // __GNUC__
	#define DLL_CALLCONV
	#if defined(GCC_HASCLASSVISIBILITY)
		#define DLL_API __attribute__ ((visibility("default")))
	#else
		#define DLL_API
	#endif		
#endif // WIN32 / !WIN32

DLL_API const char *DLL_CALLCONV get_version(void);

#endif /* LIBTEST_H_ */

testlib.cpp 파일

/*
 * testlib.cpp
 *
 *  Created on: 2012. 9. 6.
 *      Author: bluexmas
 */

#include "testlib.h"

const char* get_version() {
  return "testlib ver 0.2";
}

makefile.iphone-debug 파일

RM := rm -rf

GCC_VERSION = 4.2
IPHONEOS_DEPLOYMENT_TARGET = 5.1
MACOSX_DEPLOYMENT_TARGET = 10.8

PLATFORM_SIM = iPhoneSimulator
PLATFORM_PHONE = iPhoneOS

ARCH_SIM = i386
ARCH_PHONE = armv7

TOOLCHAIN=/Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
DEVROOT=/Volumes/Mac/Applications/Xcode.app/Contents/Developer
PLATFORM_SIM_DEVELOPER_BIN_DIR = $(DEVROOT)/Platforms/$(PLATFORM_SIM).platform/Developer/usr/bin
PLATFORM_PHONE_DEVELOPER_BIN_DIR = $(DEVROOT)/Platforms/$(PLATFORM_PHONE).platform/Developer/usr/bin

SDKROOT_SIM = $(DEVROOT)/Platforms/$(PLATFORM_SIM).platform/Developer/SDKs/$(PLATFORM_SIM)$(IPHONEOS_DEPLOYMENT_TARGET).sdk
SDKROOT_PHONE = $(DEVROOT)/Platforms/$(PLATFORM_PHONE).platform/Developer/SDKs/$(PLATFORM_PHONE)$(IPHONEOS_DEPLOYMENT_TARGET).sdk

IDIR=./inc
CLANG=$(TOOLCHAIN)/clang
CLANGFLAGS_SIM=-x objective-c-header -O0 -g3 -Wall -c -fmessage-length=0 -DDEBUG=1
CLANGFLAGS=-x objective-c -O0 -g3 -Wall -c -fmessage-length=0
LIBTOOL=$(TOOLCHAIN)/libtool

SDIR=./src
ODIR=./lib

#CPP_SRCS = \
#	./src/testlib.cpp 

OBJS += \
	./lib/testlib.o-sim
	
CPP_DEPS += \
	./lib/testlib.d	-sim
	
USER_OBJS :=

LIBS :=	

# Each subdirectory must supply rules for building sources it contributes
$(ODIR)/%.o-sim: $(SDIR)/%.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: Cygwin C++ Compiler'
	$(CLANG) -c $(CLANGFLAGS_SIM) -arch $(ARCH_SIM) -isysroot $(SDKROOT_SIM) -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o-sim=%.d-sim)" -I$(IDIR) -o "$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '

# All Target
all: libtestlib-sim.a

# Tool invocations
libtestlib-sim.a: $(OBJS) $(USER_OBJS)
	@echo 'Building target: $@'
	@echo 'Invoking: GCC Archiver'
	$(LIBTOOL) -static -arch_only $(ARCH_SIM) -syslibroot $(SDKROOT_SIM) -o libtestlib-sim.a $(OBJS) $(USER_OBJS) $(LIBS)
	@echo 'Finished building target: $@'
	@echo ' '	
	
# Other Targets
clean:
	-$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(ARCHIVES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libtestlib-sim.a
	-@echo ' '

makefile.cygwin 파일(참고용)

RM := rm -rf

IDIR=./inc
CC=g++
CFLAGS=-I$(IDIR)

SDIR=./src
ODIR=./lib

#CPP_SRCS = \
#	./src/testlib.cpp 

OBJS += \
	./lib/testlib.o 
	
CPP_DEPS += \
	./lib/testlib.d	
	
USER_OBJS :=

LIBS :=	

# Each subdirectory must supply rules for building sources it contributes
$(ODIR)/%.o: $(SDIR)/%.cpp
	@echo 'Building file: $<'
	@echo 'Invoking: Cygwin C++ Compiler'
	$(CC) $(CFLAGS) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '

# All Target
all: libtestlib.a

# Tool invocations
libtestlib.a: $(OBJS) $(USER_OBJS)
	@echo 'Building target: $@'
	@echo 'Invoking: GCC Archiver'
	ar -r  "libtestlib.a" $(OBJS) $(USER_OBJS) $(LIBS)
	@echo 'Finished building target: $@'
	@echo ' '	
	
# Other Targets
clean:
	-$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(ARCHIVES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libtestlib.a
	-@echo ' '	

정적라이브러리 만들기

 

빌드옵션

Header Search Paths 추가

Build Phase -> Link Binary With Libraries 추가

정적 라이브러리 메소드 호출

#include "testlib.h" 추가

실행

버튼 선택

 

 

 

- end -

728x90
728x90

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

728x90
728x90

ffmpeg 라이브러리를 이용해서 wowza서버를 사용하는 rtsp 플레이어를 제작해보았습니다.
소스는 iFrameExtractor 프로젝트에서 파일 오픈하는 부분을 rtsp 주소를 사용했고,
ffmpeg 라이브러리 경로를 따로 설정해서 컴파일 했습니다.

설치한 ffmpeg 라이브러리가 ios용으로 컴파일 되어 있어서
시뮬레이터에서는 테스트 할 수가 없네요.

iFrameExtractor 프로젝트는 ffmpeg 라이브러리만 사용했기 때문에 플레이는 되지만,
속도는 나오지 않습니다. OpenGL ES / SDL 라이브러리 이용해야 될 것 같네요.

출처

How can you pass YUV frames from FFmpeg to OpenGL ES?
TECH TUTORIAL ? HOW TO SETUP A SDL-READY XCODE4 PROJECT
CODEC_TYPE_VIDEO undefined
ffmpeg을 이용한 iOS 동영상 플레이어
<video> 태그를 이용하여 rstp 프로토콜의 스트리밍을 재생하고자 하고싶은데요...
Audio and Video HTML
myoutube or RTSP streaming support on chrome

소스 다운로드

jayrparro / iFrameExtractor

ffmpeg 라이브러리 경로 설정

오류 수정

CODEC_TYPE_VIDEO undefined 발생 한다면,
AVMEDIA_TYPE_VIDEO 로 수정

rtsp 주소 설정
iFrameExtractorAppDelegate.m

- (void)applicationDidFinishLaunching:(UIApplication *)application {    
	//self.video = [[VideoFrameExtractor alloc] initWithVideo:[Utilities bundlePath:@"sophie.mov"]];
    //self.video = [[VideoFrameExtractor alloc] initWithVideo:[Utilities bundlePath:@"oh.mp4"]];
    self.video = [[VideoFrameExtractor alloc] initWithVideo:@"rtsp://192.168.0.13/vod/mp4:sample.mp4"];
	[video release];

	// set output image size
	video.outputWidth = 426;
	video.outputHeight = 320;
	
	// print some info about the video
	NSLog(@"video duration: %f",video.duration);
	NSLog(@"video size: %d x %d", video.sourceWidth, video.sourceHeight);
	
	// video images are landscape, so rotate image view 90 degrees
	[imageView setTransform:CGAffineTransformMakeRotation(M_PI/2)];
    [window makeKeyAndVisible];
}

YUV 데이터 -> RGB 데이터 소스
VideoFrameExtractor.m

-(void)convertFrameToRGB {	
	sws_scale (img_convert_ctx, pFrame->data, pFrame->linesize,
			   0, pCodecCtx->height,
			   picture.data, picture.linesize);	
}

실행


728x90
728x90

출처

iOS용 FFmpeg 빌드
[iPhone] ffmpeg 빌드하기
How to cross compile ffmpeg for iOS (iPhone and iPad)
Build m4, autoconf, automake, libtool on Mac OS X Lion
http://www.slideshare.net/hypermin/html5-video

make 커맨드 설치

pkg-config 설치

pkg-config 다운로드

gas-preprocessor 다운로드

gas-preprocessor 다운로드

build-essentials 스크립트 다운로드및 실행

설치되는 항목 m4, autoconf, automake, libtool

https://gist.github.com/1397146

- 디렉토리구조

$HOME
├ local
└ Builds
   └ build-essential
      ├ build-essential.sh
      └ src

- 실행

$ chmod 755 build-essential.sh
$ ./build-essential.sh

- 경로 추가 (~/.profile)

PATH=$PATH:/Users/자신의계정/local/bin

- 확인

압축풀기

- 다운로드

ffmpeg 다운로드

- 압축풀기

$ tar xvfz ffmpeg-0.8.11.tar.bz2

config.sh 파일

./configure --enable-cross-compile \
  --arch=arm \
  --target-os=darwin \
  --cc='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2' \
  --as='./gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2' \
  --cpu=cortex-a8 \
  --enable-pic \
  --disable-yasm \
  --sysroot='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk' \
  --extra-cflags='-mfpu=neon -pipe -Os -gdwarf-2 -miphoneos-version-min=5.0' \
  --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -miphoneos-version-min=5.0' \
  --disable-asm \
  --disable-doc \
  --disable-ffmpeg \
  --disable-ffplay \
  --disable-ffprobe \
  --disable-ffserver \
  --enable-avdevice \
  --disable-devices \
  --disable-filters \
  --disable-yasm \
  --enable-network \
  --enable-protocol=tcp \
  --enable-demuxer=rtsp \
  --enable-decoder=h264

$ ./config.sh

$ make

$ sudo make install

728x90

+ Recent posts