Exemplo n.º 1
0
        /// <summary>
        /// Immediately stop the entire transmission system
        /// </summary>
        private void StopTransmissionPipeline()
        {
            //Stop microphone
            if (_microphone != null && _microphone.IsRecording)
            {
                _microphone.StopCapture();
            }

            //Dispose preprocessor and encoder
            if (_preprocessor != null)
            {
                if (_microphone != null)
                {
                    _microphone.Unsubscribe(_preprocessor);
                }
                if (_encoder != null)
                {
                    _preprocessor.Unsubscribe(_encoder);
                }

                _preprocessor.Dispose();
                _preprocessor = null;
            }

            if (_encoder != null)
            {
                _encoder.Dispose();
                _encoder = null;
            }

            _encoderSubscribed = false;
        }
        /// <summary>
        /// Immediately stop the entire transmission system
        /// </summary>
        private void StopTransmissionPipeline()
        {
#if !NCRUNCH
            Profiler.BeginSample("CapturePipelineManager: StopTransmissionPipeline");
#endif

            //Stop microphone
            if (_microphone != null && _microphone.IsRecording)
            {
                _microphone.StopCapture();
            }

            //Dispose preprocessor and encoder
            if (_preprocessor != null)
            {
                if (_microphone != null)
                {
                    _microphone.Unsubscribe(_preprocessor);
                }
                if (_encoder != null)
                {
                    _preprocessor.Unsubscribe(_encoder);
                }

                _preprocessor.Dispose();
                _preprocessor = null;
            }

            if (_encoder != null)
            {
                _encoder.Dispose();
                _encoder = null;
            }

            _encoderSubscribed = false;

#if !NCRUNCH
            Profiler.EndSample();
#endif
        }