-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing cap to VideoCapture constructor #157
Allow passing cap to VideoCapture constructor #157
Conversation
Please try to match parameters names from openCV: VideoCapture(const String &filename, int apiPreference=[CAP_ANY]) Opens a video file or a capturing device or an IP video stream for video capturing with API Preference. the parametere is named apiPreference, not cap |
cc/io/VideoCapture.cc
Outdated
@@ -27,11 +27,19 @@ NAN_METHOD(VideoCapture::New) { | |||
FF::TryCatch tryCatch("VideoCapture::New"); | |||
FF_ASSERT_CONSTRUCT_CALL(); | |||
VideoCapture* self = new VideoCapture(); | |||
|
|||
uint32_t apiPreference = cv::CAP_ANY; | |||
if (info.Length() == 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the latest vertion allow a 3th parameter, so the test should be >=2
and is you want a more cleaner code throw an not implemented yet if more than 2 parameters are provided.
the 3th parameter is only available in openCV ~~ 4.5+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New changes should cover all constructor variant a user might try to use and throw if it is not yet implemented
I live you check why some CI task fail. |
Tests should pass now on all OSes |
the test still failed on macos. |
LGTM |
Currently working on a project where i need functionality of passing explicit
CAPs
toVideoCapture
, figured i contribute a little.