Beispiel #1
0
        private void TestGetSection()
        {
            int   hr;
            short PID = 0x12; // is the PID of a Event Information Table (EIT)
            byte  TID = 0x4e; // is the TID for event_information_section - actual_transport_stream, present/following

            MPEG2Filter mpeg2Filter = new MPEG2Filter();

            mpeg2Filter.bVersionNumber = 1;
            mpeg2Filter.wFilterSize    = 124; // MPEG2_FILTER_VERSION_1_SIZE = Marshal.SizeOf(mpeg2Filter) = 124;

            hr = mpeg2Data.GetSection(PID, TID, mpeg2Filter, 10 * 1000, out sectionList);
            if (hr != unchecked ((int)0x80040206)) //MPEG2_E_SECTION_NOT_FOUND
            {
                DsError.ThrowExceptionForHR(hr);

                Debug.Assert((hr == 0) && (sectionList != null), "IMpeg2Data.GetStreamOfSections");

                TestISectionList();

                Marshal.ReleaseComObject(sectionList);
            }
        }