/** * Use this for initialization. */ private void Start() { // Variable initialization this.ShouldCapture = false; this.videoCaptureObject = null; this.tryStartRecording = false; this.tryStopRecording = false; this.isRecording = false; this.tryStartVideoMode = false; this.CaptureStarted = false; this.disposeAction = null; this.namingIndex = 0; // Get reference to other scripts in the scene this.logger = DebugLogger.Instance; // Deactivate this script if necessary components are missing if (this.logger == null) { Debug.LogError("VideoCapture: Script references not set properly."); this.enabled = false; return; } // Set camera parameters and create a MR-VideoCapture object this.cameraParameters = new MRC.CameraParameters { hologramOpacity = 1.0f, frameRate = this.VideoFramerate, cameraResolutionWidth = this.VideoResolution.width, cameraResolutionHeight = this.VideoResolution.height, pixelFormat = MRC.CapturePixelFormat.BGRA32 }; MRC.VideoCapture.CreateAsync(true, this.OnVideoCaptureCreated); }
/** * Callback method that is called after the MR-VideoCapture object has been created. * * @param captureObject reference to MR-VideoCapture */ private void OnVideoCaptureCreated(MRC.VideoCapture captureObject) { // Save the current capture object if (captureObject != null) { this.videoCaptureObject = captureObject; } else { this.logger.Log("Failed to create MR-VideoCapture instance."); } }
/** * This method disposes of the inactive capturing object. */ public void DisposeInactive() { this.logger.Log("Video capture object disposed."); this.videoCaptureObject.Dispose(); this.videoCaptureObject = null; }
public IntPtr GetUnsafePointerToVideoDeviceController() { return(VideoCapture.GetUnsafePointerToVideoDeviceController_Internal(this.m_NativePtr)); }
private static void InvokeOnStoppedRecordingVideoToDiskDelegate(VideoCapture.OnStoppedRecordingVideoCallback callback, long hResult) { callback(VideoCapture.MakeCaptureResult(hResult)); }
private static void InvokeOnVideoModeStoppedDelegate(VideoCapture.OnVideoModeStoppedCallback callback, long hResult) { callback(VideoCapture.MakeCaptureResult(hResult)); }
public static IEnumerable <float> GetSupportedFrameRatesForResolution(Resolution resolution) { return(VideoCapture.GetSupportedFrameRatesForResolution_Internal(resolution.width, resolution.height)); }