make code more robust by handling an undefined get_VideoEncoderConfiguration()

This commit is contained in:
Isaac Connor 2017-07-13 09:38:42 -04:00
parent 4d130b8595
commit 5d96a8d14e
1 changed files with 10 additions and 7 deletions

View File

@ -253,13 +253,16 @@ sub profiles
foreach my $profile ( @{ $profiles } ) { foreach my $profile ( @{ $profiles } ) {
my $token = $profile->attr()->get_token() ; my $token = $profile->attr()->get_token() ;
print $token . ", " . my $VideoEncoderConfiguration = $profile->get_VideoEncoderConfiguration();
$profile->get_Name() . ", " . print join(', ', $token,
$profile->get_VideoEncoderConfiguration()->get_Encoding() . ", " . $profile->get_Name(),
$profile->get_VideoEncoderConfiguration()->get_Resolution()->get_Width() . ", " . ( $VideoEncoderConfiguration ? (
$profile->get_VideoEncoderConfiguration()->get_Resolution()->get_Height() . ", " . $VideoEncoderConfiguration->get_Encoding(),
$profile->get_VideoEncoderConfiguration()->get_RateControl()->get_FrameRateLimit() . $VideoEncoderConfiguration->get_Resolution()->get_Width(),
", "; $VideoEncoderConfiguration->get_Resolution()->get_Height(),
$VideoEncoderConfiguration->get_RateControl()->get_FrameRateLimit(),
) : () )
);
# Specification gives conflicting values for unicast stream types, try both. # Specification gives conflicting values for unicast stream types, try both.
# http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl#op.GetStreamUri # http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl#op.GetStreamUri