Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This method searches the graph for a specified interface, starting from a specified filter. You can restrict the search to a section of the graph upstream or downstream of the filter, or restrict it to a particular pin category or media type.
Syntax
HRESULT FindInterface( const GUID* pCategory, const GUID* pType, IBaseFilter* pf, REFIID riid, void** ppint ); |
Parameters
- pCategory
-
[in] Pointer to a GUID that specifies the search criteria. See Remarks for more information. The following values are possible:
- &LOOK_UPSTREAM_ONLY
- &LOOK_DOWNSTREAM_ONLY
- A pin category from the
AMPROPERTY_PIN_CATEGORYproperty set (see
Pin Property
Set).
- NULL
See Remarks for more information.
- &LOOK_UPSTREAM_ONLY
- pType
-
[in] Pointer to a GUID that specifies the major media type of an output pin, or NULL.
- pf
-
[in] Pointer to the IBaseFilter interfaceof the filter. The method begins searching from this filter.
- riid
-
[in] Interface identifier (IID) of the interface to locate.
- ppint
-
[out] Address of a variable that receives the interface pointer. Be sure to release the retrieved interface pointer when you are done with the interface.
Return Value
Returns an HRESULTvalue. Possible values include the following.
Return Code | Description |
---|---|
S_OK |
Success. |
E_FAIL |
Failure. |
E_NOINTERFACE |
No such interface supported. |
E_POINTER |
NULL pointer argument. |
Remarks
In a capture graph, various filters and pins might expose interfaces for setting properties such as compression parameters ( IAMVideoCompression interface) or stream formats ( IAMStreamConfig interface). You can use this method to find an interface, without writing special code that traverses the graph.
Note: |
---|
Do not call this method to obtain an IVideoWindow Interfacepointer. Always query the filter graph manager for this interface. Otherwise, the filter graph manager will not respond correctly to changes in screen resolution and other events. |
If the pCategoryparameter is NULL, this method searches the entire graph for the requested interface. Starting from the filter specified by the pfparameter, it queries the following objects in the graph.
- The filter
- The filter's pins
- All the downstream filters, including their pins
- All the upstream filters, including their pins
You can restrict the search by setting the pCategory and pType parameters, as follows:
- If
pCategoryequals &LOOK_UPSTREAM_ONLY, the search starts
from the filter's input pins and continues upstream. It does not
include the filter or anything downstream from the filter. The
pTypeparameter is ignored.
- If
pCategoryequals &LOOK_DOWNSTREAM_ONLY, the search starts
from the filter's output pins and continues downstream. It does not
include the filter or anything upstream from the filter. The
pTypeparameter is ignored.
- If
pCategoryspecifies a pin category, the downstream portion of
the search is restricted to output pins on the filter that match
both the pin category and the media type given in the
pTypeparameter. In this case, the method also searches the
filter and everything upstream from the filter.
Pin categories are useful for finding pin interfaces on capture filters. For example, a capture filter might have separate pins for capture and preview. If you specify a pin category, you should also specify the media type, to make certain the method selects the correct filter and pin.
Some video capture filters have a video port pin (PIN_CATEGORY_VIDEOPORT) instead of a preview pin. If you specify PIN_CATEGORY_PREVIEW and MEDIATYPE_Video (see Media Types), the method treats any video port pins as preview pins. Your application does not have to test for this possibility.
DirectShow applications and DirectShow filters have different include file and link library requirements.
For more information, see Setting Up the Build Environment.
Requirements
Windows Embedded CE | Windows Embedded CE 6.0 and later |
Windows Mobile | Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later |
Note | Microsoft DirectShow applications and DirectShow filters have
different include file and Library requirements
For more information, see Setting Up the Build Environment See AlsoReferenceICaptureGraphBuilder2 InterfaceIBaseFilter Interface IAMVideoCompression Interface IAMStreamConfig Interface IVideoWindow Interface Media Types and Sub Types ConceptsPin Property Set |