共用方式為


IMpeg2Stream::SupplyDataBuffer

 
Microsoft DirectShow 9.0

IMpeg2Stream::SupplyDataBuffer

The SupplyDataBuffer method provides a buffer for the Mpeg2Stream object to write data.

Syntax

  HRESULT SupplyDataBuffer(
  PMPEG_STREAM_BUFFER  pStreamBuffer
);

Parameters

pStreamBuffer

[in]  Pointer to an MPEG_STREAM_BUFFER structure allocated by the caller. This structure contains a pointer to the buffer, also allocated by the caller. The buffer must be at least 4096 bytes.

Return Values

The method returns an HRESULT. Possible values include those in the following table.

Return code Description
S_OK The method succeeded.
E_INVALIDARG Invalid argument or NULL parameter.
E_OUTOFMEMORY Insufficient memory.
E_FAIL Failure.

Remarks

The first time this method is called, it starts a worker thread that streams data to the buffer. When the data arrives, the MPEG2Stream object signals the event that was passed to the IMpeg2Stream::Initialize method. (Typically an application specifies the event handle when it calls IMpeg2Data::GetStreamOfSections.)

When the event is signaled, examine the hr field of the MPEG_STREAM_BUFFER structure. If this value is a success code, the request was successful and the buffer contains valid data. To get more data, call the SupplyDataBuffer method again and wait for the event to be signaled.

The section headers are not converted from network byte order or otherwise processed.

If the object is still waiting for data, this method returns E_FAIL.

Requirements

Header: Include Mpeg2data.h.

See Also