Пример #1
0
        /// <summary>
        /// Registriert einen einfacher Verbraucher für einen Datenstrom.
        /// </summary>
        /// <param name="pid">Die gewünschte Datenstromkennung.</param>
        /// <param name="isSITable">Gesetzt, wenn es sich um einen Kontroll- und keinen
        /// Nutzdatenstrom handelt.</param>
        /// <param name="callback"></param>
        public void SetFilter( ushort pid, bool isSITable, Action<byte[]> callback )
        {
            // Validate
            if (callback == null)
                throw new ArgumentNullException( "callback" );

            // Create
            TSBuilder consumer;
            if (isSITable)
                consumer = new SIBuilder( this, callback );
            else
                consumer = new PESBuilder( this, callback );

            // Remember
            RegisterCustomFilter( pid, consumer );
        }
Пример #2
0
        /// <summary>
        /// Beendet die Arbeit dieser Analyseinstanz endgültig.
        /// </summary>
        public void Dispose()
        {
            // PAT / PMT Builder
            lock (m_Consumers)
            {
                // PAT
                if (m_PATBuilder != null)
                    try
                    {
                        // Discard
                        m_PATBuilder.Dispose();
                    }
                    finally
                    {
                        // Forget
                        m_PATBuilder = null;
                    }

                // PMT
                if (m_PMTBuilder != null)
                    try
                    {
                        // Discard
                        m_PMTBuilder.Dispose();
                    }
                    finally
                    {
                        // Forget
                        m_PMTBuilder = null;
                    }
            }

            // To clear
            TSBuilder[] cleanup;
            lock (m_Consumers)
                try
                {
                    // Copy over
                    cleanup = m_Consumers.Values.ToArray();
                }
                finally
                {
                    // Clear
                    m_Extractors.Clear();
                    m_Consumers.Clear();
                }

            // Shutdown all
            foreach (var consumer in cleanup)
                consumer.Dispose();
        }
Пример #3
0
        /// <summary>
        /// Erzeugt eine neue Analyseinstanz für einen <i>Transport Stream</i>.
        /// </summary>
        public TSParser()
        {
            // Register
            m_PATParser.TableFound += OnPATFound;
            m_PMTParser.TableFound += OnPMTFound;

            // Install the analyser
            m_PATBuilder = new SIBuilder( this, m_PATParser.OnData );
            m_PMTBuilder = new SIBuilder( this, m_PMTParser.OnData );
        }