IMFSampleGrabberSinkCallback::OnProcessSample method (mfidl.h)

Called when the sample-grabber sink receives a new media sample.

Syntax

HRESULT OnProcessSample(
  [in] REFGUID    guidMajorMediaType,
  [in] DWORD      dwSampleFlags,
  [in] LONGLONG   llSampleTime,
  [in] LONGLONG   llSampleDuration,
  [in] const BYTE *pSampleBuffer,
  [in] DWORD      dwSampleSize
);

Parameters

[in] guidMajorMediaType

The major type that specifies the format of the data. For a list of possible values, see Major Media Types.

[in] dwSampleFlags

Reserved.

[in] llSampleTime

The presentation time for this sample, in 100-nanosecond units. If the sample does not have a presentation time, the value of this parameter is _I64_MAX.

[in] llSampleDuration

The duration of the sample, in 100-nanosecond units. If the sample does not have a duration, the value of this parameter is _I64_MAX.

[in] pSampleBuffer

A pointer to a buffer that contains the sample data.

[in] dwSampleSize

Size of the pSampleBuffer buffer, in bytes.

Return value

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

Remarks

If you use the sample-grabber sink in a playback topology, this method should return quickly, or it might interfere with playback. Do not block the thread, wait on events, or perform other lengthy operations inside this method.

Requirements

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

See also

IMFSampleGrabberSinkCallback