共用方式為


INSSBuffer4::GetPropertyByIndex method (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 GetPropertyByIndex method retrieves a buffer property, also called a data unit extension, that was set using INSSBuffer3::SetProperty. This method differs from INSSBuffer3::GetProperty in that, instead of accessing the property by name, it uses an index ranging from zero to one less than the total number of properties associated with the sample.

Syntax

HRESULT GetPropertyByIndex(
  [in]      DWORD dwBufferPropertyIndex,
  [out]     GUID  *pguidBufferProperty,
  [out]     void  *pvBufferProperty,
  [in, out] DWORD *pdwBufferPropertySize
);

Parameters

[in] dwBufferPropertyIndex

DWORD containing the buffer property index. This value will be between zero and one less than the total number of properties associated with the sample. You can retrieve the total number of properties by calling INSSBuffer4::GetPropertyCount.

[out] pguidBufferProperty

Pointer to a GUID specifying the type of buffer property.

[out] pvBufferProperty

Void pointer containing the value of the buffer property.

[in, out] pdwBufferPropertySize

Pointer to a DWORD containing the size of the value pointed to by pvBufferProperty. If you set pvBufferProperty to NULL, this value will be set to the required size in bytes of the buffer needed to store the property value.

Return value

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only],Windows Media Format 9 Series SDK, or later versions of the SDK
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wmsbuffer.h (include Wmsdk.h)
Library Wmvcore.lib; WMStubDRM.lib (if you use DRM)

See also

INSSBuffer4 Interface