예제 #1
0
        private void MakeATuneRequestAndRunTheGraph()
        {
            int      hr = 0;
            ILocator locator;

            // Assume a DVBT hardware.
            // Those values are valid for me but must be modified to be valid depending on your location
            hr = tuneRequest.get_Locator(out locator);
            DsError.ThrowExceptionForHR(hr);

            hr = locator.put_CarrierFrequency(586000);
            DsError.ThrowExceptionForHR(hr);

            hr = tuneRequest.put_Locator(locator);
            DsError.ThrowExceptionForHR(hr);

            Marshal.ReleaseComObject(locator);

            hr = (tuneRequest as IDVBTuneRequest).put_ONID(8442);
            hr = (tuneRequest as IDVBTuneRequest).put_TSID(1);
            hr = (tuneRequest as IDVBTuneRequest).put_SID(260);
            DsError.ThrowExceptionForHR(hr);

            if (tuner.Validate(tuneRequest) == 0)
            {
                hr = tuner.put_TuneRequest(tuneRequest);
                hr = (graphBuilder as IMediaControl).Run();
            }
            else
            {
                Debug.Fail("TuneRequest is not valid");
            }
        }
예제 #2
0
        private void TestTuneRequestAndValidate()
        {
            int          hr = 0;
            ITuneRequest tuneRequest;
            ILocator     locator;

            // I have this value as global varible but i have to test get_TuneRequest...
            hr = tuner.get_TuneRequest(out tuneRequest);
            Debug.Assert(hr == 0, "ITuner.get_TuneRequest");

            hr = tuneRequest.get_Locator(out locator);
            DsError.ThrowExceptionForHR(hr);

            // Assume a DVBT hardware
            // A valid carrier frequency must be passed...
            hr = (locator as IDVBTLocator).put_CarrierFrequency(586000);
            hr = tuneRequest.put_Locator(locator);

            // Select the first channel in the first transport stream found...
            hr = (tuneRequest as IDVBTuneRequest).put_ONID(-1);
            hr = (tuneRequest as IDVBTuneRequest).put_TSID(-1);
            hr = (tuneRequest as IDVBTuneRequest).put_SID(-1);

            // Is it a valid tune request ?
            hr = tuner.Validate(tuneRequest);

            Debug.Assert(hr == 0, "ITuner.Validate");

            hr = tuner.put_TuneRequest(tuneRequest);

            Debug.Assert(hr == 0, "ITuner.put_TuneRequest");
        }
예제 #3
0
        private void TestLocator()
        {
            int      hr = 0;
            ILocator locator;

            hr = tuneRequest.get_Locator(out locator);
            DsError.ThrowExceptionForHR(hr);

            Debug.Assert(locator != null, "ITuneRequest.get_Locator");

            hr = tuneRequest.put_Locator(locator);
            DsError.ThrowExceptionForHR(hr);

            Debug.Assert(hr == 0, "ITuneRequest.put_Locator");

            Marshal.ReleaseComObject(locator);
        }
예제 #4
0
        private void MakeATuneRequestAndRunTheGraph()
        {
            int      hr = 0;
            ILocator locator;

            // Those values are valid for me but must be modified to be valid depending on your Satellite dish
            hr = tuneRequest.get_Locator(out locator);
            DsError.ThrowExceptionForHR(hr);

            hr = locator.put_CarrierFrequency(11591000);
            DsError.ThrowExceptionForHR(hr);

            hr = (locator as IDVBSLocator).put_SignalPolarisation(Polarisation.LinearV);
            DsError.ThrowExceptionForHR(hr);

            hr = locator.put_SymbolRate(20000);
            DsError.ThrowExceptionForHR(hr);

            hr = tuneRequest.put_Locator(locator);
            DsError.ThrowExceptionForHR(hr);

            Marshal.ReleaseComObject(locator);

            hr = (tuneRequest as IDVBTuneRequest).put_ONID(8442);
            hr = (tuneRequest as IDVBTuneRequest).put_TSID(1);
            hr = (tuneRequest as IDVBTuneRequest).put_SID(260);
            DsError.ThrowExceptionForHR(hr);

            if (tuner.Validate(tuneRequest) == 0)
            {
                hr = tuner.put_TuneRequest(tuneRequest);
                hr = (graphBuilder as IMediaControl).Run();
            }
            else
            {
                Debug.Fail("TuneRequest is not valid");
            }
        }
        private void DoAValidTuneRequest()
        {
            int      hr = 0;
            ILocator locator;

            hr = tuneRequest.get_Locator(out locator);
            DsError.ThrowExceptionForHR(hr);

            // Assume a DVBT hardware
            // A valid carrier frequency must be passed...
            hr = (locator as IDVBTLocator).put_CarrierFrequency(586000);
            hr = tuneRequest.put_Locator(locator);

            // Select the first channel in the first transport stream found...
            hr = (tuneRequest as IDVBTuneRequest).put_ONID(-1);
            hr = (tuneRequest as IDVBTuneRequest).put_TSID(-1);
            hr = (tuneRequest as IDVBTuneRequest).put_SID(-1);

            if (tuner.Validate(tuneRequest) == 0)
            {
                hr = tuner.put_TuneRequest(tuneRequest);
            }
        }
예제 #6
0
        public void MakeTuneRequest()
        {
            int      hr = 0;
            ILocator locator;

            // Get a tuning space for this network type
            tuningSpace = BDAUtils.GetTuningSpace(networkType);

            hr = tuner.put_TuningSpace(tuningSpace);
            DsError.ThrowExceptionForHR(hr);

            // Create a tune request from this tuning space
            tuneRequest = BDAUtils.CreateTuneRequest(tuningSpace);

            // Is it okay ?
            hr = tuner.Validate(tuneRequest);
            //DsError.ThrowExceptionForHR(hr);

            if (networkType == BDANetworkType.DVBT)
            {
                // Those values are valid for me but must be modified to be valid depending on your location
                hr = tuneRequest.get_Locator(out locator);
                DsError.ThrowExceptionForHR(hr);

                hr = locator.put_CarrierFrequency(586166);
                DsError.ThrowExceptionForHR(hr);

                hr = tuneRequest.put_Locator(locator);
                DsError.ThrowExceptionForHR(hr);

                Marshal.ReleaseComObject(locator);

                hr = (tuneRequest as IDVBTuneRequest).put_ONID(8442);
                DsError.ThrowExceptionForHR(hr);
                hr = (tuneRequest as IDVBTuneRequest).put_TSID(1);
                DsError.ThrowExceptionForHR(hr);
                hr = (tuneRequest as IDVBTuneRequest).put_SID(259);
                DsError.ThrowExceptionForHR(hr);

/*
 *      hr = locator.put_CarrierFrequency(522166);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      hr = tuneRequest.put_Locator(locator);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      Marshal.ReleaseComObject(locator);
 *
 *      hr = (tuneRequest as IDVBTuneRequest).put_ONID(8442);
 *      DsError.ThrowExceptionForHR(hr);
 *      hr = (tuneRequest as IDVBTuneRequest).put_TSID(3);
 *      DsError.ThrowExceptionForHR(hr);
 *      hr = (tuneRequest as IDVBTuneRequest).put_SID(769);
 *      DsError.ThrowExceptionForHR(hr);
 */
/*
 *      hr = locator.put_CarrierFrequency(562166);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      hr = tuneRequest.put_Locator(locator);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      Marshal.ReleaseComObject(locator);
 *
 *      hr = (tuneRequest as IDVBTuneRequest).put_ONID(8442);
 *      DsError.ThrowExceptionForHR(hr);
 *      hr = (tuneRequest as IDVBTuneRequest).put_TSID(6);
 *      DsError.ThrowExceptionForHR(hr);
 *      hr = (tuneRequest as IDVBTuneRequest).put_SID(1537);
 *      DsError.ThrowExceptionForHR(hr);
 */
            }

            if (networkType == BDANetworkType.DVBS)
            {
                // Those values are valid for me but must be modified to be valid depending on your Satellite dish

/*
 *      hr = tuneRequest.get_Locator(out locator);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      hr = locator.put_CarrierFrequency(11591000);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      hr = (locator as IDVBSLocator).put_SignalPolarisation(Polarisation.LinearV);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      hr = locator.put_SymbolRate(20000);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      hr = tuneRequest.put_Locator(locator);
 *      DsError.ThrowExceptionForHR(hr);
 *
 *      Marshal.ReleaseComObject(locator);
 *
 *      hr = (tuneRequest as IDVBTuneRequest).put_ONID(8442);
 *      DsError.ThrowExceptionForHR(hr);
 *      hr = (tuneRequest as IDVBTuneRequest).put_TSID(1);
 *      DsError.ThrowExceptionForHR(hr);
 *      hr = (tuneRequest as IDVBTuneRequest).put_SID(260);
 *      DsError.ThrowExceptionForHR(hr);
 */

                hr = tuneRequest.get_Locator(out locator);
                DsError.ThrowExceptionForHR(hr);

                hr = locator.put_CarrierFrequency(11607000);
                DsError.ThrowExceptionForHR(hr);

                hr = (locator as IDVBSLocator).put_SignalPolarisation(Polarisation.LinearV);
                DsError.ThrowExceptionForHR(hr);

                hr = locator.put_SymbolRate(6944);
                DsError.ThrowExceptionForHR(hr);

                hr = tuneRequest.put_Locator(locator);
                DsError.ThrowExceptionForHR(hr);

                Marshal.ReleaseComObject(locator);

                hr = (tuneRequest as IDVBTuneRequest).put_ONID(144);
                DsError.ThrowExceptionForHR(hr);
                hr = (tuneRequest as IDVBTuneRequest).put_TSID(100);
                DsError.ThrowExceptionForHR(hr);
                hr = (tuneRequest as IDVBTuneRequest).put_SID(289);
                DsError.ThrowExceptionForHR(hr);
            }

            hr = tuner.put_TuneRequest(tuneRequest);
            if (hr < 0)
            {
                Debug.Fail("TuneRequest is not valid");
            }
        }