コード例 #1
0
ファイル: WavSource.cs プロジェクト: GoshaDE/SuperMFLib
        //-------------------------------------------------------------------
        // Name: Create
        // Description: Static creation function.
        //-------------------------------------------------------------------
        public static void Create(IMFByteStream pStream, out CWavRiffParser ppParser)
        {
            // Create a riff parser for the 'RIFF' container
            ppParser = new CWavRiffParser(pStream);

            // Check the RIFF file type.
            if (ppParser.RiffType() != new FourCC("WAVE"))
            {
                throw new COMException("not a WAVE file", MFError.MF_E_INVALID_FILE_FORMAT);
            }
        }
コード例 #2
0
ファイル: WavSource.cs プロジェクト: GoshaDE/SuperMFLib
        public void Dispose()
        {
            if (m_Riff != null)
            {
                m_Riff.Dispose();
                m_Riff = null;
            }

            if (m_pEventQueue != null)
            {
                Marshal.ReleaseComObject(m_pEventQueue);
                m_pEventQueue = null;
            }

            if (m_pSource != null)
            {
                //m_pSource.Dispose(); Children don't dispose their parents...
                m_pSource = null;
            }

            if (m_pStreamDescriptor != null)
            {
                Marshal.ReleaseComObject(m_pStreamDescriptor);
                m_pStreamDescriptor = null;
            }
            if (m_Log != null)
            {
                m_Log.Dispose();
                m_Log = null;
            }
            GC.SuppressFinalize(this);
        }
コード例 #3
0
ファイル: WavSource.cs プロジェクト: GoshaDE/SuperMFLib
        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);
        }
コード例 #4
0
ファイル: WavSource.cs プロジェクト: GoshaDE/SuperMFLib
        long m_rtCurrentPosition; // Current position in the stream, in 100-ns units

        #endregion Fields

        #region Constructors

        public WavStream(WavSource pSource, CWavRiffParser pRiff, IMFStreamDescriptor pSD)
        {
            int hr;
            m_pEventQueue = null;
            m_Log = new xLog("WavStream");
            #if false
            m_nRefCount(0),
            m_IsShutdown(false),
            m_rtCurrentPosition(0),
            m_discontinuity(false),
            m_EOS(false)
            #endif

            m_pSource = pSource;

            m_pStreamDescriptor = pSD;

            m_Riff = pRiff;

            // Create the media event queue.
            hr = MFExternAlt.MFCreateEventQueue(out m_pEventQueue);
            MFError.ThrowExceptionForHR(hr);
        }