IMFASFMultiplexer::ProcessSample method

Delivers input samples to the multiplexer.


HRESULT ProcessSample(
  WORD      wStreamNumber,
  IMFSample *pISample,
  LONGLONG  hnsTimestampAdjust



The stream number of the stream to which the sample belongs.


Pointer to the IMFSample interface of the input sample. The input sample contains the media data to be converted to ASF data packets. When possible, the time stamp of this sample should be accurate.


The adjustment to apply to the time stamp of the sample. This parameter is used if the caller wants to shift the sample time on pISample. This value should be positive if the time stamp should be pushed ahead and negative if the time stamp should be pushed back. This time stamp is added to sample time on pISample, and the resulting time is used by the multiplexer instead of the original sample time. If no adjustment is needed, set this value to 0.

Return Value

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

Return code Description
The method succeeded.
There are too many packets waiting to be retrieved from the multiplexer. Call IMFASFMultiplexer::GetNextPacket to get the packets.
The sample that was processed violates the bandwidth limitations specified for the stream in the ASF ContentInfo object. When this error is generated, the sample is dropped.
The value passed in wStreamNumber is invalid.
The presentation time of the input media sample is earlier than the send time.


The application passes samples to ProcessSample, and the ASF multiplexer queues them internally until they are ready to be placed into ASF packets. Call IMFASFMultiplexer::GetNextPacket to get the ASF data packet.

After each call to ProcessSample, call GetNextPacket in a loop to get all of the available data packets. For a code example, see Generating New ASF Data Packets.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wmcontainer.h
Library Mfuuid.lib

See Also

Generating New ASF Data Packets