private IEnumerator CreateVideoCapture() { NRVideoCapture.CreateAsync(false, captureObject => { if (captureObject == null) { Debug.LogError("Can't get a NRVideoCapture object."); return; } var resolution = NRVideoCapture.SupportedResolutions .OrderByDescending(r => r.width * r.height) .First(); var frameRate = NRVideoCapture.GetSupportedFrameRatesForResolution(resolution) .OrderByDescending(fps => fps) .First(); var cameraParameters = new CameraParameters { hologramOpacity = 0.0f, frameRate = frameRate, cameraResolutionWidth = resolution.width, cameraResolutionHeight = resolution.height, pixelFormat = CapturePixelFormat.BGRA32, blendMode = BlendMode.Blend }; _videoCapture = captureObject; _videoCapture.StartVideoModeAsync( cameraParameters, NRVideoCapture.AudioState.ApplicationAndMicAudio, result => SetState(State.Idle)); }); yield break; }
void CreateVideoCaptureTest() { NRVideoCapture.CreateAsync(false, delegate(NRVideoCapture videoCapture) { if (videoCapture != null) { m_VideoCapture = videoCapture; } }); }
void CreateVideoCaptureTest() { NRVideoCapture.CreateAsync(false, delegate(NRVideoCapture videoCapture) { if (videoCapture != null) { m_VideoCapture = videoCapture; } else { Debug.LogError("Failed to create VideoCapture Instance!"); } }); }