示例#1
0
        /// <summary>
        /// Create an instance of the descriptor class for ATSC descriptors.
        /// </summary>
        /// <param name="byteData">The MPEG2 section containing the descriptor.</param>
        /// <param name="index">The index of the tag byte of the descriptor.</param>
        /// <returns>A descriptor instance.</returns>
        internal static DescriptorBase AtscInstance(byte[] byteData, int index)
        {
            DescriptorBase descriptor;

            switch ((int)byteData[index])
            {
            case AtscAC3AudioDescriptorTag:
                descriptor = new AC3AudioDescriptor();
                break;

            case AtscCaptionServiceDescriptorTag:
                descriptor = new CaptionServiceDescriptor();
                break;

            case AtscContentAdvisoryDescriptorTag:
                descriptor = new ContentAdvisoryDescriptor();
                break;

            case AtscExtendedChannelNameDescriptorTag:
                descriptor = new ExtendedChannelNameDescriptor();
                break;

            case AtscServiceLocationDescriptorTag:
                descriptor = new ServiceLocationDescriptor();
                break;

            case AtscGenreDescriptorTag:
                descriptor = new GenreDescriptor();
                break;

            default:
                descriptor = new DescriptorBase();
                break;
            }

            descriptor.tag = (int)byteData[index];
            index++;

            descriptor.length = (int)byteData[index];
            index++;

            descriptor.Process(byteData, index);

            return(descriptor);
        }
示例#2
0
        /// <summary>
        /// Create an instance of the descriptor class for ATSC descriptors.
        /// </summary>
        /// <param name="byteData">The MPEG2 section containing the descriptor.</param>
        /// <param name="index">The index of the tag byte of the descriptor.</param>
        /// <returns>A descriptor instance.</returns>
        internal static DescriptorBase AtscInstance(byte[] byteData, int index)
        {
            DescriptorBase descriptor;

            switch ((int)byteData[index])
            {
                case AtscAC3AudioDescriptorTag:
                    descriptor = new AC3AudioDescriptor();
                    break;
                case AtscCaptionServiceDescriptorTag:
                    descriptor = new CaptionServiceDescriptor();
                    break;
                case AtscContentAdvisoryDescriptorTag:
                    descriptor = new ContentAdvisoryDescriptor();
                    break;
                case AtscExtendedChannelNameDescriptorTag:
                    descriptor = new ExtendedChannelNameDescriptor();
                    break;
                case AtscServiceLocationDescriptorTag:
                    descriptor = new ServiceLocationDescriptor();
                    break;
                case AtscGenreDescriptorTag:
                    descriptor = new GenreDescriptor();
                    break;
                default:
                    descriptor = new DescriptorBase();
                    break;
            }

            descriptor.tag = (int)byteData[index];
            index++;

            descriptor.length = (int)byteData[index];
            index++;

            descriptor.Process(byteData, index);

            return (descriptor);
        }