Example #1
0
        private void TestType()
        {
            Guid g;

            m_Props.GetType(out g);

            Debug.Assert(g == MediaType.Video);
        }
Example #2
0
        //------------------------------------------------------------------------------
        // Name: CWMVCopy::GetProfileInfo()
        // Desc: Gets the profile information from the reader.
        //------------------------------------------------------------------------------
        protected void GetProfileInfo()
        {
            IWMStreamConfig pStreamConfig  = null;
            IWMMediaProps   pMediaProperty = null;

            //
            // Get the profile of the reader
            //
            m_pReaderProfile = m_pReader as IWMProfile;

            //
            // Get stream count
            //
            m_pReaderProfile.GetStreamCount(out m_dwStreamCount);

            //
            // Allocate memory for the stream type array and stream number array
            //
            m_pguidStreamType = new Guid[m_dwStreamCount];
            m_pwStreamNumber  = new short[m_dwStreamCount];

            for (int i = 0; i < m_dwStreamCount; i++)
            {
                m_pReaderProfile.GetStream(i, out pStreamConfig);

                try
                {
                    //
                    // Get the stream number of the current stream
                    //
                    pStreamConfig.GetStreamNumber(out m_pwStreamNumber[i]);

                    //
                    // Set the stream to be received in compressed mode
                    //
                    m_pReaderAdvanced.SetReceiveStreamSamples(m_pwStreamNumber[i], true);

                    pMediaProperty = pStreamConfig as IWMMediaProps;

                    //
                    // Get the stream type of the current stream
                    //
                    pMediaProperty.GetType(out m_pguidStreamType[i]);
                }
                finally
                {
                    Marshal.ReleaseComObject(pStreamConfig);
                }
            }
        }