Пример #1
0
        private void Config()
        {
#if ALLOW_UNTESTED_INTERFACES
            int hr = 0;

            parser = (IDvbSiParser) new DvbSiParser();
            graph  = new BdaGraph();
            graph.InitializeGraph();
            graph.MakeTuneRequest();
            graph.RunGraph();

            hr = parser.Initialize(graph.bdaSecTab as IMpeg2Data);
            Debug.Assert(hr == 0, "Initialize failed !!!");

            IDVB_SDT sdt = null;
            hr = parser.GetSDT(0x42, null, out sdt);
            DsError.ThrowExceptionForHR(hr);

            int recordCount = 0;

            hr = sdt.GetCountOfRecords(out recordCount);
            DsError.ThrowExceptionForHR(hr);

            for (int i = 0; i < recordCount; i++)
            {
                short serviceId = 0;
                hr = sdt.GetRecordServiceId(i, out serviceId);
                DsError.ThrowExceptionForHR(hr);

                hr = parser.GetEIT(0x4e, serviceId, out eit);
                if (eit != null)
                {
                    break;
                }
            }

            Marshal.ReleaseComObject(sdt);

            Debug.Assert(eit != null, "Can't get a SDT object");
#endif
        }