IMFSinkWriter::WriteSample method

Delivers a sample to the sink writer.

Syntax


HRESULT WriteSample(
  [in]  DWORD dwStreamIndex,
  [in]  IMFSample *pSample
);

Parameters

dwStreamIndex [in]

The zero-based index of the stream for this sample.

pSample [in]

A pointer to the IMFSample interface of the sample.

Return value

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

Return codeDescription
S_OK

The method succeeded.

MF_E_INVALIDREQUEST

The request is invalid.

 

Remarks

You must call IMFSinkWriter::BeginWriting before calling this method. Otherwise, the method returns MF_E_INVALIDREQUEST.

By default, the sink writer limits the rate of incoming data by blocking the calling thread inside the WriteSample method. This prevents the application from delivering samples too quickly. To disable this behavior, set the MF_SINK_WRITER_DISABLE_THROTTLING attribute when you create the sink writer.

This interface is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.

Requirements

Minimum supported client

Windows 7, Windows Vista and Platform Update Supplement for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]

Header

Mfreadwrite.h

See also

Sink Writer
IMFSinkWriter

 

 

Community Additions

ADD
Show:
© 2014 Microsoft