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() .
|
$profile->get_VideoEncoderConfiguration()->get_RateControl()->get_FrameRateLimit() .
|
||||||
", ";
|
", ";
|
||||||
|
|
||||||
$result = $client->get_endpoint('media')->GetStreamUri( {
|
# Specification gives conflicting values for unicast stream types, try both.
|
||||||
StreamSetup => { # ONVIF::Media::Types::StreamSetup
|
# http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl#op.GetStreamUri
|
||||||
Stream => 'RTP_unicast', # StreamType
|
foreach my $streamtype ( 'RTP_unicast', 'RTP-Unicast' ) {
|
||||||
Transport => { # ONVIF::Media::Types::Transport
|
$result = $client->get_endpoint('media')->GetStreamUri( {
|
||||||
Protocol => 'RTSP', # TransportProtocol
|
StreamSetup => { # ONVIF::Media::Types::StreamSetup
|
||||||
},
|
Stream => $streamtype, # StreamType
|
||||||
},
|
Transport => { # ONVIF::Media::Types::Transport
|
||||||
ProfileToken => $token, # ReferenceToken
|
Protocol => 'RTSP', # TransportProtocol
|
||||||
} ,, );
|
},
|
||||||
die $result if not $result;
|
},
|
||||||
|
ProfileToken => $token, # ReferenceToken
|
||||||
|
} ,, );
|
||||||
|
last if $result;
|
||||||
|
}
|
||||||
|
die $result if not $result;
|
||||||
# print $result . "\n";
|
# print $result . "\n";
|
||||||
|
|
||||||
print $result->get_MediaUri()->get_Uri() .
|
print $result->get_MediaUri()->get_Uri() .
|
||||||
|
|
Loading…
Reference in New Issue