private void CloseInternal() { if (_factory != null && _parameters.AecDump) { _factory.StopAecDump(); } _logger.Debug(TAG, "Closing peer connection."); if (_rtcEventLog != null) { // RtcEventLog should stop before the peer connection is disposed. _rtcEventLog.Stop(); _rtcEventLog = null; } _logger.Debug(TAG, "Closing audio source."); if (_audioSource != null) { _audioSource.Dispose(); _audioSource = null; } _logger.Debug(TAG, "Stopping capturer."); if (_videoCapturer != null) { _videoCapturer.StopCapture(); _videoCapturer.Dispose(); _videoCapturerStopped = true; _videoCapturer = null; } _logger.Debug(TAG, "Closing video source."); if (_videoSource != null) { _videoSource.Dispose(); _videoSource = null; } _localRenderer = null; _remoteRenderer = null; _logger.Debug(TAG, "Closing peer connection factory."); if (_factory != null) { _factory.Dispose(); _factory = null; } _logger.Debug(TAG, "Closing peer connection done."); _peerConnectionEvents.OnPeerConnectionClosed(); PeerConnectionFactory.StopInternalTracingCapture(); PeerConnectionFactory.ShutdownInternalTracer(); _executor.Release(); }
public void Stop() { Loggers.Current.Log(LogLevel.Info, "Shutting down..."); cancellationTokenSource.Cancel(); videoThread.Join(); trackerManager.Clear(); videoSource.Dispose(); updateTimer.Dispose(); discoveryClient.Close(); driverClient.Close(); trackerClient.Close(); }
public bool CleanupPlayer(string name) { lock (mVSTable.SyncRoot) { IVideoSource vs = mVSTable[name] as IVideoSource; if (vs != null) { mVSTable.Remove(name); vs.Close(); vs.Dispose(); return(true); } } return(false); }
public bool CleanupVideoSource(String name) { lock (mVideoSourstTable.SyncRoot) { IVideoSource vs = (IVideoSource)mVideoSourstTable[name]; if (vs != null) { mVideoSourstTable.Remove(name); vs.Close(); vs.Dispose(); return(true); } } return(false); }
protected virtual void Dispose(bool disposing) { if (_disposed) { return; } ClearMotionZones(); Detect = null; NewFrame = null; PlayingFinished = null; Plugin = null; ForeBrush?.Dispose(); BackBrush?.Dispose(); DrawFont?.Dispose(); _framerates?.Clear(); Mask?.Dispose(); Mask = null; VideoSource?.Dispose(); VideoSource = null; try { MotionDetector?.Reset(); } catch (Exception ex) { ErrorHandler?.Invoke(ex.Message); } MotionDetector = null; _disposed = true; }
public bool Close(string name) { lock (mVideoSources.SyncRoot) { IVideoSource vs = mVideoSources[name] as IVideoSource; if (vs != null) { if (vs.Close()) { mVideoSources.Remove(name); vs.Factory.FreeVideoSource(vs); vs.Dispose(); return(true); } return(false); } else { return(true); } } }