本文整理汇总了C#中IBaseFilter.GetClassID方法的典型用法代码示例。如果您正苦于以下问题:C# IBaseFilter.GetClassID方法的具体用法?C# IBaseFilter.GetClassID怎么用?C# IBaseFilter.GetClassID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBaseFilter
的用法示例。
在下文中一共展示了IBaseFilter.GetClassID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMerit
private static Merit GetMerit(IBaseFilter filter)
{
Guid clsid;
int hr;
hr = filter.GetClassID(out clsid);
if (hr != 0)
{
return Merit.DoNotUse;
}
//check cache
if (_meritCache.ContainsKey(clsid))
{
return _meritCache[clsid];
}
//figure new value
try
{
RegistryKey filterKey =
Registry.ClassesRoot.OpenSubKey(@"CLSID\{083863F1-70DE-11d0-BD40-00A0C911CE86}\Instance\{" + clsid.ToString() +
@"}");
if (filterKey == null)
{
Log.Debug("Could not get merit value for clsid {0}, key not found!", clsid);
_meritCache[clsid] = Merit.DoNotUse;
return Merit.DoNotUse;
}
Byte[] filterData = (Byte[])filterKey.GetValue("FilterData", 0x0);
if (filterData == null || filterData.Length < 8)
{
return Merit.DoNotUse;
}
Byte[] merit = new Byte[4];
//merit is 2nd DWORD, reverse byte order
Array.Copy(filterData, 4, merit, 0, 4);
uint dwMerit = ReverseByteArrayToDWORD(merit);
_meritCache[clsid] = (Merit)dwMerit;
return (Merit)dwMerit;
}
catch (Exception e)
{
Log.Debug("Could not get merit value for clsid {0}. Error: {1}", clsid, e.Message);
return Merit.DoNotUse;
}
}
示例2: GetCodecInfo
CodecConfiguration.Codec? GetCodecInfo(IBaseFilter filter, string name)
{
Guid guid;
filter.GetClassID(out guid);
CodecConfiguration.Codec c = new CodecConfiguration.Codec() { CLSID = guid.ToString("B"), Name = name };
CodecConfiguration.CheckCodec(ref c);
return c;
}