HAI Sinks

This module contains elements for pushing audio and video to decoders provided by the Hardware Abstraction Layer (HAL) through the Hardware Abstraction Interface (HAI).

Loadable Module Properties

Module Name Streamer HAI Sink Elements
File Name libhaielements.so
Class Count2

Element Quick Index

Video Sink Element, Audio Sink Element.

HAI sink elements at end of typical 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.

Video Sink Element

The Video Sink Element pushes the stream data to the HAI Video Decoder.

Class Properties

Name Video Sink Descriptor
Version1
Interface Name IElementDescriptor
BindingC++

Element Descriptor

Name Video Sink
TypeSink
Priority500
Input Formats MPEG-[2/Transport|2/Program|1/System] Stream/Single Video
Output Formats (none)
Trait VideoSink

Metadata

Key Input Output
PES_STARTRequiredPublished
protectionOptionalPublished
_PlaybackModeRequiredPublished
_VideoStreamList OptionalPublished
_AudioStreamList OptionalPublished

Theory of Operation

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

The element tries to push the stream data to the decoder as soon as it arrives on the element input pad. It sets the entire streamer buffer area as the buffer area used for stream payload data. The element leaves all segments pending on the input pad and pushes the payload to the HAI decoder directly from its location in the segment list. When the decoder signals it has consumed some of the stream payload, the element releases the corresponding segments in the segment list.

When the element receives a _PlaybackMode metadata, it sets the playback mode of the HAI video decoder to HAI_VIDEO_IFRAME_PLAYBACK if the metadata value is fast forwarding or rewinding and HAI_VIDEO_NORMAL_PLAYBACK if the metadata value is playing.

The Block() and Unblock() methods in the ISink interface implemented by the element will translate into Run() and Halt() operations, respectively, on the HAI video 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 and then it will release all segments pending on the input pad of the element.

When the element receives a protection metadata it will set the copy protection mode of the HAI video decoder. A value of 0 will set HAI_VIDEO_PROTECT_NO_RESTRICTION, 1 will set HAI_VIDEO_PROTECT_COPYING_PERMITTED, 2 will set HAI_VIDEO_PROTECT_ONE_COPY_PERMITTED and 3 will set HAI_VIDEO_PROTECT_COPYING_RESTRICTED.

Audio Sink Element

The Audio Sink Element pushes the stream data to the HAI Audio Decoder.

Class Properties

Name Audio Sink Descriptor
Version1
Interface Name IElementDescriptor
BindingC++

Element Descriptor

Name Audio Sink
Type Sink
Priority500
Input Formats MPEG-[2/Transport|2/Program|1/System] Stream/Single Audio|
MPEG-1/Audio Elementary Stream/Layer[1|2]
Output Formats (none)
TraitAudioSink

Metadata

Key Input Output
PES_STARTOptionalPublished
_ActiveAudioStreamRequiredPublished
_VideoStreamList OptionalPublished
_AudioStreamList OptionalPublished

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 tries to push the stream data to the decoder as soon as it arrives on the element input pad. It sets the entire streamer buffer area as the buffer area used for stream payload data. The element leaves all segments pending on the input pad and pushes the payload to the HAI decoder directly from its location in the segment list. When the decoder signals it has consumed some of the stream payload, the element releases the corresponding segments in the segment list.

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 and then it will release all segments pending on the input pad of the element.