Skip to content
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

VideoIO classes refactoring #16246

Merged

Conversation

VadimLevin
Copy link
Contributor

@VadimLevin VadimLevin commented Dec 27, 2019

Changes:

  • Added explicit to VideoCapture constructors with 2
    arguments, 1 of them has default value
  • Applied library code style
  • Introduced 2 debug macros to improve readability of the code

@VadimLevin
Copy link
Contributor Author

This change breaks ABI compatibility. @alalek what do you think about it?

@@ -628,7 +628,7 @@ class CV_EXPORTS_W VideoCapture
implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.
@sa The list of supported API backends cv::VideoCaptureAPIs
*/
CV_WRAP VideoCapture(const String& filename, int apiPreference = CAP_ANY);
CV_WRAP explicit VideoCapture(const String& filename, int apiPreference = CAP_ANY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is useful change

@@ -640,13 +640,13 @@ class CV_EXPORTS_W VideoCapture

@sa The list of supported API backends cv::VideoCaptureAPIs
*/
CV_WRAP VideoCapture(int index, int apiPreference = CAP_ANY);
CV_WRAP explicit VideoCapture(int index, int apiPreference = CAP_ANY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useful

@vpisarev
Copy link
Contributor

vpisarev commented Jan 10, 2020

@VadimLevin, if I remember correctly, the goal was to add some profiles to video writer to enhance functionality. Here I just see many changes and absolutely no steps towards the goal that we stated. I have no principal objections against the changes in .cpp, as long as it passes all the tests. But, except for adding "explicit" to the constructors, please, undo all the changes in header files, because the lost compatibility is too high price for a questionably better style.

@VadimLevin
Copy link
Contributor Author

VadimLevin commented Jan 13, 2020

@vpisarev Yes, I separated work into several independent steps and this was one of them.
virtual methods in this class may lead to unexpected behavior for users, those want to inherited their classes from VideoWriter and VideoCapture because open and release are called in constructor and destructor respectively. If inheritance is not supposed to be, so there is no reasons to leave virtual methods in these classes at all (I try to follow the rule C.132: Don’t make a function virtual without reason from Cpp Core Guidelines)

@VadimLevin VadimLevin force-pushed the dev/vlevin/videoio_classes_cleanup branch from 5c5ce9d to e2f3446 Compare January 22, 2020 08:01
@VadimLevin VadimLevin changed the base branch from master to 3.4 January 22, 2020 08:01
@VadimLevin VadimLevin changed the base branch from 3.4 to master January 22, 2020 08:02
  - Added `explicit` to `VideoCapture` constructors with 2
    arguments, 1 of them has default value
  - Applied library code style
  - Introduced 2 debug macros to improve readability of the code
@VadimLevin VadimLevin force-pushed the dev/vlevin/videoio_classes_cleanup branch from e2f3446 to 3fe9dfa Compare January 22, 2020 09:05
@asmorkalov
Copy link
Contributor

@vpisarev @alalek Please take a look again.
@VadimLevin Please update PR description after scope change.

@asmorkalov
Copy link
Contributor

@vpisarev friendly reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants