From 2435332d4fec0119790fae17757097caa5770020 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sun, 3 May 2015 23:38:49 +0200 Subject: [PATCH] add parameter to configure RTCP timeout --- README.md | 1 + src/main.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c3c04d..f1bdc17 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Usage -m url : multicast url (default multicast) -M addr : multicast group (default is a random address) -c : don't repeat config (default repeat config before IDR frame) + -t secs : RTCP expiration timeout (default 65) V4L2 options : -r : V4L2 capture using read interface (default use memory mapped buffers) -s : V4L2 capture using live555 mainloop (default use a separated reading thread) diff --git a/src/main.cpp b/src/main.cpp index a603dce..ee1890d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -166,10 +166,11 @@ int main(int argc, char** argv) bool useThread = true; in_addr_t maddr = INADDR_NONE; bool repeatConfig = true; + int timeout = 65; // decode parameters 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) { @@ -183,6 +184,7 @@ int main(int argc, char** argv) case 'm': multicast = true; murl = optarg; break; case 'M': multicast = true; maddr = inet_addr(optarg); break; case 'c': repeatConfig = false; break; + case 't': timeout = atoi(optarg); break; // V4L2 case 'r': useMmap = false; break; case 's': useThread = false; break; @@ -203,8 +205,9 @@ int main(int argc, char** argv) std::cout << "\t -T port : RTSP over HTTP port (default "<< rtspOverHTTPPort << ")" << std::endl; std::cout << "\t -u url : unicast url (default " << url << ")" << 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 -t secs : RTCP expiration timeout (default " << timeout << ")" << 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 -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); // create RTSP server - RTSPServer* rtspServer = RTSPServer::createNew(*env, rtspPort); + UserAuthenticationDatabase* authDB = NULL; + RTSPServer* rtspServer = RTSPServer::createNew(*env, rtspPort, authDB, timeout); if (rtspServer == NULL) { LOG(ERROR) << "Failed to create RTSP server: " << env->getResultMsg();