Partager via


ICaptureGraphBuilder2::FindInterface

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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_CATEGORY property set (see Pin Property Set).
    • NULL

    See Remarks for more information.

  • pType
    [in] Pointer to a GUID that specifies the major media type of an output pin, or NULL.
  • pf
    [in] Pointer to the IBaseFilter interface of 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 HRESULT value. 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 Interface pointer. 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 pCategory parameter is NULL, this method searches the entire graph for the requested interface. Starting from the filter specified by the pf parameter, 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 pCategory equals &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 pType parameter is ignored.
  • If pCategory equals &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 pType parameter is ignored.
  • If pCategory specifies 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 pType parameter. 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 Also

Reference

ICaptureGraphBuilder2 Interface
IBaseFilter Interface
IAMVideoCompression Interface
IAMStreamConfig Interface
IVideoWindow Interface
Media Types and Sub Types

Concepts

Pin Property Set