Пример #1
0
        public void Dispose()
        {
            if (_hik != null)
            {
                _hik.StreamEvent -= onHikStream;
                _hik.Dispose();
                _hik = null;
            }

            if (_renderSource != null)
            {
                _renderSource.ImageSourceChanged -= onImageSource;
                _renderSource.Dispose();
                _renderSource = null;
            }

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

            if (_rtsp != null)
            {
                _rtsp.Dispose();
                _rtsp = null;
            }
        }
Пример #2
0
        public void Dispose()
        {
            if (_rtsp != null)
            {
                _rtsp.HeaderEvent -= onHeader;
                _rtsp.StreamEvent -= onStreamEvent;
                _rtsp.Dispose();
            }
            _rtsp = null;
            if (_renderSource != null)
            {
                _renderSource.Dispose();
            }
            _renderSource = null;
            _writer?.Dispose();
            _writer = null;

            _rtspServer?.Dispose();
            _rtspServer = null;
        }