2 #***************************************************************************
4 # Project ___| | | | _ \| |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
9 # Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at http://curl.haxx.se/docs/copyright.html.
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
22 #***************************************************************************
25 push(@INC, $ENV{'srcdir'}) if(defined $ENV{'srcdir'});
37 my $verbose = 0; # set to 1 for debugging
38 my $port = 8990; # just a default
39 my $ipvnum = 4; # default IP version of rtsp server
40 my $idnum = 1; # dafault rtsp server instance number
41 my $proto = 'rtsp'; # protocol the rtsp server speaks
42 my $pidfile; # rtsp server pid file
43 my $logfile; # rtsp server log file
48 my $logdir = $path .'/log';
51 if($ARGV[0] eq '--pidfile') {
57 elsif($ARGV[0] eq '--logfile') {
63 elsif($ARGV[0] eq '--srcdir') {
69 elsif($ARGV[0] eq '--ipv4') {
72 elsif($ARGV[0] eq '--ipv6') {
75 elsif($ARGV[0] eq '--port') {
76 if($ARGV[1] =~ /^(\d+)$/) {
81 elsif($ARGV[0] eq '--id') {
82 if($ARGV[1] =~ /^(\d+)$/) {
83 $idnum = $1 if($1 > 0);
87 elsif($ARGV[0] eq '--verbose') {
91 print STDERR "\nWarning: rtspserver.pl unknown parameter: $ARGV[0]\n";
97 $srcdir = $ENV{'srcdir'} || '.';
100 $pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
103 $logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
106 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
107 $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
109 exec("server/rtspd $flags");