示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DigitalDevices"/> class.
        /// </summary>
        /// <param name="tunerFilter">The tuner filter.</param>
        public DigitalDevices(IBaseFilter tunerFilter)
            : base(tunerFilter)
        {
            _CardName = String.Empty;

            FilterInfo fInfo;

            tunerFilter.QueryFilterInfo(out fInfo);

            // remarks: the better way of detection would be to check the DevicePath for matching parts
            // but I didn't find a way to access IMoniker interface for query DevicePath from its property bag from a IFilterGraph only.
            // see also TvCardDvdBase:
            // //DD components have a common device path part.
            //   if (!(capDevices[capIndex].DevicePath.ToLowerInvariant().Contains("fbca-11de-b16f-000000004d56")

            // check for all vendors names to support this hardware
            foreach (String vendor in VendorNames)
            {
                if (fInfo.achName.StartsWith(vendor))
                {
                    _CardName = vendor;
                    break;
                }
            }
            // nothing found?
            if (_CardName == String.Empty)
            {
                _isGenericBDAS = false; // if this is no DD card, don't try to handle generic BDAS here.
                return;
            }

            IEnumerable <IBaseFilter> nextFilters = FilterGraphTools.GetAllNextFilters(tunerFilter, PINNAME_BDA_TRANSPORT,
                                                                                       PinDirection.Output);

            foreach (IBaseFilter nextFilter in nextFilters)
            {
                FilterInfo filterInfo;
                nextFilter.QueryFilterInfo(out filterInfo);

                if (filterInfo.achName.ToLowerInvariant().Contains("common interface") && nextFilter is IKsControl)
                {
                    CiFilter          = nextFilter;
                    _isDigitalDevices = true;
                    Log.Log.Debug(FormatMessage(" Common Interface found!"));
                    break;
                }
            }
        }