Silence-GitHub / BBMetalImage

A high performance Swift library for GPU-accelerated image/video processing based on Metal.
MIT License
985 stars 125 forks source link

How to access AVCaptureDevice #27

Closed pennywise94 closed 4 years ago

pennywise94 commented 4 years ago

I am currently wondering if it is possible to access the AVCaptureDevice of the BBMetalCamera. I am trying to implement some logic towards enabling/disabling flash, zooming in/out on the camera, ...

Any ideas?

Silence-GitHub commented 4 years ago

Use configureCamera(_ block: (AVCaptureDevice) -> Void) method

camera.configureCamera { device in
    if device. isFlashAvailable {
        // Enable flash
    }
}
pennywise94 commented 4 years ago

Awesome.