Microsoft DirectX 8.0

IAMGraphStreams Interface

This interface provides methods for controlling the behavior of a filter graph that renders a live source. (A live source is one that streams data in real time, such as a capture device or a network broadcast). The Filter Graph Manager implements this interface.

Applications can call methods on this interface to specify how the graph handles latency and synchronization when rendering a live source. For more information, see Live Sources.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterfaceRetrieves pointers to supported interfaces.
AddRefIncrements the reference count.
ReleaseDecrements the reference count.
IAMGraphStreams methodsDescription
FindUpstreamInterfaceSearches upstream from the specified pin for a pin or filter that supports the specified interface.
SyncUsingStreamOffsetEnables or disables synchronization using time-stamp offsets.
SetMaxGraphLatencySets the maximum latency for the graph.

IAMGraphStreams::FindUpstreamInterface

IAMGraphStreams Interface

Searches upstream from the specified pin for a pin or filter that supports the specified interface.

Syntax

HRESULT FindUpstreamInterface(
    IPin *pPin,
    REFIID riid,
    void **ppvInterface,
    DWORD dwFlags 
);

Parameters

pPin
[in] Pointer to the IPin interface of the pin from which to begin searching.
riid
[in] Reference identifier of the interface to find.
ppvInterface
[out, iid_is(riid)] Address of a void pointer. If the method succeeds, this variable receives a pointer to the interface specified by riid.
dwFlags
[in] Combination of flags from the AM_INTF_SEARCH_FLAGS enumeration, specifying what to search (pins or filters).

Return Value

Returns one of the following HRESULT values.

E_NOINTERFACEInterface not found.
E_POINTERInvalid pointer.
S_OKSuccess.

IAMGraphStreams::SetMaxGraphLatency

IAMGraphStreams Interface

Sets the maximum latency for the graph. You must call the SyncUsingStreamOffset method before calling this method.

Syntax

HRESULT SetMaxGraphLatency( 
    REFERENCE_TIME rtMaxGraphLatency 
);

Parameters

rtMaxGraphLatency
[in] Reference time that specifies the maximum latency.

Return Value

Returns S_OK if successful. If SyncUsingStreamOffset was not called, the method returns E_FAIL. Otherwise, it returns another HRESULT value.

Remarks

At connection time, some live source filters use the maximum latency to determine the size of buffer to allocate. Calling this method before constructing the graph can help to ensure that sufficient buffers are allocated for the expected latency.

IAMGraphStreams::SyncUsingStreamOffset

IAMGraphStreams Interface

Enables or disables synchronization using time-stamp offsets.

Syntax

HRESULT SyncUsingStreamOffset( 
    BOOL bUseStreamOffset 
);

Parameters

bUseStreamOffset
[in] Boolean value indicating whether to use a time-stamp offset. If TRUE, live sources will use a time-stamp offset to synchronize streams.

Return Value

Returns an HRESULT value that depends on the implementation of the interface.

Remarks

By default, the filter graph does not attempt to synchronize live streams by means of time-stamp offsets. Call this method with a value of TRUE if you want the filter graph to determine the maximum latency in the graph and adjust time stamps accordingly. For more information, see IAMPushSource::SetStreamOffset.