ONVIF: Make GetStreamUri try both RTP_unicast and RTP-Unicast

The specification gives conflicting values for the unicast stream
type in different parts of the document:

http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl#op.GetStreamUri

Description has: StreamType = "RTP_unicast"

Input has: enum { 'RTP-Unicast', 'RTP-Multicast' }

The Tenvis TH661 only accepts RTP-Unicast but the original code was
using RTP_unicast. Try both and take the result of the first one
which works.
This commit is contained in:
Jon Burgess 2016-03-19 14:50:44 +00:00
parent ed7e3e47b7
commit 909c23c38b
1 changed files with 15 additions and 10 deletions

View File

@ -232,15 +232,20 @@ sub profiles
$profile->get_VideoEncoderConfiguration()->get_RateControl()->get_FrameRateLimit() .
", ";
# Specification gives conflicting values for unicast stream types, try both.
# http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl#op.GetStreamUri
foreach my $streamtype ( 'RTP_unicast', 'RTP-Unicast' ) {
$result = $client->get_endpoint('media')->GetStreamUri( {
StreamSetup => { # ONVIF::Media::Types::StreamSetup
Stream => 'RTP_unicast', # StreamType
Stream => $streamtype, # StreamType
Transport => { # ONVIF::Media::Types::Transport
Protocol => 'RTSP', # TransportProtocol
},
},
ProfileToken => $token, # ReferenceToken
} ,, );
last if $result;
}
die $result if not $result;
# print $result . "\n";