資源簡介
rtsp_server 為工程主目錄
livelib 為live555 庫目錄
DynamicRTSPServer.cpp live555MediaServer.cpp為mediaServer 中文件修改 H264LiveVideoServerMediaSubsession.cpp H264LiveVideoSource.cpp
為創(chuàng)建對話和獲取幀類 其他為平臺獲取幀代碼和庫
代碼片段和文件信息
/**********
This?library?is?free?software;?you?can?redistribute?it?and/or?modify?it?under
the?terms?of?the?GNU?Lesser?General?Public?License?as?published?by?the
Free?Software?Foundation;?either?version?3?of?the?License?or?(at?your
option)?any?later?version.?(See?.)
This?library?is?distributed?in?the?hope?that?it?will?be?useful?but?WITHOUT
ANY?WARRANTY;?without?even?the?implied?warranty?of?MERCHANTABILITY?or?FITNESS
FOR?A?PARTICULAR?PURPOSE.??See?the?GNU?Lesser?General?Public?License?for
more?details.
You?should?have?received?a?copy?of?the?GNU?Lesser?General?Public?License
along?with?this?library;?if?not?write?to?the?Free?Software?Foundation?Inc.
51?Franklin?Street?Fifth?Floor?Boston?MA?02110-1301??USA
**********/
//?Copyright?(c)?1996-2017?Live?Networks?Inc.??All?rights?reserved
//?A?subclass?of?“RTSPServer“?that?creates?“ServerMediaSession“s?on?demand
//?based?on?whether?or?not?the?specified?stream?name?exists?as?a?file
//?Implementation
#include?“H264LiveVideoServerMediaSubsession.hh“
#include?“DynamicRTSPServer.hh“
#include?
#include?
DynamicRTSPServer*
DynamicRTSPServer::createNew(UsageEnvironment&?env?Port?ourPort
?????UserAuthenticationDatabase*?authDatabase
?????unsigned?reclamationTestSeconds)?{
??int?ourSocket?=?setUpOurSocket(env?ourPort);
??if?(ourSocket?==?-1)?return?NULL;
??return?new?DynamicRTSPServer(env?ourSocket?ourPort?authDatabase?reclamationTestSeconds);
}
DynamicRTSPServer::DynamicRTSPServer(UsageEnvironment&?env?int?ourSocket
?????Port?ourPort
?????UserAuthenticationDatabase*?authDatabase?unsigned?reclamationTestSeconds)
??:?RTSPServerSupportingHTTPStreaming(env?ourSocket?ourPort?authDatabase?reclamationTestSeconds)?{
}
DynamicRTSPServer::~DynamicRTSPServer()?{
}
static?ServerMediaSession*?createNewSMS(UsageEnvironment&?envchar?const*?fileName?FILE*?fid);?//?forward
ServerMediaSession*?DynamicRTSPServer::lookupServerMediaSession(char?const*?streamName?Boolean?isFirstLookupInSession)?
{
????//?Next?check?whether?we?already?have?a?“ServerMediaSession“?for?this?file:
????ServerMediaSession*?sms?=?RTSPServer::lookupServerMediaSession(streamName);
????Boolean?smsExists?=?sms?!=?NULL;
????if?(sms?==?NULL)?{
????sms?=?createNewSMS(envir()?streamName?NULL);?
????addServerMediaSession(sms);
????}
??return?sms;
}
#define?NEW_SMS(description)?do?{\
char?const*?descStr?=?description\
????“?streamed?by?the?LIVE555?Media?Server“;\
sms?=?ServerMediaSession::createNew(env?fileName?fileName?descStr);\
}?while(0)
static?ServerMediaSession*?createNewSMS(UsageEnvironment&?envchar?const*?fileName?FILE*?/*fid*/)?
{
????printf(“filename?=%s\n“fileName);
????if(fileName?==?NULL)?return?NULL;
????//?Use?the?file?name?extension?to?determine?the?type?of?“ServerMediaSession“:
?//???char?const*?h264?=?strcasestr(fileName?“-stream“);
????ServerMediaSession*?sms?=?NULL;
????Boolean?const?reuseSource?=?True;
????sms->ad
- 上一篇:Robot Soccer v1.5a
- 下一篇:時光駐留器+痕跡擦除器
評論
共有 條評論