/// <summary> /// Stops the active camera. /// </summary> public override void Stop() { if (hasInitDone) { NatCam.Pause(); } }
/// <summary> /// Pause this instance. /// </summary> public void Pause() { if (NatCam.IsPlaying) { NatCam.Pause(); } }
private void ActivateCamera(CameraFacing facing) { if (!initialized) { return; } // Any spray compositing that happens while the camera is initializing should spray pitch black. activeTexture = Texture2D.blackTexture; staleFramesReceived = 0; var device = (facing == CameraFacing.Front) ? DeviceCamera.FrontCamera : DeviceCamera.RearCamera; if (device != null) { // We can't change the resolution while the preview is playing. if (NatCam.IsPlaying) { NatCam.Pause(); } NatCam.ActiveCamera = device; NatCam.OnPreviewStart += OnPreviewStart; NatCam.OnPreviewUpdate += OnPreviewUpdate; NatCam.ActiveCamera.SetFramerate(deviceCameraFramerate); NatCam.ActiveCamera.SetResolution(deviceCameraResolution); // The exposure and focus modes are only available on the native interface. if (NatCam.Interface == NatCamInterface.NativeInterface) { NatCam.ActiveCamera.FocusMode = deviceCameraFocusMode; NatCam.ActiveCamera.ExposureMode = deviceCameraExposureMode; } NatCam.Play(); if (FacingChanged != null) { FacingChanged(facing); } } else if (Debug.isDebugBuild) { Debug.LogError("CameraCapture: no camera for this orientation"); } }
public void SetActive(bool active) { /* * if (active == NatCam.IsPlaying) * return; */ if (active) { NatCam.Play(); IsPlaying = true; } else { NatCam.Pause(); IsPlaying = false; } }
/// <summary> /// Raises the stop button click event. /// </summary> public void OnStopButtonClick() { NatCam.Pause(); }
/// <summary> /// Raises the pause button click event. /// </summary> public void OnPauseButtonClick() { NatCam.Pause(); }
public override void StopCameraPreview() { NatCam.Pause(); }