/// <summary> /// Restarts the video encoding stream. This clears the output buffers /// to stop encoded video data from going out. If the callback is provided /// it will be called before the next packet is added the the queue. /// </summary> /// <param name="f"></param> public void RestartStream(Callback f) { VideoStartPacket packet = new VideoStartPacket(videoCapture.Width, videoCapture.Height); videoEncoder.StopEncoding(); outputBuffers.Clear(); if (f != null) { f(); } AddPacket(packet); videoEncoder.StartEncoding(settings.EncoderSettings); }
protected void readVideoStart(VideoStartPacket packet) { if (decoder != null) { decoder.StopDecoding(); decoder = null; } decoder = new VideoDecoder(ffmpeg, packet.VideoWidth, packet.VideoHeight); screen.SetVideoSize(packet.VideoWidth, packet.VideoHeight); decoder.VideoPreview = screen; decoder.StartDecoding(); }