1、下载地址http://www.live555.com/liveMedia/public/
2、解压文件,在终端中cd到当前文件夹下
3、使用sudo -s 进入管理员模式
4、vim编辑 Makefile.tail文件


在其对应位置加入 # 注释掉编译客户端时不需要编译的部分
保存退出
5、vim编辑config.iphoneos文件
首先修改 IOS_VERSION为当前Xcode SDK版本号
本机版本号地址是:

最后编译通过的版本截图

//这里会报unknown type name ‘u_int64_t’ 的错误,是因为没有安装xcode命令行工具
//安装xcode命令行工具运行 xcode-select —install
6、开始编译
命令 ./genMakefiles iphoneos
命令 make
7.找到对应的.a文件和include里面的.h文件.a文件

8.编译不通过的可能编译出来的与对应运行程序的硬件arm架构不一致
编译平台的支持,armv7, 模拟器armi386,iphone6s,iphone7 arm64

可以单个编译每个arm架构下的.a包然后整合成一个通用.a包
解析:RtspClient工作流程(默认没有错误出现的话)
->首先通过URL创建了一个rtspClient对象
->使用rtspClient发送describeCommand命令,传入回调函数
->afterDescribe回调函数中根据返回的sdpDescription创建媒体会话(MediaSession)
->对MediaSession的子会话(subsession)进行初始化subsession.initiate(),对subsession发送SetupCommand命令,传入回调函数,这里是一个循环执行,会对每一个subsession进行这个操作
->afterSetup回调函数,创建数据模型槽(DummySink),sink->startPlaying开始获取数据,数据是在sink的fSource中
->所有的流都setup完成之后,根据是否是绝对时间发送PlayCommand命令,传入afterPlay回调函数
->
->
->
一个ServerMediaSession对象对应一个媒体文件,一个媒体文件中可能同时包含音频和视频,每个视频或者音频,对应一个ServerMediaSubsession对象,一个ServerMediaSession中可以包含多个ServerMediaSubsession对象
网友评论