private void TestInit()
        {
            int           hr;
            IGraphBuilder igb, igb2;

            hr = m_mms.Initialize(StreamType.Read, AMMMultiStream.None, null);
            MsError.ThrowExceptionForHR(hr);

            hr = m_mms.GetFilterGraph(out igb2);
            MsError.ThrowExceptionForHR(hr);

            Debug.Assert(igb2 == null, "GetFilterGraph");

            igb = (IGraphBuilder) new FilterGraph();
            hr  = m_mms.Initialize(StreamType.Read, AMMMultiStream.None, igb);
            MsError.ThrowExceptionForHR(hr);

            hr = m_mms.GetFilterGraph(out igb2);
            MsError.ThrowExceptionForHR(hr);

            Debug.Assert(igb == igb2, "GetFilterGraph");
        }
        private void Config()
        {
            int                 hr;
            IMediaStream        pStream = null;
            IAMMultiMediaStream amms    = (IAMMultiMediaStream) new AMMultiMediaStream();

            hr = amms.AddMediaStream(null, MSPID.PrimaryAudio, AMMStream.None, pStream);
            MsError.ThrowExceptionForHR(hr);

            hr = amms.OpenFile("foo.avi", AMOpenModes.RenderAllStreams);
            MsError.ThrowExceptionForHR(hr);

            IGraphBuilder pGraphBuilder;

            hr = amms.GetFilterGraph(out pGraphBuilder);
            MsError.ThrowExceptionForHR(hr);
            DsROTEntry rot = new DsROTEntry(pGraphBuilder);

            m_mms = (IMultiMediaStream)amms;
        }
Пример #3
0
 public int Initialize(STREAM_TYPE streamType, int dwFlags, IGraphBuilder pFilterGraph)
 {
     if (IsValid)
     {
         throw new InvalidOperationException("Instance is already active.");
     }
     AMMultiMediaStream amms = new AMMultiMediaStream();
     _pMMS = (IAMMultiMediaStream)amms;
     int hr = _pMMS.Initialize(streamType, dwFlags, pFilterGraph);
     if (hr == MSStatus.MS_S_OK)
     {
         hr = _pMMS.GetFilterGraph(out _pGB);
     }
     return hr;
 }