Beispiel #1
0
        // Tests for IMpeg2Data methods

        private void TestGetStreamOfSection()
        {
            int hr;
            ManualResetEvent mre = new ManualResetEvent(false);
            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
            //short NID = 1;    // 1 is the Network ID of the broadcast selectionned

            MPEG2Filter mpeg2Filter = new MPEG2Filter();

            mpeg2Filter.bVersionNumber = 1;
            mpeg2Filter.wFilterSize    = 124; // MPEG2_FILTER_VERSION_1_SIZE = Marshal.SizeOf(mpeg2Filter) = 124;
            //mpeg2Filter.fSpecifyTableIdExtension = true;
            //mpeg2Filter.TableIdExtension = NID;

            hr = mpeg2Data.GetStreamOfSections(PID, TID, mpeg2Filter, mre.SafeWaitHandle.DangerousGetHandle(), out mpeg2Stream);
            DsError.ThrowExceptionForHR(hr);

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

            TestIMpeg2Stream();

            Marshal.ReleaseComObject(mpeg2Stream);
        }