             if let currentDeviceInput = AVCaptureDeviceInput.deviceInput(withMediaType: mediaType, captureSession: session) {
                 session.removeInput(currentDeviceInput)
                 if currentDeviceInput.device.hasMediaType(AVMediaType.video) {
-                    self.removeKeyValueObservers(currentDeviceInput.device)
+                    self.removeDeviceObservers(currentDeviceInput.device)
                 }
             }
             

                session.addInput(input)
                
                if input.device.hasMediaType(AVMediaType.video) {
                    self.addKeyValueObservers(input.device)
                    self.updateVideoOutputSettings()
                    self._videoInput = input
                } else {

        })
    }
    
    internal func removeDeviceObservers(_ currentDevice: AVCaptureDevice) {
        for observer in self._observers {
            observer.invalidate()
        }
