MP3 Decoder Sink

This module contains an element capable of decoding MP3 streams, also known as ISO/IEC 11172-3 Layer 3 streams. The element decodes the stream to PCM which is pushed to the audio decoder provided by the Hardware Abstraction Layer (HAL) through the Hardware Abstraction Interface (HAI).

Loadable Module Properties

Module Name Streamer MP3 Sink Element
File Name libmp3element.so
Class Count 1

Element Quick Index

Mp3 Sink.

MP3 Sink in typical Audio Elementary Stream pipeline.

Generic Pipeline-wide HAL Access Negotiation

All elements that wish to use HAL decoder resources must coordinate their HAL access. The element in this module participate in such a coordination by obeying to the generic pipeline-wide HAL access negotiation rules described in this section.

ES Audio Layer 3 Sink Element

The ES Audio Layer 3 Sink Element decodes the stream and pushes the resulting stream of PCM samples to the HAI Audio Decoder.

Class Properties

Name ES Audio Layer 3 Sink Descriptor
Version1
Interface Name IElementDescriptor
Binding C++

Element Descriptor

Name Mp3 Sink
TypeSink
Priority500
Input Formats MPEG-1/Audio Elementary Stream/Layer3
Output Formats (none)
Trait AudioSink

Metadata

Key Input Output
_ActiveAudioStreamRequiredPublished

Theory of Operation

On ISink::Activate(), it opens the HAI AudioDecoder resource instance 0 (zero) in exclusive mode. The HAI resource is closed on ISink::Deactivate().

The element sets the MP3 decoder destination buffer as the buffer area used for stream payload data. When data arrives on the input pad, the element copies it to an internal buffer and releases the consumed data from the segment stream. It then decodes as much of it as possible and push the decoded PCM samples to the HAL audio decoder.

The Block() and Unblock() methods in the ISink interface implemented by the element will translate into Run and Halt operations, respectively, on the HAI audio decoder. When the element receives a call to ISink::Flush() it will issue a flush operation to the HAI decoder to remove all payload pending in the decoder input queue, it will clear all internal buffers and then it will release all segments pending on the input pad of the element.