Friday, May 20, 2011

NuPlayer for HTTP live streaming

HTTP Live Streaming is separated from Stagefright on the recent release, which is basically another light-weighted playback engine, except it only supports the fixed container and codecs format currently.
It seems that the author really prefers rewriting than refactoring:)

Unlike Awesomeplayer, NuPlayer is built upon Stagefright's foundation classes, and leverages the Looper/Handlers mechanism to handle requests asynchronously by queuing them in a message loop, so there are less mutex/lock in place.


  • NuPlayer::Source is the parser module. Actually its interface looks like a combination of MediaExtractor and MediaSource, and it also makes seekTo as an explicit API now.
  • NuPlayer::Decoder connects to ACodec for AVC decoding, and to DecoderWrapper for AAC decoding, which in turn wrapps AAC software decoder in the OpenMAX style. ACodec is functionally similar as OMXCodec in Stagefright, besides the application of State pattern and passing MediaBuffers around with messages.
  • NuPlayer::Render is responsible for rendering audio and also controls when to post video buffers back to NativeWindow for A/V sync.

7 comments:

  1. Thanks for the detailed description. Can I ask where you found the source code to come up with the API flow control? I could not find it myself at the kernel.org website.

    ReplyDelete
  2. Thanks for the detailed description. I found it very useful. Could you please post details how rtsp streamig handled in android media framework

    ReplyDelete
  3. Hi, RTSP streaming is handled similarly as HLS in NuPlayer via RTSPSource, which implements NuPlayer::Source and leverages the same implementation as in Stagefright (media/libstagefright/rtsp/MyHandle.h, etc.). You can refer to my previous posts about RTSP:)

    ReplyDelete
  4. Can you advice how to force stagefright rtsp to use tcp transport instead of udp ?
    Thanks in advance!

    ReplyDelete
  5. Hi, I don't think there is an option in Stagefright to use tcp for payload transportation.
    You can add your own implementation if it's desired.

    ReplyDelete
  6. Live streaming is the latest fad on social media so make sure to get live with your audience from time to time.
    Live streaming would give you a more intimate space with your viewers and encourage them to interact with you more often. It would allow more personal interaction with your audience in real time.
    You can also share your live videos later, so that those who have missed out the live streaming can view them again. A tour of your business, a demonstration of your products or an interview with the creators are some of the possible content which can be created with a live video.
    Make sure to make the most out of the apps which allows you to go live directly from the blog.

    ReplyDelete
  7. Live streaming is the latest fad on social media so make sure to get live with your audience from time to time.
    Live streaming would give you a more intimate space with your viewers and encourage them to interact with you more often. It would allow more personal interaction with your audience in real time.
    You can also share your live videos later, so that those who have missed out the live streaming can view them again. A tour of your business, a demonstration of your products or an interview with the creators are some of the possible content which can be created with a live video.
    Make sure to make the most out of the apps which allows you to go live directly from the blog.

    ReplyDelete