Windows Dev Center

IWMStreamConfig2::AddDataUnitExtension method

The AddDataUnitExtension method adds a data unit extension system to the stream. You can use data unit extension systems to attach custom data to samples in an output file.

Syntax


HRESULT AddDataUnitExtension(
  [in] GUID  guidExtensionSystemID,
  [in] WORD  cbExtensionDataSize,
  [in] BYTE  *pbExtensionSystemInfo,
  [in] DWORD cbExtensionSystemInfo
);

Parameters

guidExtensionSystemID [in]

A GUID that identifies the data unit extension system. This can be one of the predefined GUIDs listed in INSSBuffer3::SetProperty, or a GUID whose value is understood by a custom player application.

cbExtensionDataSize [in]

Size, in bytes, of the data unit extensions that will be attached to the packets in the stream. Set to 0xFFFF to specify data unit extensions of variable size. Each individual data unit extension can then be set to any size ranging from 0 to 65534.

pbExtensionSystemInfo [in]

Pointer to a byte buffer containing information about the data unit extension system. If you have no information, you can pass NULL. When passing NULL, cbExtensionSystemInfo must be zero.

cbExtensionSystemInfo [in]

Count of bytes in the buffer at pbExtensionSystemInfo. If you have no data unit extension system information, you can pass zero. When passing zero, pbExtensionSystemInfo must be NULL.

Return value

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

Return codeDescription
S_OK

The method succeeded.

E_INVALIDARG

cbExtensionSystemInfo specifies a non-zero value, but pbExtensionSystemInfo is NULL.

E_OUTOFMEMORY

The method cannot allocate memory to hold the new data unit extension.

 

Remarks

Passing the GUID of an existing data unit extension system does not cause an error. The old system is destroyed and replaced by the new one.

The new value will not take effect in the profile until you call IWMProfile::ReconfigStream.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Version

Windows Media Format 9 Series SDK, or later versions of the SDK

Header

Wmsdkidl.h (include Wmsdk.h)

Library

Wmvcore.lib;
WMStubDRM.lib (if you use DRM)

See also

IWMStreamConfig2 Interface
IWMStreamConfig2::GetDataUnitExtension

 

 

Community Additions

ADD
Show:
© 2015 Microsoft