- Notifications
You must be signed in to change notification settings - Fork3.8k
Fix some bugs in camera.py#2961
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Starbuck5 commentedDec 28, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks Ankith, but yeesh, this diff is something else. This changes 110 lines of a <200 line file. I don't want to expand environment variables for vidcapture, because that thing is 100% deprecated. In fact, in my last camera PR, illume told me I could remove it, but I kept it, in a role reversal for the ages. Actually, vidcapture could use a deprecation warning (ay, it actually has one already). The biggest problem for me is that I'venever been able to get it working, even though there are third party python 3 wheels (vidcapture is py2) that supposedly work. |
Starbuck5 commentedDec 28, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Ok, I've read through everything, it looks good. I'm curious why you refactored all of my individual setup functions into one, though. Maybe colorspace should have a different error message if it isn't able to be imported. Which it could be, if pygame was built without the _camera module. I don't think it's built on Windows 7. |
ankith26 commentedDec 28, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Those functions had some unnecessary repetition, and this one function conditional approach seems more elegant to me than having functions kept in a dict and each of those functions having repetition of
Ah, ok. Should I revert my change then? Well it does not matter either way IG, this vidcapture changes should remain undocumented anyways Another thing I wanted to ask, does windows |
It should work on Windows 8, since every function I used has been around since then, but I’m still not sure. It claims to support it in the docs, so we should try to use it in the code. If it doesn’t work, somebody will open an issue. (Or nobody will care, since not many people use pygame.camera and not many people use Windows 8) |
Alrighty :) |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
Thanks, Ankith!
This looks good to me. You could fix that tiny remaining thing (the default size is wrong on the class), and the it'll be good.
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.
👍 🎉 thanks
Uh oh!
There was an error while loading.Please reload this page.
Initially set out tofix#2936 then noticed a few more issues, got sidetracked as usual and now I make this PR with a few more fixes
Now all functions are defined at all times regardless init state, and error correctly. After a quit, they are reset back to error. Make config envvar accept both
vidcaptureandvideocapture(case insensitive) and fixget_backendsreturningVidCapturewhen it should beVideoCapture, and some more code cleanups around that. Also errors with a more helpful message if a particular backend is unavailable