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:
parent
ed7e3e47b7
commit
909c23c38b
|
@ -232,16 +232,21 @@ sub profiles
|
|||
$profile->get_VideoEncoderConfiguration()->get_RateControl()->get_FrameRateLimit() .
|
||||
", ";
|
||||
|
||||
$result = $client->get_endpoint('media')->GetStreamUri( {
|
||||
StreamSetup => { # ONVIF::Media::Types::StreamSetup
|
||||
Stream => 'RTP_unicast', # StreamType
|
||||
Transport => { # ONVIF::Media::Types::Transport
|
||||
Protocol => 'RTSP', # TransportProtocol
|
||||
},
|
||||
},
|
||||
ProfileToken => $token, # ReferenceToken
|
||||
} ,, );
|
||||
die $result if not $result;
|
||||
# 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 => $streamtype, # StreamType
|
||||
Transport => { # ONVIF::Media::Types::Transport
|
||||
Protocol => 'RTSP', # TransportProtocol
|
||||
},
|
||||
},
|
||||
ProfileToken => $token, # ReferenceToken
|
||||
} ,, );
|
||||
last if $result;
|
||||
}
|
||||
die $result if not $result;
|
||||
# print $result . "\n";
|
||||
|
||||
print $result->get_MediaUri()->get_Uri() .
|
||||
|
|
Loading…
Reference in New Issue