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

Unify camera providers #25

Merged
merged 117 commits into from
Nov 24, 2023
Merged

Unify camera providers #25

merged 117 commits into from
Nov 24, 2023

Conversation

falkoschindler
Copy link
Contributor

@falkoschindler falkoschindler commented Sep 29, 2023

This PR tries to unify different camera provider classes:

  • The active flag has a different meaning. We will rename it to is_connected and let it represent the device state, not whether the user wants it to be active.
  • Maybe we'll introduce enable()/disable() methods and an is_enabled property to allow the user to enable/disable the capturing process.
  • MultiCameraProvider and CombiningCameraProvider are doing the same. We can remove the latter.
  • The CAMERA_ADDED event should be emitted more consistently.

@falkoschindler falkoschindler added the enhancement New feature or request label Sep 29, 2023
@falkoschindler falkoschindler added this to the 0.9.2 milestone Sep 29, 2023
@falkoschindler falkoschindler marked this pull request as ready for review October 2, 2023 12:41
@falkoschindler
Copy link
Contributor Author

falkoschindler commented Oct 2, 2023

We came up with the following class hierarchy for structuring cameras and camera providers in our projects:

RoSys

CameraProvider
UsbCameraProvider
RtspCameraProvider
SimulatedCameraProvider

CalibratedCamera [mixin]
CroppableCamera [mixin]
ExposureCamera [mixin]

Camera
UsbCamera(CroppableCamera) -> UsbDevice
RtspCamera(CroppableCamera) -> RtspDevice
SimulatedCamera(CroppableCamera)

Project 1

FolderCameraProvider
FolderCamera

GalaxyCameraProvider

CameraScanner
IpCamera

Project 2

WifiCamera(CalibratedCamera, Camera)
WifiCameraProvider
WifiCameraProviderHardware
WifiCameraProviderSimulation
WifiCam

@rodja rodja modified the milestones: 0.9.3, 0.9.4 Nov 3, 2023
@NiklasNeugebauer
Copy link
Contributor

Upon further review and if I understand asyncio correctly, the locking mechanism will not be necessary. In fact, the old problem should also be fixable without a lock by moving the check for the existence of the device inside set_parameters.

@falkoschindler falkoschindler merged commit 9d25aba into main Nov 24, 2023
1 check failed
@falkoschindler falkoschindler deleted the active-cameras branch November 24, 2023 10:44
@rodja rodja modified the milestones: 0.9.5, 0.9.6 Nov 26, 2023
@falkoschindler falkoschindler modified the milestones: 0.9.6, 0.9.5 Nov 28, 2023
@rodja rodja linked an issue Dec 1, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USB cameras are not found when plugged into a different port
3 participants