Exemplo n.º 1
0
        private void CleanUp()
        {
            logger.Debug("VideoStreamer::CleanUp()");

            if (videoEncoder != null)
            {
                videoEncoder.DataEncoded -= VideoEncoder_DataEncoded;
                videoEncoder.Close();
                videoEncoder = null;
            }


            videoSource.BufferUpdated -= ScreenSource_BufferUpdated;

            RtpSender?.Close();

            state = StreamerState.Closed;
        }
Exemplo n.º 2
0
        public void Close()
        {
            logger.Debug("AudioStreamer::Close()");
            closing = true;

            if (RtpSender != null)
            {
                RtpSender.Close();
                RtpSender = null;
            }

            if (audioSource != null)
            {
                audioSource.DataAvailable -= AudioSource_DataAvailable;
            }

            if (audioResampler != null)
            {
                audioResampler.Close();
                audioResampler = null;
            }
        }