/// <summary> /// This method renders the gaze and truncated user video /// with the mixer dmo into a new video file. /// </summary> private void RenderGazeAndUserVideo() { this.newSplash.Header = "Rendering gaze and user video"; this.newSplash.IsPreviewVisible = true; ImageFromVectorGraphics imageHandler = new ImageFromVectorGraphics( this.videoExportProperties.OutputVideoProperties, this.videoExportProperties.GazeVideoProperties.StreamStartTime, this.videoExportProperties.GazeVideoProperties.StreamEndTime, this.videoFramePusher, this.replayPicture.RenderFrame); imageHandler.Progress += this.imageHandler_Progress; imageHandler.Finished += this.imageHandler_Finished; // Setup usercam video filename. this.directShowInterfaceWithWebcam = new DSRecordWithDMO( imageHandler, this.videoExportProperties, this.newSplash.PreviewWindow); this.directShowInterfaceWithWebcam.Completed += this.directShowInterfaceWithWebcam_Completed; this.replayPicture.ResetPicture(); if (this.replayPicture.InitDrawingElements()) { // Update pictures properties this.replayPicture.ReplayPosition = this.currentTrialTime; this.replayPicture.BeginUpdate(); this.Cursor = Cursors.Default; this.directShowInterfaceWithWebcam.Start(); } }
/// <summary> /// The <see cref="DSRecordWithDMO.Completed"/> event handler for the video /// export. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/>.</param> private void directShowInterfaceWithWebcam_Completed(object sender, EventArgs e) { if (this.directShowInterfaceWithWebcam != null) { this.directShowInterfaceWithWebcam.Completed -= this.directShowInterfaceWithWebcam_Completed; this.directShowInterfaceWithWebcam.Dispose(); this.directShowInterfaceWithWebcam = null; } if (this.desCombine != null) { this.desCombine.Dispose(); } this.ShowVideoExportResult(); }