CDynamicOutputPin.StartUsingOutputPin method

The StartUsingOutputPin method obtains access to the pin for a streaming operation.

Syntax

virtual HRESULT StartUsingOutputPin();

Parameters

This method has no parameters.

Return value

Returns an HRESULT value. Possible values include those shown in the following table.

Return code Description
S_OK
Success.
E_UNEXPECTED
Unexpected error.
VFW_E_STATE_CHANGED
The filter was stopped, or the pin has begun flushing.

Remarks

Call this method before calling any methods that deliver data to the connected input pin or that change the connection's media type. For example, this rule applies to the following methods:

Afterward, call the CDynamicOutputPin::StopUsingOutputPin method to release the access to the pin.

If the pin is blocked, StartUsingOutputPin waits for the pin to become unblocked. If the filter stops while the method is waiting, the method immediately returns VFW_E_STATE_CHANGED. The pin maintains a count of how many times StartUsingOutputPin has been called without a corresponding call to StopUsingOutputPin. If another thread tries to block the pin while this count is non-zero, the pin sets its blocking status to "pending." The pin becomes blocked once all of the streaming operations have completed, in the final call to StopUsingOutputPin.

Do not hold the CDynamicOutputPin::m_BlockStateLock critical section when you call this method. Otherwise, if the pin is blocked, it can never become unblocked, causing a deadlock.

Requirements

Header
Amfilter.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CDynamicOutputPin Class