Make onvif handle no resolution graceully
This commit is contained in:
parent
d281d2243c
commit
ac31abd30c
|
@ -279,13 +279,11 @@ sub profiles {
|
|||
if ( $verbose ) {
|
||||
print "Received message:\n" . $result . "\n";
|
||||
}
|
||||
my @profiles;
|
||||
|
||||
my $profiles = $result->get_Profiles();
|
||||
|
||||
foreach my $profile ( @{ $profiles } ) {
|
||||
foreach my $profile ( @{ $result->get_Profiles() } ) {
|
||||
|
||||
my $token = $profile->attr()->get_token() ;
|
||||
my $Name = $profile->get_Name();
|
||||
|
||||
my $VideoEncoderConfiguration = $profile->get_VideoEncoderConfiguration();
|
||||
if ( ! $VideoEncoderConfiguration ) {
|
||||
|
@ -293,6 +291,9 @@ sub profiles {
|
|||
next;
|
||||
}
|
||||
|
||||
my $token = $profile->attr()->get_token() ;
|
||||
my $Name = $profile->get_Name();
|
||||
|
||||
# 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', 'RTP-multicast', 'RTP-Multicast' ) {
|
||||
|
@ -310,12 +311,16 @@ sub profiles {
|
|||
next if ! $MediaUri;
|
||||
my $Uri = $MediaUri->get_Uri();
|
||||
next if ! $Uri;
|
||||
my $Resolution = $VideoEncoderConfiguration->get_Resolution();
|
||||
my $Width = $Resolution ? $Resolution->get_Width() : 0;
|
||||
my $Height = $Resolution ? $Resolution->get_Height() : 0;
|
||||
|
||||
push @profiles, {
|
||||
print join(', ', $token,
|
||||
$Name,
|
||||
$VideoEncoderConfiguration->get_Encoding(),
|
||||
$VideoEncoderConfiguration->get_Resolution()->get_Width(),
|
||||
$VideoEncoderConfiguration->get_Resolution()->get_Height(),
|
||||
$Width,
|
||||
$Height,
|
||||
$VideoEncoderConfiguration->get_RateControl()->get_FrameRateLimit(),
|
||||
$Uri,
|
||||
) . "\n";
|
||||
|
|
Loading…
Reference in New Issue