public HResult GetEvent(MFEventFlag dwFlags, out IMFMediaEvent ppEvent) { // NOTE: // GetEvent can block indefinitely, so we don't hold the lock. // This requires some juggling with the event queue pointer. HResult hr = HResult.S_OK; IMFMediaEventQueue spQueue = null; ppEvent = null; lock (_spSource) { // Check shutdown hr = CheckShutdown(); // Get the pointer to the event queue. if (MFError.Succeeded(hr)) { spQueue = _spEventQueue; } } // Now get the event. if (MFError.Succeeded(hr)) { hr = spQueue.GetEvent(dwFlags, out ppEvent); } return(hr); }
public static extern void MFCreateEventQueue( out IMFMediaEventQueue ppMediaEventQueue );
public void Dispose() { if (m_pRiff != null) { m_pRiff.Dispose(); m_pRiff = null; } if (m_pStream != null) { m_pStream.Dispose(); m_pStream = null; } if (m_pEventQueue != null) { Marshal.ReleaseComObject(m_pEventQueue); m_pEventQueue = null; } if (m_pPresentationDescriptor != null) { Marshal.ReleaseComObject(m_pPresentationDescriptor); m_pPresentationDescriptor = null; } if (m_Log != null) { m_Log.Dispose(); m_Log = null; } GC.SuppressFinalize(this); }