Windows Dev Center

IMFTrackedSample::SetAllocator Method

Sets the owner for the sample.

Syntax

HRESULT SetAllocator(
  [in]  IMFAsyncCallback *pSampleAllocator,
  [in]  IUnknown *pUnkState
);

Parameter

pSampleAllocator [in]

Pointer to the IMFAsyncCallback interface of a callback object. The caller must implement this interface.

pUnkState [in]

Pointer to the IUnknown interface of a state object, defined by the caller. This parameter can be NULL. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

Rückgabewert

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

RückgabecodeBeschreibung
S_OK

The method succeeded.

MF_E_NOTACCEPTING

The owner was already set. This method cannot be called twice on the sample.

 

Hinweise

When this method is called, the sample holds an additional reference count on itself. When every other object releases its reference counts on the sample, the sample invokes the pSampleAllocator callback method. To get a pointer to the sample, call IMFAsyncResult::GetObject on the asynchronous result object given to the callback's IMFAsyncCallback::Invoke method.

After the callback is invoked, the sample clears the callback. To reinstate the callback, you must call SetAllocator again.

It is safe to pass in the sample's IMFSample interface pointer as the state object (pUnkState) for the callback. If pUnkState points to the sample, the SetAllocator method accounts for the additional reference count on pUnkState.

Anforderungen

Mindestens unterstützter Client

Windows Vista

Mindestens unterstützter Server

Windows Server 2008

Header

Evr.h

Bibliothek

Strmiids.lib

Siehe auch

IMFTrackedSample

 

 

Anzeigen:
© 2015 Microsoft