saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
2.96k stars 1.19k forks source link

How to automatically preview the multiple cameras as they got attached? #579

Open EjazAmir opened 3 years ago

EjazAmir commented 3 years ago

I'm facing an issue, i want to preview the cameras automatically as they got attached to the android device, im using ExampleTest07, Kindly suggest any solution. I'm really stuck at it.

eddykins11 commented 3 years ago

In onAttach(final UsbDevice device), add: mUSBMonitor.requestPermission(device);

EjazAmir commented 3 years ago

In onAttach(final UsbDevice device), add: mUSBMonitor.requestPermission(device);

thanks, but what if we have multiple cameras? how to assign cameraview to each usbDevice.

eddykins11 commented 3 years ago

Are you using the same camera model each time or different cameras?

EjazAmir commented 3 years ago

different camera model each time, if you fixed the issue kindly come in person, as i want to clarify some more things about this, Badly stuck in this. Regards

eddykins11 commented 3 years ago

You can create 2 mOnDeviceConnectListeners and filter each one by productID of your cameras as a quick solution

MultipleCamActivity.java.zip

eddykins11 commented 3 years ago

I don't think I can help with that and I'd be surprised if that's possible with this library I'm afraid, but maybe someone can correct me.

EjazAmir commented 3 years ago

yes, check the testExample4

imran855 commented 3 years ago

@eddykins11

Are you using the same camera model each time or different cameras?

I am using the same camera model. Is there any suggestion to auto connect?

imran855 commented 3 years ago

I solved my problem. Now it's working fine.

Thanhluc98 commented 2 years ago

I solved my problem. Now it's working fine.

Hi imran855! How you can solve this problem? I connect the same camera model, but only can open one.