Exemplo n.º 1
0
        /// <summary>
        /// Process an MPEG2 section from the MediaHighway1 summary table.
        /// </summary>
        /// <param name="byteData">The MPEG2 section.</param>
        /// <returns>A MediaHighway2SummarySection instance.</returns>
        public static MediaHighway2SummarySection ProcessMediaHighwaySummaryTable(byte[] byteData)
        {
            Mpeg2BasicHeader mpeg2Header = new Mpeg2BasicHeader();

            try
            {
                mpeg2Header.Process(byteData);

                MediaHighway2SummarySection summarySection = new MediaHighway2SummarySection();
                bool process = summarySection.Process(byteData, mpeg2Header.Index);
                if (process)
                {
                    summarySection.LogMessage();
                    return(summarySection);
                }
                else
                {
                    return(null);
                }
            }
            catch (ArgumentOutOfRangeException e)
            {
                Logger.Instance.Write("<e> Summary section parsing failed: " + e.Message);
                return(null);
            }
        }
        private void processSummarySections(Collection <Mpeg2Section> sections)
        {
            foreach (Mpeg2Section section in sections)
            {
                if (RunParameters.Instance.TraceIDs.Contains("DUMPSUMMARYSECTIONS"))
                {
                    Logger.Instance.Dump("Summary Section", section.Data, section.Length);
                }

                MediaHighway2SummarySection summarySection = MediaHighway2SummarySection.ProcessMediaHighwaySummaryTable(section.Data);
                if (summarySection != null && summarySection.SummaryData != null)
                {
                    MediaHighwaySummary summary = new MediaHighwaySummary();
                    summary.EventID          = summarySection.SummaryData.EventID;
                    summary.ShortDescription = summarySection.SummaryData.ShortDescription;
                    summary.Unknown          = summarySection.SummaryData.Unknown;
                    MediaHighwaySummary.AddSummary(summary);
                }
            }
        }
        /// <summary>
        /// Process an MPEG2 section from the MediaHighway1 summary table.
        /// </summary>
        /// <param name="byteData">The MPEG2 section.</param>
        /// <returns>A MediaHighway2SummarySection instance.</returns>
        public static MediaHighway2SummarySection ProcessMediaHighwaySummaryTable(byte[] byteData)
        {
            Mpeg2BasicHeader mpeg2Header = new Mpeg2BasicHeader();

            try
            {
                mpeg2Header.Process(byteData);

                MediaHighway2SummarySection summarySection = new MediaHighway2SummarySection();
                bool process = summarySection.Process(byteData, mpeg2Header.Index);
                if (process)
                {
                    summarySection.LogMessage();
                    return (summarySection);
                }
                else
                    return (null);
            }
            catch (ArgumentOutOfRangeException e)
            {
                Logger.Instance.Write("<e> Summary section parsing failed: " + e.Message);
                return (null);
            }
        }