MFCreateADTSMediaSink function (mfidl.h)

Creates an instance of the audio data transport stream (ADTS) media sink.

Syntax

HRESULT MFCreateADTSMediaSink(
  [in]  IMFByteStream *pTargetByteStream,
  [in]  IMFMediaType  *pAudioMediaType,
  [out] IMFMediaSink  **ppMediaSink
);

Parameters

[in] pTargetByteStream

A pointer to the IMFByteStream interface of a byte stream. The media sink writes the ADTS stream to this byte stream. The byte stream must be writable.

[in] pAudioMediaType

A pointer to the IMFMediaType interface. This parameter specifies the media type for the ADTS stream. The media type must contain the following attributes.

Attribute Value
MF_MT_MAJOR_TYPE MFMediaType_Audio
MF_MT_SUBTYPE MFAudioFormat_AAC
MF_MT_AAC_PAYLOAD_TYPE 0 (raw AAC) or 1 (ADTS)

[out] ppMediaSink

Receives a pointer to the IMFMediaSink interface. The caller must release the interface.

Return value

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

Remarks

The ADTS media sink converts Advanced Audio Coding (AAC) audio packets into an ADTS stream. The primary use for this media sink is to stream ADTS over a network. The output is not an audio file, but a stream of audio frames with ADTS headers.

The media sink can accept raw AAC frames (MF_MT_AAC_PAYLOAD_TYPE = 0) or ADTS packets (MF_MT_AAC_PAYLOAD_TYPE = 1). If the input is raw AAC, the media sink inserts an ADTS header at the start of each audio frame. If the input is ADTS packets, the media sink passes the packets through to the byte stream, without modification.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header mfidl.h
DLL Mf.dll

See also

Media Foundation Functions