private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (encoder != null) { encoder.Dispose(); } if (webSocketServer != null) { webSocketServer.Dispose(); webSocketServer = null; } }
private void checkBoxWebsocket_CheckedChanged(object sender, EventArgs e) { if (webSocketServer != null) { webSocketServer.Dispose(); webSocketServer = null; } if (checkBoxWebsocket.Checked) { webSocketServer = new WebRTCServer((int)numericWebSocket.Value); unsafe { webSocketServer.OnFillBuffer = OnFillBuffer; } numericMaxClients_ValueChanged(null, null); if (checkBoxDemo.Checked) { checkBoxDemo_CheckedChanged(null, null); } } }
private void checkBoxWebsocket_CheckedChanged(object sender, EventArgs e) { if (webSocketServer != null) { webSocketServer.Dispose(); webSocketServer = null; } if (checkBoxWebsocket.Checked) { webSocketServer = new WebRTCServer((int)numericWebSocket.Value); webSocketServer.mc = mc; numericMaxClients_ValueChanged(null, null); if (checkBoxDemo.Checked) { checkBoxDemo_CheckedChanged(null, null); } } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { foreach (var c in GetStreams()) { if (c.Worker.IsBusy) { c.Worker.CancelAsync(); while (c.Worker.IsBusy) { Application.DoEvents(); Thread.Sleep(100); } } if (c.encoder != null) { c.encoder.Dispose(); c.encoder = null; } if (c.rgbBits != null) { c.rgbBits.Dispose(); c.rgbBits = null; } } if (encoder != null) { encoder.Dispose(); } if (webSocketServer != null) { webSocketServer.Dispose(); webSocketServer = null; } webrtc.CancelAsync(); while (webrtc.IsBusy) { Application.DoEvents(); Thread.Sleep(100); } }
private void checkBoxWebsocket_CheckedChanged(object sender, EventArgs e) { if (webSocketServer != null) { webSocketServer.Dispose(); webSocketServer = null; } if (checkBoxWebsocket.Checked) { webSocketServer = new WebRTCServer((int)numericWebSocket.Value); unsafe { webSocketServer.OnFillBuffer = OnFillBuffer; webSocketServer.OnRenderRemote = OnRenderRemote; } numericMaxClients_ValueChanged(null, null); if (checkBoxDemo.Checked) { checkBoxDemo_CheckedChanged(null, null); } } }