Esempio n. 1
0
        /// <summary>
        /// Process an MPEG2 section from the network information table.
        /// </summary>
        /// <param name="byteData">The MPEG2 section.</param>
        /// <returns>A Network Information section instance.</returns>
        public static NetworkInformationSection ProcessNetworkInformationTable(byte[] byteData)
        {
            Mpeg2ExtendedHeader mpeg2Header = new Mpeg2ExtendedHeader();

            try
            {
                mpeg2Header.Process(byteData);

                if (mpeg2Header.Current)
                {
                    NetworkInformationSection networkInformationSection = new NetworkInformationSection();
                    networkInformationSection.Process(byteData, mpeg2Header);

                    if (RunParameters.Instance.DebugIDs.Contains("NITSECTIONS"))
                    {
                        networkInformationSection.LogMessage();
                    }

                    return(networkInformationSection);
                }
            }
            catch (ArgumentOutOfRangeException e)
            {
                Logger.Instance.Write("<e> Error processing Network Information Section message: " + e.Message);
            }

            return(null);
        }
        /// <summary>
        /// Process an MPEG2 section from the network information table.
        /// </summary>
        /// <param name="byteData">The MPEG2 section.</param>
        /// <returns>A Network Information section instance.</returns>
        public static NetworkInformationSection ProcessNetworkInformationTable(byte[] byteData)
        {
            Mpeg2ExtendedHeader mpeg2Header = new Mpeg2ExtendedHeader();

            try
            {
                mpeg2Header.Process(byteData);

                if (mpeg2Header.Current)
                {
                    NetworkInformationSection networkInformationSection = new NetworkInformationSection();
                    networkInformationSection.Process(byteData, mpeg2Header);

                    if (RunParameters.Instance.DebugIDs.Contains("NITSECTIONS"))
                        networkInformationSection.LogMessage();

                    return (networkInformationSection);
                }
            }
            catch (ArgumentOutOfRangeException e)
            {
                Logger.Instance.Write("<e> Error processing Network Information Section message: " + e.Message);
            }

            return (null);
        }