Search code examples
androidstreamingstagefright

Stagefright - Streaming Playback Architecture


I am going through the streaming playback use case in Android Stagefright and quite not clear about the architecture and implementations.

I am requesting readers/experts to explain about the major components which are responsible for streaming use case. I heard about ACodec is being employed instead of OMXCodec to realize streaming playback.

What is the extra implementations/features supported by ACodec and why Stagefright didn't reuse OMXCodec.

Could you please point me the important links in Stagefright code.


Solution

  • For streaming, there are different scenarios handled differently by the Stagefright framework. Broadly, there are 2 players and corresponding factories viz., StagefrightPlayer and NuPlayer.

    StagefrightPlayer is employed as a default player, where as NuPlayer is employed for rtsp, m3u8 (MP3 playlist), sdp playback as implemented in the NuPlayerFactory.

    NuPlayer could also be employed when a system property is set to employ the same as the default player.

    StagefrightPlayer internally creates AwesomePlayer which handles http/https and Widevine streaming too.

    Now coming to ACodec and OMXCodec are pretty close to each other as they abstract an OMX component. ACodec is the underlying implementation of MediaCodec which is a modular interface exposed by Android in the recent releases.

    One point of difference though is that some new features such as prepending SPS/PPS to IDR in case of Miracast, Adaptive Playback etc are included only in ACodec and not in OMXCodec.