共用方式為


INSSBuffer interface (wmsbuffer.h)

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The INSSBuffer interface is the basic interface of a buffer object. A buffer object is a wrapper around a memory buffer. The methods exposed by this interface are used to manipulate the buffer.

In both writing and reading ASF files, buffer objects are used to contain samples. Depending upon where you use a sample, you will obtain a reference to the INSSBuffer interface in one of three ways:

  • When passing samples to the writer, you can obtain buffer objects by calling IWMWriter::AllocateSample.
  • When you are receiving samples from the asynchronous reader, buffer objects are created automatically, and references to an INSSBuffer interface are passed with every call the reader makes to the IWMReaderCallback::OnSample callback method.
  • When you are receiving samples from the synchronous reader, a reference to an INSSBuffer interface is set with every call you make to IWMSyncReader::GetNextSample.

The following interfaces can be obtained by using the QueryInterface method of this interface.

Interface IID
INSSBuffer2 IID_INSSBuffer2
INSSBuffer3 IID_INSSBuffer3
INSSBuffer4 IID_INSSBuffer4

Inheritance

The INSSBuffer interface inherits from the IUnknown interface. INSSBuffer also has these types of members:

Methods

The INSSBuffer interface has these methods.

 
INSSBuffer::GetBuffer

The GetBuffer method retrieves the location of the buffer controlled by the buffer object.
INSSBuffer::GetBufferAndLength

The GetBufferAndLength method retrieves the location and size of the used portion of the buffer controlled by the buffer object.
INSSBuffer::GetLength

The GetLength method retrieves the size of the used portion of the buffer controlled by the buffer object.
INSSBuffer::GetMaxLength

The GetMaxLength method retrieves the maximum size to which a buffer can be set.
INSSBuffer::SetLength

The SetLength method specifies the size of the used portion of the buffer.

Requirements

Requirement Value
Target Platform Windows
Header wmsbuffer.h

See also

Buffer Object

Interfaces

Reading ASF Files

Writing ASF Files