-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add camera support for windows. #12572
Conversation
Very cool! How far back in Windows versions does this API work? Is it supported on Vista? I was dreading doing this because of DirectShow which I still have nightmares about (only slightly kidding)... |
Accordings to docs, most of them are supported on vista, maybe few are not supported though,like MFEnumDeviceSources function.It has a full support on win7.I think not many users on vista? |
It's just that I don't want a change to our minimum requirements to be accidental, it should be intentional. Currently PPSSPP supports Vista and forwards, so it would be good to be sure - if this API doesn't work there, we could simply disable it on Vista, keeping PPSSPP working for Vista users even though they won't get this feature. |
Yeah, it's right, I will comfirm this through VMware. |
UI/NativeApp.cpp
Outdated
@@ -879,6 +888,11 @@ void NativeShutdownGraphics() { | |||
winAudioBackend = nullptr; | |||
#endif | |||
|
|||
#ifdef _WIN32 | |||
delete winCamera; |
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.
if (winCamera) { delete } ?
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.
Right.
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.
Not really necessary as delete handles nullptr, but it's fine either way I think.
I've tested the first commit and I've observed that the image is stretched because the games ask for 480x272, but the webcam provides 640x480 (I think) which have a different aspect ratio. |
If you pass a smaller source height you should also offset, to center it vertically, I guess. Though I'm not sure how much that matters for these games... |
Improving stuff like that can be done later, good to get the functionality in, so I'm merging. |
Implement this with MF api,referenced some Microsoft docs and samples.
I tested Invizimals, it works fine on my laptop(with a Microsoft HD Webcam).
Preview:
Also has a basic support for multi camera switching.
EDIT by hrydgard: Helps #12337