Skip to content

Commit

Permalink
Add error message when VP9 codec is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunderlandkyl committed Jun 17, 2019
1 parent 68124f7 commit 96b89a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/PlusOpenIGTLink/vtkPlusIgtlMessageFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,9 @@ int vtkPlusIgtlMessageFactory::PackVideoMessage(const PlusIgtlClientInfo& client
encoder = new igtl::I420Encoder();
this->IgtlVideoEncoders.insert(std::make_pair(clientEncoderKey, encoder));
}
#if defined(OpenIGTLink_USE_VP9)
else if (videoStream.EncodeVideoParameters.FourCC == IGTL_VIDEO_CODEC_NAME_VP9)
{
#if defined(OpenIGTLink_USE_VP9)
encoder = new igtl::VP9Encoder();
encoder->SetLosslessLink(videoStream.EncodeVideoParameters.Lossless);
encoder->SetKeyFrameDistance(videoStream.EncodeVideoParameters.MinKeyframeDistance);
Expand Down Expand Up @@ -574,12 +574,15 @@ int vtkPlusIgtlMessageFactory::PackVideoMessage(const PlusIgtlClientInfo& client
}
}
this->IgtlVideoEncoders.insert(std::make_pair(clientEncoderKey, encoder));
}
#else
vtkErrorMacro("Cannot encode VIDEO message: VP9 codec is not availiable");
numberOfErrors++;
#endif
}

if (vtkPlusIgtlMessageCommon::PackVideoMessage(videoMessage, trackedFrame, encoder, *matrix) != PLUS_SUCCESS)
{
LOG_ERROR("Failed to create " << messageType << " message - unable to pack image message");
LOG_ERROR("Failed to create " << messageType << " message - unable to pack video message");
numberOfErrors++;
continue;
}
Expand Down

0 comments on commit 96b89a6

Please # to comment.