// 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 LEAD H264 Decoder (3.0) as LEAD H264 Preferred Decompressor using its Friendly Name
// 4) Gets the preferred H.264 Decompressor display name
void TestSetPreferredFilter(IltmmPlay *pPlay)
{
HRESULT hr = S_OK;
BSTR bstr = NULL;
// Setting all filters to LEAD Default filters
bstr = SysAllocString(ltmmFilter_LEADDefault);
hr = pPlay->SetPreferredFilter(ltmmPlay_PreferredFilter_Generic, bstr);
SysFreeString(bstr);
// Resets all the preferred filters to NULL, or don't use any preferred filter.
bstr = SysAllocString(ltmmFilter_DontCare);
hr = pPlay->SetPreferredFilter(ltmmPlay_PreferredFilter_Generic, bstr);
SysFreeString(bstr);
// Setting H.264 Decompressor to LEAD H264 Decoder (3.0), using the Friendly Name
bstr = SysAllocString(L"LEAD H264 Decoder (3.0)");
hr = pPlay->SetPreferredFilter(ltmmPlay_PreferredFilter_H264Decompressor, bstr);
SysFreeString(bstr);
// Gets the preferred H.264 Decompressor
bstr = NULL;
hr = pPlay->GetPreferredFilter(ltmmPlay_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