Exemple #1
0
        /// <summary>
        /// Log the fields.
        /// </summary>
        public void LogMessage()
        {
            if (Logger.ProtocolLogger == null)
            {
                return;
            }

            Logger.ProtocolLogger.Write(Logger.ProtocolIndent + "EVENT INFORMATION TABLE ENTRY: Event ID: " + eventID +
                                        " Start time: " + startTime +
                                        " ETM loc: " + etmLocation +
                                        " Duration: " + duration);

            if (eventName != null)
            {
                Logger.IncrementProtocolIndent();
                eventName.LogMessage();
                Logger.DecrementProtocolIndent();
            }

            if (descriptors != null)
            {
                Logger.IncrementProtocolIndent();

                foreach (DescriptorBase descriptor in descriptors)
                {
                    descriptor.LogMessage();
                }

                Logger.DecrementProtocolIndent();
            }
        }
        /// <summary>
        /// Log the fields.
        /// </summary>
        public void LogMessage()
        {
            if (Logger.ProtocolLogger == null)
            {
                return;
            }

            Logger.ProtocolLogger.Write(Logger.ProtocolIndent + "EXTENDED TEXT TABLE ENTRY: Source ID: " + sourceID +
                                        " Event ID: " + eventID);

            Logger.IncrementProtocolIndent();
            text.LogMessage();
            Logger.DecrementProtocolIndent();
        }
        /// <summary>
        /// Parse the descriptor.
        /// </summary>
        /// <param name="byteData">The mpeg2 section containing the descriptor.</param>
        /// <param name="index">Index of the byte in the mpeg2 section following the descriptor length.</param>
        internal void Process(byte[] byteData, int index)
        {
            lastIndex = index;

            try
            {
                int nameLength = (int)byteData[lastIndex];
                lastIndex++;

                if (nameLength != 0)
                {
                    name = new MultipleString();
                    name.Process(byteData, lastIndex);
                    name.LogMessage();

                    lastIndex = name.Index;
                }

                graduatedScale = ((byteData[lastIndex] & 0x10) != 0);

                int valueCount = byteData[lastIndex] & 0x0f;
                lastIndex++;

                if (valueCount != 0)
                {
                    values = new Collection <RatingRegionValue>();

                    while (valueCount != 0)
                    {
                        RatingRegionValue value = new RatingRegionValue();
                        value.Process(byteData, lastIndex);
                        values.Add(value);

                        lastIndex = value.Index;
                        valueCount--;
                    }
                }

                Validate();
            }
            catch (IndexOutOfRangeException)
            {
                throw (new ArgumentOutOfRangeException("The PSIP Rating Region Dimension message is short"));
            }
        }
        /// <summary>
        /// Parse the descriptor.
        /// </summary>
        /// <param name="byteData">The mpeg2 section containing the descriptor.</param>
        /// <param name="index">Index of the byte in the mpeg2 section following the descriptor length.</param>
        internal void Process(byte[] byteData, int index)
        {
            lastIndex = index;

            try
            {
                int abbreviatedTextLength = (int)byteData[lastIndex];
                lastIndex++;

                if (abbreviatedTextLength != 0)
                {
                    abbreviatedText = new MultipleString();
                    abbreviatedText.Process(byteData, lastIndex);
                    abbreviatedText.LogMessage();

                    lastIndex = abbreviatedText.Index;
                }

                int fullTextLength = (int)byteData[lastIndex];
                lastIndex++;

                if (fullTextLength != 0)
                {
                    fullText = new MultipleString();
                    fullText.Process(byteData, lastIndex);
                    fullText.LogMessage();

                    lastIndex = fullText.Index;
                }

                Validate();
            }
            catch (IndexOutOfRangeException)
            {
                throw (new ArgumentOutOfRangeException("The PSIP Rating Region Value message is short"));
            }
        }
        /// <summary>
        /// Parse the descriptor.
        /// </summary>
        /// <param name="byteData">The mpeg2 section containing the descriptor.</param>
        /// <param name="index">Index of the byte in the mpeg2 section following the descriptor length.</param>
        /// <param name="region">The region being processed.</param>
        internal void Process(byte[] byteData, int index, int region)
        {
            lastIndex   = index;
            this.region = region;

            int nameLength = (int)byteData[lastIndex];

            lastIndex++;

            if (nameLength != 0)
            {
                name = new MultipleString();
                name.Process(byteData, lastIndex);
                name.LogMessage();

                lastIndex = name.Index;
            }

            int dimensionCount = (int)byteData[lastIndex];

            lastIndex++;

            if (dimensionCount != 0)
            {
                dimensions = new Collection <RatingRegionDimension>();

                while (dimensionCount != 0)
                {
                    RatingRegionDimension dimension = new RatingRegionDimension();
                    dimension.Process(byteData, lastIndex);

                    dimensions.Add(dimension);

                    lastIndex = dimension.Index;
                    dimensionCount--;
                }
            }

            int descriptorLoopLength = ((byteData[lastIndex] & 0x03) * 256) + (int)byteData[lastIndex + 1];

            lastIndex += 2;

            if (descriptorLoopLength != 0)
            {
                descriptors = new Collection <DescriptorBase>();

                while (descriptorLoopLength != 0)
                {
                    while (descriptorLoopLength != 0)
                    {
                        DescriptorBase descriptor = DescriptorBase.AtscInstance(byteData, lastIndex);
                        descriptors.Add(descriptor);

                        lastIndex             = descriptor.Index;
                        descriptorLoopLength -= descriptor.TotalLength;
                    }
                }
            }

            Validate();
        }
        /// <summary>
        /// Parse the descriptor.
        /// </summary>
        /// <param name="byteData">The mpeg2 section containing the descriptor.</param>
        /// <param name="index">Index of the byte in the mpeg2 section following the descriptor length.</param>
        internal void Process(byte[] byteData, int index)
        {
            lastIndex = index;

            try
            {
                int nameLength = (int)byteData[lastIndex];
                lastIndex++;

                if (nameLength != 0)
                {
                    name = new MultipleString();
                    name.Process(byteData, lastIndex);
                    name.LogMessage();

                    lastIndex = name.Index;
                }

                graduatedScale = ((byteData[lastIndex] & 0x10) != 0);

                int valueCount = byteData[lastIndex] & 0x0f;
                lastIndex++;

                if (valueCount != 0)
                {
                    values = new Collection<RatingRegionValue>();

                    while (valueCount != 0)
                    {
                        RatingRegionValue value = new RatingRegionValue();
                        value.Process(byteData, lastIndex);
                        values.Add(value);

                        lastIndex = value.Index;
                        valueCount--;
                    }
                }

                Validate();
            }
            catch (IndexOutOfRangeException)
            {
                throw (new ArgumentOutOfRangeException("The PSIP Rating Region Dimension message is short"));
            }
        }
        /// <summary>
        /// Parse the descriptor.
        /// </summary>
        /// <param name="byteData">The mpeg2 section containing the descriptor.</param>
        /// <param name="index">Index of the byte in the mpeg2 section following the descriptor length.</param>
        internal void Process(byte[] byteData, int index)
        {
            lastIndex = index;

            try
            {
                int abbreviatedTextLength  = (int)byteData[lastIndex];
                lastIndex++;

                if (abbreviatedTextLength != 0)
                {
                    abbreviatedText = new MultipleString();
                    abbreviatedText.Process(byteData, lastIndex);
                    abbreviatedText.LogMessage();

                    lastIndex = abbreviatedText.Index;
                }

                int fullTextLength = (int)byteData[lastIndex];
                lastIndex++;

                if (fullTextLength != 0)
                {
                    fullText = new MultipleString();
                    fullText.Process(byteData, lastIndex);
                    fullText.LogMessage();

                    lastIndex = fullText.Index;
                }

                Validate();
            }
            catch (IndexOutOfRangeException)
            {
                throw (new ArgumentOutOfRangeException("The PSIP Rating Region Value message is short"));
            }
        }
Exemple #8
0
        /// <summary>
        /// Parse the descriptor.
        /// </summary>
        /// <param name="byteData">The mpeg2 section containing the descriptor.</param>
        /// <param name="index">Index of the byte in the mpeg2 section following the descriptor length.</param>
        /// <param name="region">The region being processed.</param>
        internal void Process(byte[] byteData, int index, int region)
        {
            lastIndex = index;
            this.region = region;

            int nameLength = (int)byteData[lastIndex];
            lastIndex++;

            if (nameLength != 0)
            {
                name = new MultipleString();
                name.Process(byteData, lastIndex);
                name.LogMessage();

                lastIndex = name.Index;
            }

            int dimensionCount = (int)byteData[lastIndex];
            lastIndex++;

            if (dimensionCount != 0)
            {
                dimensions = new Collection<RatingRegionDimension>();

                while (dimensionCount != 0)
                {
                    RatingRegionDimension dimension = new RatingRegionDimension();
                    dimension.Process(byteData, lastIndex);

                    dimensions.Add(dimension);

                    lastIndex = dimension.Index;
                    dimensionCount--;
                }
            }

            int descriptorLoopLength = ((byteData[lastIndex] & 0x03) * 256) + (int)byteData[lastIndex + 1];
            lastIndex += 2;

            if (descriptorLoopLength != 0)
            {
                descriptors = new Collection<DescriptorBase>();

                while (descriptorLoopLength != 0)
                {
                    while (descriptorLoopLength != 0)
                    {
                        DescriptorBase descriptor = DescriptorBase.AtscInstance(byteData, lastIndex);
                        descriptors.Add(descriptor);

                        lastIndex = descriptor.Index;
                        descriptorLoopLength -= descriptor.TotalLength;
                    }
                }
            }

            Validate();
        }