private void TestEnum()
        {
            int          hr;
            IMediaStream pStream;

            hr = m_mms.EnumMediaStreams(0, out pStream);
            MsError.ThrowExceptionForHR(hr);
            Debug.Assert(hr == 0 && pStream != null, "EnumMediaStreams");

            hr = m_mms.EnumMediaStreams(1, out pStream);
            MsError.ThrowExceptionForHR(hr);

            Debug.Assert(hr == 1 && pStream == null, "EnumMediaStreams2");
        }
Esempio n. 2
0
        private void Config()
        {
            int hr;

            IAMMultiMediaStream amms    = (IAMMultiMediaStream) new AMMultiMediaStream();
            IMultiMediaStream   mms     = (IMultiMediaStream)amms;
            IMediaStream        pStream = null;

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

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

            hr = mms.EnumMediaStreams(0, out pStream);
            MsError.ThrowExceptionForHR(hr);

            m_ams = pStream as IAudioMediaStream;
        }