private void ShowVideoForm(string title) { if (testForm == null || testForm.IsDisposed) { testForm = new VideoForm { StartPosition = FormStartPosition.CenterParent, Width = 1280, Height = 720, Text = title, }; imageProvider?.Close(true); imageProvider = new D3DImageRenderer(); var reciver = remoteClient.VideoReceiver; imageProvider.Setup(reciver.sharedTexture); imageProvider.Start(); var video = testForm.userControl11; video.DataContext = imageProvider; testForm.FormClosed += TestForm_FormClosed; } testForm.Visible = true; }
public void Close() { if (imageProvider != null) { imageProvider.Close(); } if (VideoReceiver != null) { VideoReceiver.UpdateBuffer -= VideoReceiver_UpdateBuffer; VideoReceiver.Stop(); VideoReceiver = null; } if (AudioReceiver != null) { AudioReceiver.Stop(); AudioReceiver = null; } if (factory != null) { factory.Abort(); factory = null; } }