add parameter to configure RTCP timeout

pull/33/head
Michel Promonet 10 years ago
parent 3c83669169
commit 2435332d4f

@ -63,6 +63,7 @@ Usage
-m url : multicast url (default multicast) -m url : multicast url (default multicast)
-M addr : multicast group (default is a random address) -M addr : multicast group (default is a random address)
-c : don't repeat config (default repeat config before IDR frame) -c : don't repeat config (default repeat config before IDR frame)
-t secs : RTCP expiration timeout (default 65)
V4L2 options : V4L2 options :
-r : V4L2 capture using read interface (default use memory mapped buffers) -r : V4L2 capture using read interface (default use memory mapped buffers)
-s : V4L2 capture using live555 mainloop (default use a separated reading thread) -s : V4L2 capture using live555 mainloop (default use a separated reading thread)

@ -166,10 +166,11 @@ int main(int argc, char** argv)
bool useThread = true; bool useThread = true;
in_addr_t maddr = INADDR_NONE; in_addr_t maddr = INADDR_NONE;
bool repeatConfig = true; bool repeatConfig = true;
int timeout = 65;
// decode parameters // decode parameters
int c = 0; int c = 0;
while ((c = getopt (argc, argv, "v::Q:O:" "P:T:m:u:M:c" "rsF:W:H:" "h")) != -1) while ((c = getopt (argc, argv, "v::Q:O:" "P:T:m:u:M:ct:" "rsF:W:H:" "h")) != -1)
{ {
switch (c) switch (c)
{ {
@ -183,6 +184,7 @@ int main(int argc, char** argv)
case 'm': multicast = true; murl = optarg; break; case 'm': multicast = true; murl = optarg; break;
case 'M': multicast = true; maddr = inet_addr(optarg); break; case 'M': multicast = true; maddr = inet_addr(optarg); break;
case 'c': repeatConfig = false; break; case 'c': repeatConfig = false; break;
case 't': timeout = atoi(optarg); break;
// V4L2 // V4L2
case 'r': useMmap = false; break; case 'r': useMmap = false; break;
case 's': useThread = false; break; case 's': useThread = false; break;
@ -205,6 +207,7 @@ int main(int argc, char** argv)
std::cout << "\t -m url : multicast url (default " << murl << ")" << std::endl; std::cout << "\t -m url : multicast url (default " << murl << ")" << std::endl;
std::cout << "\t -M addr : multicast group (default is a random address)" << std::endl; std::cout << "\t -M addr : multicast group (default is a random address)" << std::endl;
std::cout << "\t -c : don't repeat config (default repeat config before IDR frame)" << std::endl; std::cout << "\t -c : don't repeat config (default repeat config before IDR frame)" << std::endl;
std::cout << "\t -t secs : RTCP expiration timeout (default " << timeout << ")" << std::endl;
std::cout << "\t V4L2 options :" << std::endl; std::cout << "\t V4L2 options :" << std::endl;
std::cout << "\t -r : V4L2 capture using read interface (default use memory mapped buffers)" << std::endl; std::cout << "\t -r : V4L2 capture using read interface (default use memory mapped buffers)" << std::endl;
std::cout << "\t -s : V4L2 capture using live555 mainloop (default use a reader thread)" << std::endl; std::cout << "\t -s : V4L2 capture using live555 mainloop (default use a reader thread)" << std::endl;
@ -228,7 +231,8 @@ int main(int argc, char** argv)
UsageEnvironment* env = BasicUsageEnvironment::createNew(*scheduler); UsageEnvironment* env = BasicUsageEnvironment::createNew(*scheduler);
// create RTSP server // create RTSP server
RTSPServer* rtspServer = RTSPServer::createNew(*env, rtspPort); UserAuthenticationDatabase* authDB = NULL;
RTSPServer* rtspServer = RTSPServer::createNew(*env, rtspPort, authDB, timeout);
if (rtspServer == NULL) if (rtspServer == NULL)
{ {
LOG(ERROR) << "Failed to create RTSP server: " << env->getResultMsg(); LOG(ERROR) << "Failed to create RTSP server: " << env->getResultMsg();

Loading…
Cancel
Save