From ed4df1d7f849a22c794bf83889825f271f67c156 Mon Sep 17 00:00:00 2001 From: brosenberg Date: Wed, 12 Dec 2018 10:29:21 -0500 Subject: [PATCH] Add MPFVideoCapture constructor that takes a single string parameter. --- detection/api/include/MPFVideoCapture.h | 2 ++ detection/api/src/MPFVideoCapture.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/detection/api/include/MPFVideoCapture.h b/detection/api/include/MPFVideoCapture.h index f11cc6c..ab74348 100644 --- a/detection/api/include/MPFVideoCapture.h +++ b/detection/api/include/MPFVideoCapture.h @@ -57,6 +57,8 @@ namespace MPF { namespace COMPONENT { explicit MPFVideoCapture(const MPFVideoJob &videoJob, bool enableFrameTransformers=true, bool enableFrameFiltering=true); + explicit MPFVideoCapture(const std::string &videoPath); + bool Read(cv::Mat &frame); diff --git a/detection/api/src/MPFVideoCapture.cpp b/detection/api/src/MPFVideoCapture.cpp index c057fff..b5205fe 100644 --- a/detection/api/src/MPFVideoCapture.cpp +++ b/detection/api/src/MPFVideoCapture.cpp @@ -60,6 +60,12 @@ namespace MPF { namespace COMPONENT { } + MPFVideoCapture::MPFVideoCapture(const std::string &videoPath) + : MPFVideoCapture(MPFVideoJob("", videoPath, 0, -1, {}, {}), false, false) + { + } + + IFrameTransformer::Ptr MPFVideoCapture::GetFrameTransformer(bool enableFrameTransformers, const MPFVideoJob &job) const { if (enableFrameTransformers) {