Esempio n. 1
0
        private void TestAllocateForStream()
        {
            IWMReader read;

            m_AllocateForStream = false;
            m_Opened            = false;

            WMUtils.WMCreateReader(IntPtr.Zero, Rights.Playback, out read);

            read.Open(sFileName, this, new IntPtr(123));
            while (!m_Opened)
            {
                System.Threading.Thread.Sleep(0);
            }

            IWMReaderAdvanced ra = read as IWMReaderAdvanced;

            ra.SetAllocateForStream(1, true);
            ra.SetReceiveStreamSamples(1, true);

            read.Start(0, 0, 1.0f, IntPtr.Zero);
            while (!m_AllocateForStream)
            {
                System.Threading.Thread.Sleep(0);
            }

            read.Stop();
            read.Close();
        }
Esempio n. 2
0
        private void TestReceiveStreamSamples()
        {
            bool b;

            m_read.SetReceiveStreamSamples(1, true);
            m_read.GetReceiveStreamSamples(1, out b);

            Debug.Assert(b);
        }
Esempio n. 3
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);
                }
            }
        }