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
@INC=(@INC, $ENV{'srcdir'}, '.');
36
my $verbose = 0; # set to 1 for debugging
37
my $port = 8990; # just a default
38
my $ipvnum = 4; # default IP version of rtsp server
39
my $idnum = 1; # dafault rtsp server instance number
40
my $proto = 'rtsp'; # protocol the rtsp server speaks
41
my $pidfile; # rtsp server pid file
42
my $logfile; # rtsp server log file
47
my $logdir = $path .'/log';
50
if($ARGV[0] eq '--pidfile') {
56
elsif($ARGV[0] eq '--logfile') {
62
elsif($ARGV[0] eq '--srcdir') {
68
elsif($ARGV[0] eq '--ipv4') {
71
elsif($ARGV[0] eq '--ipv6') {
74
elsif($ARGV[0] eq '--port') {
75
if($ARGV[1] =~ /^(\d+)$/) {
80
elsif($ARGV[0] eq '--id') {
81
if($ARGV[1] =~ /^(\d+)$/) {
82
$idnum = $1 if($1 > 0);
86
elsif($ARGV[0] eq '--verbose') {
90
print STDERR "\nWarning: rtspserver.pl unknown parameter: $ARGV[0]\n";
96
$srcdir = $ENV{'srcdir'} || '.';
99
$pidfile = "$path/". server_pidfilename($proto, $ipvnum, $idnum);
102
$logfile = server_logfilename($logdir, $proto, $ipvnum, $idnum);
105
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
106
$flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
108
exec("server/rtspd $flags");