Backport stagefright framework and NuPlayer to Android 2.2

207 views
Skip to first unread message

Kiran Rao

unread,
Apr 24, 2012, 4:39:47 AM4/24/12
to android-...@googlegroups.com
My requirement is to be able to play a live video stream in my Android app. The stream will be over RTSP/RTP. 
I have no control over the source; and it looks like the RTP payload does not meet the requirements outlined in the Developers Guide Video encoding recommendations. Specifically, the following requirement seems to be violated by the video source:

For 3GPP and MPEG-4 containers, the moov atom must precede any mdat atoms, but must succeed the ftyp atom

Basically, it looks like we get raw H264 data (not wrapped in a container).

Now, 

 1. I was not able to play this stream using the MediaPlayer class on an Android 2.2 Samsung Galaxy Tab.
 2. However, I was able to play it on an Android 2.3 Samsung Galaxy S.
 3. Some third-party apps (MX Player) were able to play the same stream on the 2.2 Galaxy Tab as well.

In both cases 2 and 3 above, the DDMS logs pointed to the fact that StageFright framework was being used internally, while in case 1, PVP (i.e, OpenCore) was being used. All this leads me to conclude that:

 1. My stream cannot be played by OpenCore framework.
 2. My stream can be played using Stagefright - even on Android 2.2

Which brings me to my question:

What does porting stagefright to Android 2.2 involve? 

Further, I noticed in the AOSP source that the newer NuPlayer is responsible for playing RTSP streams now. Question:

  1. Is it possible at all to port NuPlayer back to older versions of Android (2.2 or 2.3)?
  2. If so, what do I need to do to be able to use it in my app?

I am aware that I can check out the sources and use NDK to build stagefright and NuPlayer (although I have never worked at the NDK level). What I don't know is how my app can then use this NuPlayer.

Glenn Kasten

unread,
Apr 26, 2012, 1:21:27 PM4/26/12
to android-...@googlegroups.com
Stagefright was designed to run within mediaserver process.  It is not designed to be an app-level framework that you could easily pull into your app.

I'd recommend instead trying to re-format the incoming stream at app-level into a stream format that is supported by the platform for the version you're interested in.
Unfortunately 2.2 pre-dates my experience with Android, so I'm not familiar with what that would look like.
Reply all
Reply to author
Forward
0 new messages