public int SetStream(object pStream) { // Make sure we *never* leave this entry point with an exception try { TRACE("CWavSink::SetStream"); if (pStream != null) { m_pStream = new CWavStream(this, (IMFByteStream)pStream); } else { throw new COMException("Null pstream", E_Pointer); } return S_Ok; } catch (Exception e) { return Marshal.GetHRForException(e); } }
//------------------------------------------------------------------- // Name: Shutdown // Description: Releases resources held by the media sink. //------------------------------------------------------------------- public int Shutdown() { // Make sure we *never* leave this entry point with an exception try { TRACE("CWavSink::Shutdown"); GC.SuppressFinalize(this); lock (this) { try { CheckShutdown(); m_pStream.Shutdown(); } finally { m_IsShutdown = true; SafeRelease(m_pClock); m_pClock = null; if (m_pStream != null) { m_pStream.Dispose(); m_pStream = null; } } } return S_Ok; } catch (Exception e) { return Marshal.GetHRForException(e); } }
public CWavSink(IMFByteStream pStream) { TRACE("CWavSink::CWavSink(IMFByteStream)"); if (pStream != null) { Init(); m_pStream = new CWavStream(this, (IMFByteStream)pStream); } else { throw new COMException("Null pstream", E_Pointer); } }