Exemple #1
0
        private void TestSetRateEx()
        {
            int hr;

            hr = m_sbms.SetRateEx(1.0, 22);
            DsError.ThrowExceptionForHR(hr);
        }
        void ITimeShifting.SetRate(double rate)
        {
            if (rate >= 0 && rate < 0.1)
            {
                rate = 0.1;
            }
            else if (rate < 0 && rate > -0.1)
            {
                rate = -0.1;
            }

            int hr = 0;

            IStreamBufferMediaSeeking2 mediaSeeking2 = this.streamBufferSource as IStreamBufferMediaSeeking2;

            if (mediaSeeking2 != null)
            {
                //mediaSeeking2.SetRateEx(rate, 25);
                hr = mediaSeeking2.SetRateEx(rate, 25);
                if (hr == 0)
                {
                    return;
                }
            }

            IStreamBufferMediaSeeking mediaSeeking1 = this.streamBufferSource as IStreamBufferMediaSeeking;

            if (mediaSeeking1 != null)
            {
                hr = mediaSeeking1.SetRate(rate);
                if (hr == 0)
                {
                    return;
                }
            }

            IMediaSeeking mediaSeeking0 = this.graphBuilder2 as IMediaSeeking;

            if (mediaSeeking0 != null)
            {
                hr = mediaSeeking0.SetRate(rate);
                if (hr == 0)
                {
                    return;
                }
            }
        }