全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:4346
推到 Plurk!
推到 Facebook!

BCB 如何使用 jrtplib (VC source code) ?

尚未結案
jaka19
一般會員


發表:1
回覆:2
積分:0
註冊:2005-11-02

發送簡訊給我
#1 引用回覆 回覆 發表時間:2009-02-17 11:01:41 IP:118.169.xxx.xxx 訂閱
最近要寫送rtp(with rtcp)封包的程式
爬很久找到open source jrtplib
http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jrtplib

(vc專案已附件,保險起見也可從上面作者網頁內下載)
拿到一個vc專案內含一堆 *.cpp & *.h
( 此 vc 專案我能產生 一個 .lib檔,卻無法產生 .dll檔 )
( 此 .lib 檔,加入bcb無法編譯 )

我用 BCB5 "open a project"
然後用 "add to project" 將 jrtplib 所有 *.cpp 加入
然後"make all projects" 一直會有錯誤

尤其出現在 .h 裡面的錯誤
實在不知道要如何改才對
例:
rtpmemorymamager.h裡
....
inline void operator delete(void *buffer, RTPMemoryManager *mgr, int memtype)
...

BCB 顯示:
[C Error] rtpmemorymanager.h(175): E2080 'operator delete' must be declared with one parameter

希望有BCB使用 VC code 經驗的網兄能幫幫忙
感謝
ikk
尊榮會員


發表:4
回覆:413
積分:768
註冊:2003-06-30

發送簡訊給我
#2 引用回覆 回覆 發表時間:2009-02-17 12:34:40 IP:163.28.xxx.xxx 訂閱
在VC下所編繹出來的library在BCB的環境下使用
可參考看看

http://delphi.ktop.com.tw/board.php?cid=168&fid=923&tid=67033
------
FPGA驗證, FPGA開發平台, http://smims.com
jaka19
一般會員


發表:1
回覆:2
積分:0
註冊:2005-11-02

發送簡訊給我
#3 引用回覆 回覆 發表時間:2009-02-17 13:50:32 IP:118.169.xxx.xxx 訂閱
你好

這篇我有爬到過
這篇的樓主情況跟我幾乎一樣
但這篇現在仍沒有解決辦法

看來需要 vc.lib -> vc.dll 再 implib 出 BCB.lib 搭配 vc.dll
但這條路
我卡在目前vc專案
我只能產生 vc.lib 無法產生 vc.dll

多謝ikk兄回應


===================引 用 ikk 文 章===================
在VC下所編繹出來的library在BCB的環境下使用
可參考看看

http://delphi.ktop.com.tw/board.php?cid=168&fid=923&tid=67033
bugmans
高階會員


發表:95
回覆:322
積分:188
註冊:2003-04-12

發送簡訊給我
#4 引用回覆 回覆 發表時間:2010-10-24 13:06:32 IP:114.44.xxx.xxx 未訂閱
藉這篇文章來慶祝delphi重新開站

用bcb6編譯rtplib.txt
1.
下載jrtplib-3.8.1.zip和jthread-1.2.1.zip
取出src資料夾並重新命名為jrtplib,jthread

2.
開啟BCB6選單File/New/Other/Library按下OK
將專案儲存為jrtplib.bpr
選單Project/Add to Project將jrtplib的cpp檔新增到專案
選單Project/Add to Project將jthread/win32兩個cpp檔新增到專案

3.
選單Project/Options/Directories/Conditionals/Include path加入
jthread,jthread\win32,jrtplib
選單Project/Options/Directories/Conditionals/Conditional defines加入
WIN32,RTP_SUPPORT_THREAD定義

4.
開啟rtpmemorymanager.h
第174行inline void operator delete[](void *buffer, RTPMemoryManager *mgr, int memtype)
修改成 inline void operator delete[](void *buffer, RTPMemoryManager *mgr)
第236行註解掉//#define RTPNew(a,b) new(a,b)
第238行註解掉//#else

開啟rtprandom.cpp
第58行x = (uint32_t)_getpid();
修改成 x = (uint32_t)getpid();

開啟rtpfaketransmitter.cpp
從54行開始註解掉
/*#include <sys/socket.h>
#include <net/if.h>
#include <string.h>
#include <netdb.h>
#include <unistd.h>*/

5.
編譯時出現下面的錯誤
[TLib Error] library too large, please restart with library page size 32
Project/Options/TLib/Page size
選單Project/Options/TLib/Page size/將0x0010改為0x0100

選單Project/Options/Compiler選Release可以讓jrtplib.lib變的更小
(2568KB -> 792KB)

檔案下載http://delphi.ktop.com.tw/board.php?cid=31&fid=97&tid=101656

依照RTP協議可以傳輸不同的聲音和影像格式(聲音PCM,GSM,影像JPEG,H263,H264)
http://en.wikipedia.org/wiki/RTP_audio_video_profile
但jrtplib就沒有實作這部分,example1.cpp~example5.cpp都無法傳輸任何的聲音或影像

以JPEG承載格式(RTP_PT_JPEG=26)為例(定義在rfc2435,附錄有程式碼可以看)
除了要送rtp header還要附上jpeg header和JPEG scan data
假如要送H264畫面就更複雜了,這部分就要靠自己了
或者可以參考其他開放原始碼的軟體,如live555,VLC media player,Mediastreamer


其他參考資料
RTP即時傳輸協定和即時控制協定
http://www.google.com/search?client=opera&rls=zh-tw&q="RTP即時傳輸協定和即時控制協定"&sourceid=opera&ie=utf-8&oe=utf-8

Multicast & RTP 即時影音傳輸
http://delphi.ktop.com.tw/board.php?cid=168&fid=921&tid=20187
http://nw58.csie.ncu.edu.tw/wmlab/fruit/csie87/3C/Document.htm

書RTP: Audio and Video for the Internet
http://www.google.com/search?client=opera&rls=zh-tw&q="RTP: Audio and Video for the Internet"&sourceid=opera&ie=utf-8&oe=utf-8

搜尋關鍵字:RTPSession,AddDestination,SendPacket,GotoFirstSourceWithData,RTPTime
編輯記錄
bugmans 重新編輯於 2010-10-23 23:08:36, 註解 無‧
bugmans 重新編輯於 2010-10-23 23:11:19, 註解 無‧
GrandRURU
站務副站長


發表:240
回覆:1680
積分:1874
註冊:2005-06-21

發送簡訊給我
#5 引用回覆 回覆 發表時間:2010-10-25 09:36:58 IP:203.75.xxx.xxx 未訂閱
bugmans大,我試著用你提供的方式去編譯,在rtpconfig.h第37行的地方
會出現"[C Error] rtpconfig.h(40): E2209 Unable to open include file 'rtpconfig_unix.h'"

我比對了Option內的選項,都調成跟大大一樣的設定。一樣是上面的錯誤訊息

可是使用大大所提供的專案,卻不會有這個錯誤訊息,

請問是哪邊還需要做什麼樣的設定嗎?

===================引 用 bugmans 文 章===================
藉這篇文章來慶祝delphi重新開站

用bcb6編譯rtplib.txt
..43..
bugmans
高階會員


發表:95
回覆:322
積分:188
註冊:2003-04-12

發送簡訊給我
#6 引用回覆 回覆 發表時間:2010-10-27 20:18:53 IP:114.36.xxx.xxx 未訂閱
rtpconfig.h的35行到39是,檢查選單Project/Options/Directories/Conditionals/Conditional defines
是否有WIN32定義,或者刪除#ifdef直接include "rtpconfig_win.h"

[code cpp]
#ifdef WIN32
#include "rtpconfig_win.h"
#else
#include "rtpconfig_unix.h"
#endif // WIN32
[/code]
系統時間:2024-04-26 8:46:56
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!