// This function does the following:
// 1) Sets all filters to LEAD Default filters
// 2) Then resets all preferred filters to NULL, or does not use any preferred filter.
// 3) Then sets the LEAD H264 Decoder (3.0) as the LEAD H264 Preferred Decompressor using its Friendly Name
// 4) Gets the preferred H.264 Decompressor display name
void TestSetPreferredFilter(IltmmConvert *pConvert)
{
HRESULT hr = S_OK;
BSTR bstr = NULL;
// Set all filters to LEAD Default filters
bstr = SysAllocString(ltmmFilter_LEADDefault);
hr = pConvert->SetPreferredFilter(ltmmConvert_PreferredFilter_Generic, bstr);
// free the bstr
SysFreeString(bstr);
// Reset all the preferred filters to NULL, or don't use any preferred filter.
bstr = SysAllocString(ltmmFilter_DontCare);
hr = pConvert->SetPreferredFilter(ltmmConvert_PreferredFilter_Generic, bstr);
// free the bstr
SysFreeString(bstr);
// Set the H.264 Decompressor to the LEAD H264 Decoder (3.0), using the Friendly Name
bstr = SysAllocString(L"LEAD H264 Decoder (3.0)");
hr = pConvert->SetPreferredFilter(ltmmConvert_PreferredFilter_H264Decompressor, bstr);
// free the bstr
SysFreeString(bstr);
// Get the preferred H.264 Decompressor
bstr = NULL;
hr = pConvert->GetPreferredFilter(ltmmConvert_PreferredFilter_H264Decompressor, &bstr);
// check that the preferred filter is the LEAD H264 decoder
if(bstr != NULL && !_wcsicmp(bstr, ltmmFilter_LEAD_H264Decompressor))
MessageBox(NULL, TEXT("The preferred filter was set properly!"), TEXT("SUCCESS"), MB_OK);
else
MessageBox(NULL, TEXT("The preferred filter was not set properly!"), TEXT("FAILURE"), MB_OK);
// free the bstr
SysFreeString(bstr);
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document