コード例 #1
0
        /// <summary>
        /// Process an MPEG2 section from the service description table.
        /// </summary>
        /// <param name="byteData">The MPEG2 section.</param>
        /// <returns>A ServiceDescriptionSection instance.</returns>
        public static ServiceDescriptionSection ProcessServiceDescriptionTable(byte[] byteData)
        {
            if (RunParameters.Instance.DebugIDs.Contains("DUMPSDTBLOCK"))
            {
                Logger.Instance.Dump("Service Description Block", byteData, byteData.Length);
            }

            Mpeg2ExtendedHeader mpeg2Header = new Mpeg2ExtendedHeader();

            try
            {
                mpeg2Header.Process(byteData);

                if (mpeg2Header.Current)
                {
                    try
                    {
                        ServiceDescriptionSection serviceDescriptionSection = new ServiceDescriptionSection();
                        serviceDescriptionSection.Process(byteData, mpeg2Header);
                        serviceDescriptionSection.LogMessage();
                        return(serviceDescriptionSection);
                    }
                    catch (ArgumentOutOfRangeException e)
                    {
                        Logger.Instance.Write(e.Message);
                        return(null);
                    }
                }
            }
            catch (ArgumentOutOfRangeException e)
            {
                Logger.Instance.Write("<e> Error processing Service Description Section message: " + e.Message);
            }

            return(null);
        }
コード例 #2
0
        /// <summary>
        /// Process an MPEG2 section from the service description table.
        /// </summary>
        /// <param name="byteData">The MPEG2 section.</param>
        /// <returns>A ServiceDescriptionSection instance.</returns>
        public static ServiceDescriptionSection ProcessServiceDescriptionTable(byte[] byteData)
        {
            if (RunParameters.Instance.DebugIDs.Contains("DUMPSDTBLOCK"))
                Logger.Instance.Dump("Service Description Block", byteData, byteData.Length);

            Mpeg2ExtendedHeader mpeg2Header = new Mpeg2ExtendedHeader();

            try
            {
                mpeg2Header.Process(byteData);

                if (mpeg2Header.Current)
                {
                    try
                    {
                        ServiceDescriptionSection serviceDescriptionSection = new ServiceDescriptionSection();
                        serviceDescriptionSection.Process(byteData, mpeg2Header);
                        serviceDescriptionSection.LogMessage();
                        return (serviceDescriptionSection);
                    }
                    catch (ArgumentOutOfRangeException e)
                    {
                        Logger.Instance.Write(e.Message);
                        return (null);
                    }
                }
            }
            catch (ArgumentOutOfRangeException e)
            {
                Logger.Instance.Write("<e> Error processing Service Description Section message: " + e.Message);
            }

            return (null);
        }