GooglePlayServicesComponents icon indicating copy to clipboard operation
GooglePlayServicesComponents copied to clipboard

[Request] Support getCamera() instance in CameraSource

Open hungnguyenepiserver opened this issue 4 years ago • 4 comments

Xamarin.GooglePlayServices.Vision.Common

Class: CameraSource I would like to request a method to get the instance of android.hardware.Camera in CameraSource project.

I know CameraSource.cs is basically simulate the class CameraSource.java in Firebase quickstart project. Please help me provide this method. I need the instance of Camera to handle Torch of Camera

hungnguyenepiserver avatar Jul 20 '21 07:07 hungnguyenepiserver

Thanks for the feedback

I see no getCamera in Xamarin.GooglePlayServices.Vision.Common.

https://developers.google.com/android/reference/com/google/android/gms/vision/CameraSource

OK. I did not decompile aar/jar, but in above mentioned docs it is not available.

I think I will need a minimal sample to understand your problem. Thanks.

Notes for future investigations:

Few java examples:

https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/ui/camera/CameraSource.java

moljac avatar Jul 20 '21 07:07 moljac

Thank you, @moljac

I saw its private in the google source. My current project is quite big for publish ass a sample for you. Please think that I'm using camera for barcode scanning. And I need the instance of Android.Hardware.Camera that in used in CameraSource to do the code turn on flashlight following:

Camera cam = Camera.open();
Parameters p = cam.getParameters(); p.setFlashMode(Parameters.FLASH_MODE_TORCH); cam.setParameters(p); cam.startPreview();

Currently, Camera in Xamarin doesn't support get current camera , like Camera.Reconnect(). If we call Camera.Open() the camera will have a trouble. So I need the instance of in used Camera of CameraSource

hungnguyenepiserver avatar Jul 21 '21 05:07 hungnguyenepiserver

@moljac Can I contribute for this package to help you a little bit? I have exp in this topic in Android native

hungnguyenepiserver avatar Jul 29 '21 08:07 hungnguyenepiserver

@hungnguyenepiserver Thanks for your offer.

Answer is: sure. It is open source and PRs are welcome.

The only problem is: I'm on vacation till 2021-08-20 and everything will be delayed a bit.

moljac avatar Jul 31 '21 08:07 moljac