mavlink-camera-manager icon indicating copy to clipboard operation
mavlink-camera-manager copied to clipboard

About the duplicated device

Open joaoantoniocardoso opened this issue 2 years ago • 1 comments

What seems to be 'duplicated devices' on our frontend is actually somewhat an extended feature from Linux Kernel.

image

Because the user can't use (I'm assuming this based on my tests) both videos from an unique bus, and the commands from one affects the others, I think we should deal with it, and use it in a more concise way.

My initial thought on that is that maybe we could merge all the /dev/video* that shares the same bus, but probably we can't simply merge the controls/capabilities and expect it to works using the devices interchangeably - lets say video0 has JPEG encode, and to the video2 has H264, but if we merge both and keep only the video0 reference, can we use video0 as H264? Probably not, then we would need to add an abstraction layer just to map each capability to its original device (in this example, map JPEG to video0 and H264 to video2).

Maybe we could change our model to something that encapsulates each device inside each bus:

{
'': {
    'bus': 'usb-0000:09:00.3-2.4',
    'devices': [
      {
        'name': 'Video Capture 6',
        'device_path': '/dev/video2',
        ...
      },
      {
        'name': 'Video Capture 5',
        'device_path': '/dev/video0',
        ...
      }
    ]
    'controls': ...,
    'formats': ...,
    ...
  }
}

Do we want to deal with it, or we'll let it to the user? Any ideas?

joaoantoniocardoso avatar Dec 29 '21 13:12 joaoantoniocardoso