Skip to main content
IMFSampleOutputStream::BeginWriteSample method

Begins an asynchronous request to write a media sample to the stream.

Syntax


HRESULT BeginWriteSample(
  [in]  IMFSample *pSample,
  [in]  IMFAsyncCallback *pCallback,
  [in]  IUnknown *punkState
);

Parameters

pSample [in]

A pointer to the IMFSample interface of the sample.

pCallback [in]

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

punkState [in]

A 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.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

When the sample has been written to the stream, the callback object's IMFAsyncCallback::Invoke method is called. At that point, the caller should call IMFSampleOutputStream::EndWriteSample to complete the asynchronous request.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Mfobjects.h (include Mfidl.h)

See also

IMFSampleOutputStream