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

Convert to user selected camera matching #1556

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

Conversation

oh-yes-0-fps
Copy link

No description provided.

if (getClass() != obj.getClass()) return false;
PVUsbCameraInfo other = (PVUsbCameraInfo) obj;

// Windows device number is not significant. See
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 kinda-sorta true on Linux, too. /dev/videoN isn't consistent across reboots or hot-plugs.

Copy link
Author

Choose a reason for hiding this comment

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

This was just copy pasted over from old code, ill look more into it.

List<CameraInfo> devices = filterAllowedDevices(getConnectedCameras(), Platform.getCurrentPlatform());

List<String> infoNames = cameraInfoMap.values().stream()
.map(CameraInfo::name)
Copy link
Contributor

Choose a reason for hiding this comment

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

is name a unique identifier here?

Copy link
Author

Choose a reason for hiding this comment

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

This is actually the area I was struggling with, how do I check what devices are new only by using the data accessible in a camera configuration? The reason it needs to be out of a camera configuration is due to how the loaded configs are passed in and I have to fill their uniqueName slots without actually ever polling the hardware.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we just lock down by USB port? So if the USB port of this device is already in use? Or what am I forgetting

&& !newCam.getSettables().videoModes.isEmpty()) {
cameraSources.add(newCam);
}
if (configuration.cameraType == CameraType.ZeroCopyPicam && is_pi) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can cameraType ever be picamera, but is_pi be false?

Copy link
Author

Choose a reason for hiding this comment

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

I'm unsure, this was just moved old code

private String ignoredCamerasRegex = "";

private final AtomicBoolean configsLoaded = new AtomicBoolean(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens on first boot if no cameras are plugged in? Should we special case always matching the cameras that are connected at first boot, or the first camera ever plugged in?

Copy link
Author

@oh-yes-0-fps oh-yes-0-fps Nov 11, 2024

Choose a reason for hiding this comment

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

It should just load no configs right? So the user has to select the cameras. I could see an argument for first set of cameras ever detected but i feel like thats not super needed and is just adding edge cases for us to test. Maybe in the ui if theres no configs after it fetches it moves to the camera selection tab?

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds reasonable to me. or a modal, or big flashing light telling people to take action. Just want to make "why can't i see any cameras???!!! they're plugged in????" something that's intuitive for users to fix.


const needsCamerasConfigured = computed<boolean>(() => {
const ret = useCameraSettingsStore().cameras.length === 0 || useCameraSettingsStore().cameras[0] === PlaceholderCameraSettings;
console.log(ret);
Copy link
Member

Choose a reason for hiding this comment

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

cant put console.log in computed, just put the val as an element in the page and look at that.

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

Successfully merging this pull request may close these issues.

4 participants