コード例 #1
0
 public void OnCarrierDefinition(AtscTransmissionMedium transmissionMedium, byte index, int carrierFrequency)
 {
     if (transmissionMedium != AtscTransmissionMedium.Cable)
     {
         return;
     }
     if (carrierFrequency > 1750)
     {
         // Convert from centre frequency to the analog video carrier frequency.
         // This is a BDA convention.
         PhysicalChannel channel = new PhysicalChannel();
         channel.Frequency          = carrierFrequency - 1750;
         channel.Channel            = ATSCChannel.GetPhysicalChannelFromFrequency(carrierFrequency);
         _carrierFrequencies[index] = channel;
     }
 }
コード例 #2
0
        /// <summary>
        /// Creates the new channel.
        /// </summary>
        /// <param name="channel">The high level tuning detail.</param>
        /// <param name="info">The subchannel detail.</param>
        /// <returns>The new channel.</returns>
        protected override IChannel CreateNewChannel(IChannel channel, ChannelInfo info)
        {
            ATSCChannel tuningChannel = (ATSCChannel)channel;
            ATSCChannel atscChannel   = new ATSCChannel();

            // When scanning with a CableCARD tuner and/or NIT or VCT frequency info
            // has been received and it looks plausible...
            if (tuningChannel.PhysicalChannel == 0 ||
                (info.freq > 1750 && tuningChannel.Frequency > 0 && info.freq != tuningChannel.Frequency))
            {
                atscChannel.PhysicalChannel = ATSCChannel.GetPhysicalChannelFromFrequency(info.freq);
                // Convert from centre frequency to the analog video carrier
                // frequency. This is a BDA convention.
                atscChannel.Frequency = info.freq - 1750;
            }
            else
            {
                atscChannel.PhysicalChannel = tuningChannel.PhysicalChannel;
                atscChannel.Frequency       = tuningChannel.Frequency;
            }
            if (info.minorChannel == 0)
            {
                atscChannel.LogicalChannelNumber = info.majorChannel;
            }
            else
            {
                atscChannel.LogicalChannelNumber = (info.majorChannel * 1000) + info.minorChannel;
            }
            atscChannel.Name           = info.service_name;
            atscChannel.Provider       = info.service_provider_name;
            atscChannel.ModulationType = tuningChannel.ModulationType;
            atscChannel.MajorChannel   = info.majorChannel;
            atscChannel.MinorChannel   = info.minorChannel;
            atscChannel.IsTv           = IsTvService(info.serviceType);
            atscChannel.IsRadio        = IsRadioService(info.serviceType);
            atscChannel.NetworkId      = info.networkID;
            atscChannel.ServiceId      = info.serviceID;
            atscChannel.TransportId    = info.transportStreamID;
            atscChannel.PmtPid         = info.network_pmt_PID;
            atscChannel.FreeToAir      = !info.scrambled;
            Log.Log.Write("atsc:Found: {0}", atscChannel);
            return(atscChannel);
        }
コード例 #3
0
        /// <summary>
        /// Creates the new channel.
        /// </summary>
        /// <param name="channel">The high level tuning detail.</param>
        /// <param name="info">The subchannel detail.</param>
        /// <returns>The new channel.</returns>
        protected override IChannel CreateNewChannel(IChannel channel, ChannelInfo info)
        {
            ATSCChannel tuningChannel = (ATSCChannel)channel;
            ATSCChannel atscChannel   = new ATSCChannel();

            if (tuningChannel.PhysicalChannel == 0) // ie. digital cable CableCARD tuner scan
            {
                atscChannel.PhysicalChannel = ATSCChannel.GetPhysicalChannelFromFrequency(info.freq);
                atscChannel.Frequency       = info.freq;
            }
            else
            {
                atscChannel.PhysicalChannel = tuningChannel.PhysicalChannel;
                atscChannel.Frequency       = tuningChannel.Frequency;
            }
            if (info.minorChannel == 0)
            {
                atscChannel.LogicalChannelNumber = info.majorChannel;
            }
            else
            {
                atscChannel.LogicalChannelNumber = (info.majorChannel * 1000) + info.minorChannel;
            }
            atscChannel.Name           = info.service_name;
            atscChannel.Provider       = info.service_provider_name;
            atscChannel.ModulationType = tuningChannel.ModulationType;
            atscChannel.MajorChannel   = info.majorChannel;
            atscChannel.MinorChannel   = info.minorChannel;
            atscChannel.IsTv           = IsTvService(info.serviceType);
            atscChannel.IsRadio        = IsRadioService(info.serviceType);
            atscChannel.NetworkId      = info.networkID;
            atscChannel.ServiceId      = info.serviceID;
            atscChannel.TransportId    = info.transportStreamID;
            atscChannel.PmtPid         = info.network_pmt_PID;
            atscChannel.FreeToAir      = !info.scrambled;
            Log.Log.Write("atsc:Found: {0}", atscChannel);
            return(atscChannel);
        }
コード例 #4
0
        public void OnLvctChannelDetail(MgtTableType tableType, string shortName, int majorChannelNumber, int minorChannelNumber,
                                        ModulationMode modulationMode, uint carrierFrequency, int channelTsid, int programNumber, EtmLocation etmLocation,
                                        bool accessControlled, bool hidden, int pathSelect, bool outOfBand, bool hideGuide, AtscServiceType serviceType, int sourceId)
        {
            if (programNumber == 0 || outOfBand || modulationMode == ModulationMode.Analog || modulationMode == ModulationMode.PrivateDescriptor ||
                (serviceType != AtscServiceType.Audio && serviceType != AtscServiceType.DigitalTelevision) || sourceId == 0)
            {
                // Not tunable/supported.
                return;
            }

            ATSCChannel channel = null;

            if (_channels.TryGetValue(sourceId, out channel))
            {
                Log.Log.Info("DRI CC: received repeated L-VCT channel detail for source 0x{0:x}", sourceId);
                return;
            }

            channel = new ATSCChannel();
            _channels.Add(sourceId, channel);

            carrierFrequency /= 1000; // Hz => kHz
            if (carrierFrequency > 1750)
            {
                // Convert from centre frequency to the analog video carrier
                // frequency. This is a BDA convention.
                channel.Frequency = carrierFrequency - 1750;
            }
            channel.PhysicalChannel = ATSCChannel.GetPhysicalChannelFromFrequency((int)carrierFrequency);

            switch (modulationMode)
            {
            case ModulationMode.Atsc8Vsb:
                channel.ModulationType = ModulationType.Mod8Vsb;
                break;

            case ModulationMode.Atsc16Vsb:
                channel.ModulationType = ModulationType.Mod16Vsb;
                break;

            case ModulationMode.ScteMode1:
                channel.ModulationType = ModulationType.Mod64Qam;
                break;

            default:
                channel.ModulationType = ModulationType.Mod256Qam;
                break;
            }
            channel.FreeToAir = !accessControlled;
            channel.IsTv      = (serviceType == AtscServiceType.DigitalTelevision);
            channel.IsRadio   = (serviceType == AtscServiceType.Audio);
            if (minorChannelNumber == 0)
            {
                channel.LogicalChannelNumber = majorChannelNumber;
            }
            else
            {
                channel.LogicalChannelNumber = (majorChannelNumber * 1000) + minorChannelNumber;
            }
            channel.Name = shortName;
            if (tableType == MgtTableType.TvctCurrentNext1 || tableType == MgtTableType.TvctCurrentNext0)
            {
                channel.Provider = "Terrestrial";
            }
            else
            {
                channel.Provider = "Cable";
            }
            channel.NetworkId   = sourceId;
            channel.PmtPid      = 0; // TV Server will automatically lookup the correct PID from the PAT
            channel.ServiceId   = programNumber;
            channel.TransportId = channelTsid;
        }