Пример #1
0
        private void Config()
        {
            int                 hr;
            IMediaStream        ms;
            IAMMediaTypeStream  mts;
            IMediaStream        ms2  = null;
            IAMMultiMediaStream mms  = (IAMMultiMediaStream) new AMMultiMediaStream();
            IAMMediaTypeStream  amts = (IAMMediaTypeStream) new AMMediaTypeStream();
            IAMMediaTypeSample  mtp;

            //AMMediaType pmt = new AMMediaType();
            //pmt.majorType = MediaType.Video;

            // hr = amts.SetFormat(pmt, 0);
            // MsError.ThrowExceptionForHR(hr);

            hr = mms.Initialize(StreamType.Write, AMMMultiStream.None, null);

            hr = mms.AddMediaStream(amts, null, AMMStream.None, ms2);
            MsError.ThrowExceptionForHR(hr);

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

            mts = ms as IAMMediaTypeStream;
            hr  = mts.CreateSample(100, IntPtr.Zero, 0, null, out mtp);
            MsError.ThrowExceptionForHR(hr);

            m_ss = mtp as IStreamSample;

            hr = mms.SetState(StreamState.Run);
            MsError.ThrowExceptionForHR(hr);
        }
Пример #2
0
        private void Config()
        {
            int                 hr;
            IMediaStream        ms;
            IMediaStream        ms2  = null;
            IAMMultiMediaStream mms  = (IAMMultiMediaStream) new AMMultiMediaStream();
            IAMMediaTypeStream  amts = (IAMMediaTypeStream) new AMMediaTypeStream();

            AMMediaType pmt = new AMMediaType();

            pmt.majorType = MediaType.Video;

            //hr = mms.AddMediaStream(null, MSPID.PrimaryAudio, AMMStream.None, null);
            //MsError.ThrowExceptionForHR(hr);

            //pmt = null;
            //hr = amts.GetFormat(pmt, 0);
            //hr = amts.SetFormat(pmt, 0);

            hr = mms.AddMediaStream(amts, null, AMMStream.None, ms2);
            MsError.ThrowExceptionForHR(hr);

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

            m_mts = ms as IAMMediaTypeStream;
        }
        private void TestAdd()
        {
            int          hr;
            IMediaStream pStream = null;

            hr = m_mms.AddMediaStream(null, MSPID.PrimaryAudio, AMMStream.AddDefaultRenderer, pStream);
            MsError.ThrowExceptionForHR(hr);
        }
Пример #4
0
        private void Config()
        {
            int hr;

            m_mms = (IAMMultiMediaStream) new AMMultiMediaStream();

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

            hr = m_mms.AddMediaStream(null, MSPID.PrimaryVideo, AMMStream.None, null);
            MsError.ThrowExceptionForHR(hr);

            hr = m_mms.EnumMediaStreams(0, out m_ms);
            MsError.ThrowExceptionForHR(hr);

            hr = m_mms.EnumMediaStreams(1, out m_ms2);
            MsError.ThrowExceptionForHR(hr);
        }
Пример #5
0
        private void Config2()
        {
            int hr;

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

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

            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_mts = pStream as IAMMediaTypeStream;
        }
Пример #6
0
        private void Config()
        {
            int          hr;
            IMediaStream pStream = null;

            IAMMultiMediaStream mms = (IAMMultiMediaStream) new AMMultiMediaStream();

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

            hr = mms.GetFilter(out m_msf);
            MsError.ThrowExceptionForHR(hr);

            hr = mms.OpenFile("foo.avi", AMOpenModes.RenderAllStreams);
            MsError.ThrowExceptionForHR(hr);
        }
Пример #7
0
        private void Config2()
        {
            int hr;
            IAMMultiMediaStream mms     = (IAMMultiMediaStream) new AMMultiMediaStream();
            IMediaStream        pStream = null;

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

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

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

            m_ams = pStream as IAudioMediaStream;
        }
        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;
        }