基于PJSIP的视频通信在IOS上的实现

From http://code.google.com/p/siphon/wiki/VIdeoSupport 

PJSIP 在IOS视频通信的方案,sipho开源项目已经告诉了我们!感谢他们~等会自己来试一下。 大笑

Introduction

Currently, pjsip 2.0 includes the video support, also we will use it. And we won't backport video support in pjsip 1.x branch.

We use three external libraries :

The statements to compile libyuv are described in this  site . Maybe your svn version is too old, in this case you can update svn by following the statements of  Jason McCreary 's blog.

The statements to compile ffmpeg and x264 libraries are given on this site.

Some statements to include VP8 support in pjsip are given on this page.

libx264 compilation

#!/bin/sh

DEST=../iOS/video/iOS

VERSION="5.1"
SDK_VERSION="5.1"

DEVPATH=/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
#DEVPATH=/Developer/Platforms/iPhoneOS.platform/Developer


echo "Building armv7..."

export CC=${DEVPATH}/usr/bin/llvm-gcc

./configure --host=arm-apple-darwin \
    --sysroot=${DEVPATH}/SDKs/iPhoneOS${VERSION}.sdk \
    --prefix=$DEST \
    --extra-cflags='-arch armv7' \
    --extra-ldflags="-L${DEVPATH}/SDKs/iPhoneOS${SDK_VERSION}.sdk/usr/lib/system -arch armv7" \
    --enable-pic \
    --enable-static 

make && make install

echo "Installed: $DEST"

ffmpeg compilation

#!/bin/sh

DEST=../iOS/video/iOS

VERSION=5.1
IPHONEOS_DEPLOYMENT_TARGET=5.1  

DEVPATH=/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
#DEVPATH=/Developer/Platforms/iPhoneOS.platform/Developer

X264INCLUDE=${DEST}/include
X264LIB=${DEST}/lib

COMMONFLAGS="-miphoneos-version-min=$IPHONEOS_DEPLOYMENT_TARGET -arch armv7 "
CFLAGS="$CFLAGS $COMMONFLAGS -I$X264INCLUDE"
LDFLAGS="$LDFLAGS -L${DEVPATH}/SDKs/iPhoneOS${VERSION}.sdk/usr/lib/system $COMMONFLAGS -L$X264LIB"

export CC=${DEVPATH}/usr/bin/llvm-gcc
export RANLIB=${DEVPATH}/usr/bin/ranlib


echo "Building armv7..."

./configure \
    --cpu=cortex-a8 \
    --extra-cflags="$CFLAGS" \
    --extra-ldflags="$LDFLAGS" \
    --enable-cross-compile \
    --arch=arm \
    --target-os=darwin \
    --cc=${CC} \
    --sysroot=${DEVPATH}/SDKs/iPhoneOS${VERSION}.sdk \
    --prefix=${DEST} \
    --enable-gpl \
    --disable-network \
    --disable-decoders \
    --disable-muxers \
    --disable-demuxers \
    --disable-devices \
    --disable-parsers \
    --disable-encoders \
    --disable-protocols \
    --disable-filters \
    --disable-bsfs \
    --enable-libx264 \
    --enable-encoder=libx264 \
    --enable-encoder=libx264rgb \
    --enable-decoder=h264 \
    --enable-encoder=h263 \
    --enable-decoder=h263 \
    --enable-gpl \
    --enable-pic \
    --disable-doc \
    --disable-ffplay \
    --disable-ffprobe
    
make & make install

echo "Installed: $DEST"

vpx compilation

#!/bin/sh

DEST=../iOS/video/iOS

VERSION=6.0 

DEVPATH=/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer

mkdir armv7_build

cd armv7_build

../configure --target=armv7-darwin-gcc \
     --prefix=${DEST} \
     --disable-install-bins \ 
     --libc=${DEVPATH}/SDKs/iPhoneOS${VERSION}.sdk

make & make install

pjsip compilation

You have to enable video support in config_site.h:

#define PJMEDIA_HAS_VIDEO 1

iOS

./configure-iphone --prefix=./iOS --with-ffmpeg=../iOS/video/iOS

make & make install

Simulator

export ARCH="-arch i386"

export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
export IPHONESDK=iPhoneSimulator6.0.sdk
export CC=${DEVPATH}/usr/bin/llvm-gcc
export CFLAGS="-O2 -m32 -miphoneos-version-min=5.0 -fobjc-abi-version=2 -fobjc-legacy-dispatch"
export LDFLAGS="-O2 -m32"

./configure-iphone --prefix=./Simulator --with-ffmpeg=../iOS/video/iOS

make & make install
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值