public void Close()
{
try
{
logger.Debug("Media Manager closing.");
_stop = true;
if (_audioChannel != null)
{
_audioChannel.SampleReady -= AudioChannelSampleReady;
_audioChannel.Close();
}
if (_rtpManager != null)
{
_rtpManager.OnRemoteVideoSampleReady -= EncodedVideoSampleReceived;
_rtpManager.OnRemoteAudioSampleReady -= RemoteAudioSampleReceived;
_rtpManager.Close();
}
}
catch (Exception excp)
{
logger.Error("Exception Media Manager Close. " + excp);
}
}
/// <summary> /// Application closing, shutdown the SIP, Google Voice and STUN clients. /// </summary> private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { _mediaManager.Close(); _sipClient.Shutdown(); if (_stunClient != null) { _stunClient.Stop(); } }