Skip to content

Commit

Permalink
check input encoding format
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Sep 1, 2020
1 parent ae0c8d6 commit ed72b72
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/systems/camera_video_recorder/CameraVideoRecorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,22 @@ bool CameraVideoRecorderPrivate::OnRecordVideo(const msgs::VideoRecord &_msg,
this->recordVideoSavePath = _msg.save_filename();

if (this->recordVideoFormat.empty())
{
this->recordVideoFormat = "mp4";

}
else
{
this->recordVideoFormat = common::lowercase(this->recordVideoFormat);
if (this->recordVideoFormat != "mp4" && this->recordVideoFormat!= "ogv" &&
this->recordVideoFormat != "avi")
{
ignerr << "Video encoding format: '" << this->recordVideoFormat
<< "' not supported. Available formats are: mp4, ogv, and avi."
<< std::endl;
_res.set_data(false);
return true;
}
}
// create filename with timestamped suffix if path is not specified
if (this->recordVideoSavePath.empty())
{
Expand Down

0 comments on commit ed72b72

Please sign in to comment.