/// <summary> /// Stop the encoder /// </summary> public void Stop() { try { writer.EndWriting(); writerAdvanced.RemoveSink(netSink); netSink.Close(); } catch (Exception e) { eventLog.WriteEntry("Failed to stop: " + e.ToString(), EventLogEntryType.Error, 1000); Debug.WriteLine("Failed to stop: " + e.ToString()); } }
private void TestMisc() { StringBuilder sb = null; int iLen = 0; int iPort = 1011; m_pSink.Open(ref iPort); m_pSink.GetHostURL(sb, ref iLen); sb = new StringBuilder(iLen); m_pSink.GetHostURL(sb, ref iLen); Debug.Assert(sb.ToString().Contains(iPort.ToString())); m_pSink.Disconnect(); m_pSink.Close(); }
/// <summary> Shut down capture </summary> private void CloseInterfaces() { int hr; try { if (m_mediaCtrl != null) { // Stop the graph hr = m_mediaCtrl.Stop(); m_mediaCtrl = null; m_bRunning = false; } } catch (Exception ex) { Debug.WriteLine(ex); } if (m_pNetSink != null) { m_pNetSink.Close(); Marshal.ReleaseComObject(m_pNetSink); m_pNetSink = null; } #if DEBUG // Remove graph from the ROT if (m_rot != null) { m_rot.Dispose(); m_rot = null; } #endif if (m_graphBuilder != null) { Marshal.ReleaseComObject(m_graphBuilder); m_graphBuilder = null; } }
void CloseNetworkSink() { NetworkSink.Close(); }
protected void CloseSink() { AppLogger.Message("ASFNetSink -- CloseSink"); _netSink.Close(); }