diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-04-26 17:45:57 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-04-26 17:45:57 +0200 |
commit | 776ce9ce4557dd7de7614ec1840b8d602bc88d84 (patch) | |
tree | e3b668b23f622c83d6a98638a2fa46ad6cb8af45 /bin/capture+encode+serve | |
parent | b6236e761a3a2e307295a62594aa877221e05405 (diff) |
Apply payload from outside cam/mic subroutine.
Diffstat (limited to 'bin/capture+encode+serve')
-rwxr-xr-x | bin/capture+encode+serve | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bin/capture+encode+serve b/bin/capture+encode+serve index 5e23505..b263c22 100755 --- a/bin/capture+encode+serve +++ b/bin/capture+encode+serve @@ -94,8 +94,7 @@ our $nextpayload = 0; sub cam { - my $device = shift; - my $payload = "pay" . $nextpayload++; + my ( $device, $payload ) = @_; my $factory = Gst::RTSPMediaFactory->new(); my $pipeline = join( @@ -108,13 +107,12 @@ sub cam @{ $PIPELINE{$VFORMAT}{'VENC'} }, ) ); - return "( $pipeline name=$payload )"; + return "( $pipeline name=pay$payload )"; } sub mic { - my $device = shift; - my $payload = "pay" . $nextpayload++; + my ( $device, $payload ) = @_; my $factory = Gst::RTSPMediaFactory->new(); my $pipeline = join( @@ -126,7 +124,7 @@ sub mic @{ $PIPELINE{$AFORMAT}{'AENC'} }, ) ); - return "( $pipeline name=$payload )"; + return "( $pipeline name=pay$payload )"; } sub factory @@ -161,7 +159,7 @@ for my $i ( 0 .. $#VDEVICES ) { my $mount = "/cam$i"; $mounts->add_factory( $mount, - factory( cam( $VDEVICES[$i] ) ) + factory( cam( $VDEVICES[$i], $nextpayload++ ) ) ); push @mounts, $mount; } @@ -169,7 +167,7 @@ for my $i ( 0 .. $#ADEVICES ) { my $mount = "/mic$i"; $mounts->add_factory( $mount, - factory( mic( $ADEVICES[$i] ) ) + factory( mic( $ADEVICES[$i], $nextpayload++ ) ) ); push @mounts, $mount; } |