This module contains elements for pushing audio and video to decoders provided by the Hardware Abstraction Layer (HAL) through the Hardware Abstraction Interface (HAI).
Module Name | Streamer HAI Sink Elements |
---|---|
File Name | libhaielements.so |
Class Count | 2 |
Video Sink Element, Audio Sink Element.
HAI sink elements at end of typical pipeline.
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.
The Video Sink Element pushes the stream data to the HAI Video Decoder.
Name | Video Sink Descriptor |
---|---|
Version | 1 |
Interface Name | IElementDescriptor |
Binding | C++ |
Name | Video Sink |
---|---|
Type | Sink |
Priority | 500 |
Input Formats | MPEG-[2/Transport|2/Program|1/System] Stream/Single Video |
Output Formats | (none) |
Trait | VideoSink |
Key | Input | Output |
---|---|---|
PES_START | Required | Published |
protection | Optional | Published |
_PlaybackMode | Required | Published |
_VideoStreamList | Optional | Published |
_AudioStreamList | Optional | Published |
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.
The Audio Sink Element pushes the stream data to the HAI Audio Decoder.
Name | Audio Sink Descriptor |
---|---|
Version | 1 |
Interface Name | IElementDescriptor |
Binding | C++ |
Name | Audio Sink |
---|---|
Type | Sink |
Priority | 500 |
Input Formats |
MPEG-[2/Transport|2/Program|1/System] Stream/Single Audio| MPEG-1/Audio Elementary Stream/Layer[1|2] |
Output Formats | (none) |
Trait | AudioSink |
Key | Input | Output |
---|---|---|
PES_START | Optional | Published |
_ActiveAudioStream | Required | Published |
_VideoStreamList | Optional | Published |
_AudioStreamList | Optional | Published |
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.