Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Bjørn Villa
qstream
Commits
8800a16a
Commit
8800a16a
authored
Jul 12, 2012
by
Olav Kvittem
Browse files
option -wait for join
parent
956129b4
Changes
1
Show whitespace changes
Inline
Side-by-side
qstream
View file @
8800a16a
...
...
@@ -38,14 +38,13 @@ use XML::DOM;
use
XML
::
Twig
;
#
use
mpegpackets
;
$
DEFAULT_PORT
=
1955
;
my
$
timeout
=
1
;
#
frac
seconds
to
wait
for
receiving
packets
#
my
oh
my
,
more
globals
my
($
rtmp
,$
period
,$
last
,$
debug
,$
swfurl
,$
pageurl
,$
flash_version
,$
reconnect
);
require
"newgetopt.pl"
;
@
opts
=(
'list'
,
'man'
,
'fullformat'
,
'net'
,
'rtp'
,
'mpeg'
,
'pcap'
,
'crude'
,
'bins=s'
,
'log'
,
'nperiod=s'
,
'period=s'
,
'last=s'
,
'packets=s'
,
'src=s'
,
'flow_key=s'
,
'flow_no=s'
,
'flow_min=s'
,
'nohead'
,
'dump=s'
,
'format=s'
,
'id=s'
,
'sum=s'
,
'ttl'
,
'rtt=s'
,
'codec=s'
,
'log'
,
'verbose'
,
'v'
,
'h'
,
'debug'
,
'av'
,
'xml=s'
,
'rtmp'
,
'tcp'
,
'port=s'
,
'swfurl=s'
,
'pageurl=s'
,
'flashversion=s'
,
'new'
,
'q'
,
'exclude=s'
,
'report=s'
,
'filename'
,
'test'
,
'ipv6'
,
'p=s'
,
'name=s'
,
'tcp_t'
);
@
opts
=(
'list'
,
'man'
,
'fullformat'
,
'net'
,
'rtp'
,
'mpeg'
,
'pcap'
,
'crude'
,
'bins=s'
,
'log'
,
'nperiod=s'
,
'period=s'
,
'last=s'
,
'packets=s'
,
'src=s'
,
'flow_key=s'
,
'flow_no=s'
,
'flow_min=s'
,
'nohead'
,
'dump=s'
,
'format=s'
,
'id=s'
,
'sum=s'
,
'ttl'
,
'rtt=s'
,
'codec=s'
,
'log'
,
'verbose'
,
'v'
,
'h'
,
'debug'
,
'av'
,
'xml=s'
,
'rtmp'
,
'tcp'
,
'port=s'
,
'swfurl=s'
,
'pageurl=s'
,
'flashversion=s'
,
'new'
,
'q'
,
'exclude=s'
,
'report=s'
,
'filename'
,
'test'
,
'ipv6'
,
'p=s'
,
'name=s'
,
'tcp_t'
,
'wait=s'
);
&
NGetOpt
(@
opts
)
||
die
pod2usage
(
1
);
die
pod2usage
(
1
)
if
$
opt_h
;
...
...
@@ -55,6 +54,11 @@ my $codec = $opt_codec || 'G.711';
my
$
rtt
=
$
opt_rtt
||
10
;
#
ms
round
trip
time
of
the
connection
pod2usage
(-
verbose
=>
2
)
if
$
opt_man
;
my
$
initial_wait
=
$
opt_wait
||
3
;
#
frac
seconds
to
wait
initially
my
$
waittime
=$
initial_wait
;
my
$
next_wait
=
0.1
;
#
frac
seconds
to
wait
for
receiving
between
packets
my
@
streams
=@
ARGV
;
if
($
opt_bins
){
...
...
@@ -624,6 +628,7 @@ sub eat_stream {
my $packet;
last if ! $uninterrupted || $endstream;
if ($select->can_read($timeout) && ($packet = $rtp->recv())){
my $timeout=$next_wait;
my $ssrc = $packet->ssrc();
$cur_id=$packet->source_ip . ", $address:$port";
...
...
@@ -686,6 +691,7 @@ sub eat_stream {
if ($select->can_read($timeout) && $mc->recv($packet, 1560)) {
last if ! $uninterrupted || $endstream;
my $timeout=$next_wait;
$n_packets++;
my $ssrc = $mc->peerhost;
my $cur_id = $mc->peerhost . ":" . $mc->peerport . "->$address:$port";
...
...
@@ -697,6 +703,7 @@ sub eat_stream {
next if $opt_src and $opt_src ne $cur_id;
$tc=[gettimeofday]; # current flow time
if( $t0){
$elapsed=tv_interval ( $t0, $tc);
} else {
...
...
@@ -3927,6 +3934,8 @@ usage="$0 [option]... [file...|ip/|:port]...
=item B<-packets> packets - exit after packets
=item B<-wait> seconds - wait for initial join ($initial_wait)
=item B<-src source> - limit stats to given source
=item B<-flow_key> flow key - limit stats to this flow(src_ip:src_port->dest_ip:dest_port)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment