5、ORTP库移植
1、ORTP的引入
為什么要使用RTP:http://blog.51cto.com/ticktick/462746
RTP協(xié)議分析:http://www.xuebuyuan.com/739929.html
總結(jié):OPTP是一個(gè)C語(yǔ)言寫(xiě)的開(kāi)源協(xié)議庫(kù),它的本質(zhì)是實(shí)現(xiàn)一個(gè)服務(wù)器,可以用來(lái)在客戶(hù)端和服務(wù)器之間相互傳輸視頻
2、OPRT庫(kù)的移植
- [ ] (1),準(zhǔn)備源碼
- 下載ortp源碼:https://github.com/dmonakhov/ortp
- [ ] (2),存放到臨時(shí)工作目錄并解壓
- ortp源碼在Windows電腦中的E:\winshare\HI3518EV200\ortp-master中
- [ ] (3), 將ortp-master放入U(xiǎn)buntu的特定目錄中并解壓:
- cd ~/sambashare/
- cp /mnt/hgfs/winshare/HI3518EV200/ortp-master.zip ./
- unzip ortp-master.zip
- [ ] (4),修改源碼:增加H.264的payload支持
- cd ortp-master/
- cd src/
- sudo vi avprofile.c
- 在src/avprofile.c中357行添加:
- rtp_profile_set_payload(profile,96,&payload_type_h264);
- [ ] (5),執(zhí)行./autogen.sh,配置默認(rèn)的編譯環(huán)境
- 錯(cuò)誤1:./autogen.sh: line 44: libtoolize: command not found
- 解決:sudo aptitude install libtool*
- 擴(kuò)展:GNU Libtool 可以容易的在不同的系統(tǒng)中建立動(dòng)態(tài)鏈接庫(kù)。它通過(guò)一個(gè)稱(chēng)為 Libtool 庫(kù)的抽象,隱藏了不同系統(tǒng)之間的差異,給開(kāi)發(fā)人員提供了一致的的接口。
- 錯(cuò)誤2:libtoolize: error: Please install GNU M4, or 'export M4=/path/to/gnu/m4'.
- 解決:sudo apt-get install m4
- 解決:sudo aptitude install m4
- 擴(kuò)展:M4是一個(gè)宏處理器,將輸入拷貝到輸出,同時(shí)將宏展開(kāi)。宏可以是內(nèi)嵌的也可以是用戶(hù)定義的。除了可以展開(kāi)宏,M4還有一些內(nèi)建的函數(shù),用來(lái)引用文件,執(zhí)行Unix命令,整數(shù)運(yùn)算,文本操作,循環(huán)等。M4既可以作為編譯器的前端也可以單獨(dú)作為一個(gè)宏處理器。
- 錯(cuò)誤3:Automake - aclocal: command not found
- 解決:sudo apt-get install automake
- 擴(kuò)展:主要用于創(chuàng)建makefile
- [ ] (6),執(zhí)行./configure --prefix=/tmp/ortp --host=arm-hisiv300-linux 【--host=arm-hisiv300-linux指定了交叉編譯工具鏈,所以工具鏈一定要安裝好】,配置特定的編譯環(huán)境
[ ] (7),執(zhí)行make && make install,編譯ORTP庫(kù)
- [ ] (8),到/tmp/ortp目錄下查看移植好的庫(kù)和頭文件
- cd /tmp/ortp/
- ls 【include lib】
- ls lib/ 【有.so,.la之類(lèi)的文件】
- ls ../include/ortp/ 【有很多.h文件】
3、OPRT庫(kù)源碼分析
3.1 ORTP庫(kù)源碼概覽
(1) OPTP庫(kù)里面最關(guān)鍵的是include,src和src/test這三個(gè)文件夾,相應(yīng)的數(shù)據(jù)結(jié)構(gòu)和頭文件存放在include/ortp目錄下;src里面實(shí)現(xiàn)了一些功能函數(shù)[無(wú)main];src/test是示例代碼
(2)ORTP庫(kù)實(shí)現(xiàn)了RTP和RTCP協(xié)議,前者復(fù)制傳輸視頻,或者負(fù)載視頻傳輸?shù)馁|(zhì)量[控制,同步,協(xié)調(diào)等]
3.2 OPTP庫(kù)API使用
https://blog.csdn.net/bill611/article/details/77726429
轉(zhuǎn)載于:https://www.cnblogs.com/Ocean-Star/p/8920884.html
總結(jié)
- 上一篇: 如何做好产品
- 下一篇: 复习一个知识点——原、反、补码以及取反操