Skip to content

Add CameraFeed support for Windows #105476

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

0xafbf
Copy link
Contributor

@0xafbf 0xafbf commented Apr 17, 2025

I started this PR based on this one: #98416

I cleaned up the structures, where original PR presented every format (width+height+framerate+encoding) as a different feed.
With this PR we create a CameraFeed per device, and each feed exposes the different formats.

Still WIP and missing some final cleanup.

0xafbf added 3 commits April 16, 2025 09:51
Remove movie writer and some other changes

Seems like everything compiles

Now everything compiles
@0xafbf 0xafbf requested review from a team as code owners April 17, 2025 05:10
@0xafbf 0xafbf marked this pull request as draft April 17, 2025 05:10
@0xafbf 0xafbf changed the title Camera support squashed Add CameraFeed support for Windows Apr 17, 2025
@shiena
Copy link
Contributor

shiena commented Apr 17, 2025

@0xafbf
Great work! I was also working on something similar, but I've been having trouble with frequent specification changes.

Also, I'd like to request the addition of the frame_changed signal, as it seems to be missing.
https://docs.godotengine.org/en/stable/classes/class_camerafeed.html#class-camerafeed-signal-format-changed

The signal implementation seems to be missing in the macOS version, so I've submitted a PR to address this.
#104809

@AThousandShips
Copy link
Member

If you are using someone else's work in your PR you need to give then co-author status, at least if you copy any large portions of your code from them

@vonweller

This comment was marked as off-topic.

@AThousandShips
Copy link
Member

Please do not bump PRs without adding additional information

@shiena
Copy link
Contributor

shiena commented May 12, 2025

@0xafbf
This patch should fix the build. Clarified the ambiguous fn.

diff --git a/modules/camera/camera_win.cpp b/modules/camera/camera_win.cpp
--- a/modules/camera/camera_win.cpp	(revision e777a599ed82278742eb4f8471058cf967e11b8a)
+++ b/modules/camera/camera_win.cpp	(date 1747086735202)
@@ -43,9 +43,9 @@
 #ifndef defer
 template<typename Fn>
 struct _deferClass {
-	Fn fn;
-	_deferClass(Fn&& fn): fn(fn){}
-	~_deferClass() { fn(); }
+	Fn _fn;
+	_deferClass(Fn&& fn): _fn(fn){}
+	~_deferClass() { _fn(); }
 };
 
 #define DEFER_CONCAT_INTERNAL(a, b) a##b

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.

4 participants