#include "ltmm.h"

C Syntax

HRESULT IltmmCapture_GetPreferredFilter(pCapture, FilterType, pVal)

C++ Syntax

HRESULT GetPreferredFilter(FilterType, pVal)

IltmmCapture *pCapture;

pointer to an interface

long FilterType

value of a filter type

BSTR *pVal;

pointer to a string

Retrieves the preferred filter display name set using IltmmCapture::SetPreferredFilter.




Pointer to an IltmmCapture interface.


Value that indicates the type of filter. For a list of possible values, refer to lltmmCapture_PreferredFilter Constants.


Pointer to a string to be updated with the filter's display name. For a list of possible values, refer to ltmmFilter Constants.



The function was successful.

<> S_OK

An error occurred. Refer to the Error Codes or the HRESULT error codes in the DirectShow documentation.


This method can be used to determine whether a preferred filter has been set by IltmmCapture::SetPreferredFilter. It will return NULL (if no preferred filter has been set) or a display name indicating the preferred filter.

A display name uniquely identifies a filter. Display names for filters have the following format: @device:sw:GUID\GUID.

For example, the display name for the LEAD H.264 Decoder is:


Note that there is a single backslash between the two GUIDs. But if you enter this as a C/C++ string, you would need to use two backslashes since '\' is an escape character in C/C++ strings.

If the method succeeds, the caller must free the returned string by calling the SysFreeString function.

A list of display names for common LEAD filters can be found in ltmmFilter Constants.

Please see IltmmCapture::SetPreferredFilter for more information on filter display names.

Required DLLs and Libraries


For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


Win32, x64

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Multimedia C API Help