예제 #1
0
        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);
        }
예제 #2
0
파일: Externs.cs 프로젝트: gitter-badger/GS
 public static extern void MFCreateEventQueue(
     out IMFMediaEventQueue ppMediaEventQueue
     );
예제 #3
0
        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);
        }