IMFSinkWriter::AddStream Method

Adds a stream to the sink writer.

Syntax

public:
HRESULT AddStream(
         IMFMediaType *pTargetMediaType,
         DWORD *pdwStreamIndex
)  

Parameters

pTargetMediaType
Type: IMFMediaType *

[in] A pointer to the IMFMediaType interface of a media type. This media type specifies the format of the samples that will be written to the file. It does not need to match the input format. To set the input format, call IMFSinkWriter::SetInputMediaType.

pdwStreamIndex
Type: DWORD *

[out] Receives the zero-based index of the new stream.

Return value

Type: HRESULT 

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

Refer to Media Foundation return codes.

Remarks

This interface is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.

Requirements

Header: Declared in mfreadwrite.h.