Skip to content

[BUG] CameraAddedEvent do not properly update the cameras #102

@sguillemette123

Description

@sguillemette123

When i receive the CameraAdded event. I expected the CameraManager.getAllCamera() to have it but the list had no elements. So i have no way to actually get the added camera so i can call openSession on it.

In the IDE, if i call refreshCamera before calling getAllCamera it work.. but refreshCamera isn't a public method. Technically, it should have been called if i did setRefreshInterval to 0 but it doesn't look like to be called in reality.

Here what i do,,

private CameraAddedListener cameraAddedListener = event -> {
    cameraConnected = true;

    Platform.runLater(() -> initializeCameraConnexion());
    log.info("Camera added detected: {}", event);
  };

then..

public void initializeCameraConnexion() {
    log.info("initializeCameraConnexion()");

    if (CameraManager.getAllCameras().size() > 0) {
      this.camera = CameraManager.getAllCameras().get(0);
    }

If i look at the getAllCameras() here the results...
https://i.imgur.com/sReHBLC.png

Now if i refresh manually just before here the results...
https://i.imgur.com/yMSSwDZ.png

Problem i have is that calling refreshCameras was possible because i am in the IDE but this method is not public. There is no way to instant refresh manually the cameras list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions