Sets DirectShow filter Merit.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As FilterEnum
Dim Name As String
Dim Value As Integer
instance.SetMerit(Name, Value) |
Parameters
- Name
- string to the Display Name or Friendly Name of the filter. It is always preferred to use "Display Name" since it is unique and no two filters can have the same Display Name. On the contrary, two filters or more might have the same Friendly Name. In this case this function will work on the first filter it internally enumerate with the specified friendly name.
- Value
- A new merit value for the specified DirectShow filter.
Example
Visual Basic | Copy Code |
---|
Public _result As Boolean = False
Public _form As ConvertCtrlForm = New ConvertCtrlForm()
Public Sub FilterEnumMeritExample()
Try
' Create an object instance of FilterEnum
Dim filterEnum As FilterEnum = New FilterEnum
' Get LEAD H264 Decoder/Decompressor Merit
Dim currentMerit As Integer = filterEnum.GetMerit(Leadtools.Multimedia.Constants.PreferredFilters.H264Decompressor)
' Increase the value by "one"
Dim newMerit As Integer = currentMerit + 1
' Set the new merit value to LEAD H264 Decoder/Decompressor
filterEnum.SetMerit(Leadtools.Multimedia.Constants.PreferredFilters.H264Decompressor, newMerit)
' Get the merit value again
currentMerit = filterEnum.GetMerit(Leadtools.Multimedia.Constants.PreferredFilters.H264Decompressor)
' Check and see if the value has been set correctly
If currentMerit = newMerit Then
_result = True
Else
_result = False
End If
Catch e1 As Exception
_result = False
End Try
End Sub |
C# | Copy Code |
---|
public bool _result = false;
public ConvertCtrlForm _form = new ConvertCtrlForm();
public void FilterEnumMeritExample()
{
FilterEnum filterEnum = new FilterEnum();
try
{
// Get LEAD H264 Decoder/Decompressor Merit
int currentMerit = filterEnum.GetMerit(Constants.PreferredFilters.H264Decompressor);
// Increase the value by "one"
int newMerit = currentMerit + 1;
// Set the new merit value to LEAD H264 Decoder/Decompressor
filterEnum.SetMerit(Constants.PreferredFilters.H264Decompressor, newMerit);
// Get the merit value again
currentMerit = filterEnum.GetMerit(Constants.PreferredFilters.H264Decompressor);
// Check and see if the value has been set correctly
_result = (currentMerit == newMerit) ? true : false;
}
catch (Exception)
{
_result = false;
}
} |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7
See Also