-
Notifications
You must be signed in to change notification settings - Fork 34
feat: VFT enable on windows #163
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| namespace Baballonia.VFTCapture; | ||
|
|
||
| #if WINDOWS | ||
| public partial class ViveFacialTracker | ||
| { | ||
| public enum ViveFacialTrackerError_t | ||
| { | ||
| VFT_OK = 0, | ||
| VFT_COM_ERR = -1, | ||
| VFT_TRACKER_NOT_FOUND = -2, | ||
| VFT_FAIL = -3, | ||
| }; | ||
|
|
||
| private const string UsbCommunicatorLibrary = "blluc"; | ||
|
|
||
| [LibraryImport(UsbCommunicatorLibrary)] | ||
| public static partial int enableViveFacialTracker(); | ||
| [LibraryImport(UsbCommunicatorLibrary)] | ||
| public static partial int disableViveFacialTracker(); | ||
|
|
||
| public static bool activate_tracker(int fd) | ||
| { | ||
| return enableViveFacialTracker() == (int)ViveFacialTrackerError_t.VFT_OK; | ||
| } | ||
|
|
||
| public static bool deactivate_tracker(int fd) | ||
| { | ||
| return disableViveFacialTracker() == (int)ViveFacialTrackerError_t.VFT_OK; | ||
| } | ||
| } | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -601,7 +601,10 @@ public async Task StartCamera(CameraControllerModel model) | |
| var backend = model.SelectedCaptureMethod; | ||
| if (!model.CaptureMethodVisible) | ||
| backend = ""; | ||
|
|
||
| if (OperatingSystem.IsWindows() && address == "HTC Multimedia Camera" && string.IsNullOrEmpty(backend)) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not how you're supposed to set the backend.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I'm aware the current solution is hacky. The main issue I encountered was that the OpenCV backend is preferred over the VFT backend. I can play with the factory all I want but Babballonia will still prefer OpenCV over ViveFacialTracker on Windows at least.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be able to select the VFT capture with the preferred backend dropdown. |
||
| { | ||
| backend = "VFTCapture"; | ||
| } | ||
|
|
||
| bool success = false; | ||
| switch (model.Camera) | ||
|
|
||
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.
This is what is supposed to set the capture backend, if this returns true then it gets added as a valid backend, but I'm not sure what
addressresolves to. If we have to, we can change this to also pass in the full name of the camera.