Example #1
0
        /// <summary>
        /// Create an instance of the descriptor class for Dish Network 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>
        /// <param name="table">The table ID containing this descriptor.</param>
        /// <returns>A descriptor instance.</returns>
        internal static DescriptorBase DishNetworkInstance(byte[] byteData, int index, int table)
        {
            DescriptorBase descriptor;

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

            case DishNetworkShortEventDescriptorTag:
                descriptor = new DishNetworkShortEventDescriptor();
                break;

            case DishNetworkExtendedEventDescriptorTag:
                descriptor = new DishNetworkExtendedEventDescriptor();
                break;

            case DishNetworkSupplementaryDescriptorTag:
                descriptor = new DishNetworkSupplementaryDescriptor();
                break;

            case DishNetworkVCHIPDescriptorTag:
                descriptor = new DishNetworkVCHIPDescriptor();
                break;

            case DishNetworkSeriesDescriptorTag:
                descriptor = new DishNetworkSeriesDescriptor();
                break;

            case ContentDescriptorTag:
                descriptor = new DVBContentDescriptor();
                break;

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

            descriptor.table = table;

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

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

            descriptor.Process(byteData, index);

            return(descriptor);
        }
Example #2
0
        /// <summary>
        /// Create an instance of the descriptor class for Dish Network 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>
        /// <param name="table">The table ID containing this descriptor.</param>
        /// <returns>A descriptor instance.</returns>
        internal static DescriptorBase DishNetworkInstance(byte[] byteData, int index, int table)
        {
            DescriptorBase descriptor;

            switch ((int)byteData[index])
            {
                case DishNetworkRatingDescriptorTag:
                    descriptor = new DishNetworkRatingDescriptor();
                    break;
                case DishNetworkShortEventDescriptorTag:
                    descriptor = new DishNetworkShortEventDescriptor();
                    break;
                case DishNetworkExtendedEventDescriptorTag:
                    descriptor = new DishNetworkExtendedEventDescriptor();
                    break;
                case DishNetworkSupplementaryDescriptorTag:
                    descriptor = new DishNetworkSupplementaryDescriptor();
                    break;
                case DishNetworkVCHIPDescriptorTag:
                    descriptor = new DishNetworkVCHIPDescriptor();
                    break;
                case DishNetworkSeriesDescriptorTag:
                    descriptor = new DishNetworkSeriesDescriptor();
                    break;
                case ContentDescriptorTag:
                    descriptor = new DVBContentDescriptor();
                    break;
                default:
                    descriptor = new DescriptorBase();
                    break;
            }

            descriptor.table = table;

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

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

            descriptor.Process(byteData, index);

            return (descriptor);
        }