MFCreateADTSMediaSink function
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
- pTargetByteStream [in]
-
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.
- pAudioMediaType [in]
-
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) - ppMediaSink [out]
-
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
|
Minimum supported client |
Windows 8 [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2012 [desktop apps only] |
|
Header |
|
|
DLL |
|
See also