反向移植stagefright和NuPlayer至Android 2.2 [英] Backport stagefright and NuPlayer to Android 2.2

查看:145
本文介绍了反向移植stagefright和NuPlayer至Android 2.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是要能在我的Andr​​oid应用程序播放实时视频流。流将超过RTSP / RTP。我不具备源无法控制;它看起来像RTP有效载荷不符合开发者指南中的要求视频编码建议的。具体地讲,下面的要求似乎由视频源被侵犯:

  

有关3GPP和MPEG-4容器中,MOOV原子必须precede任何MDAT原子,但一定要成功的ftyp原子

基本上,它看起来像我们得到的原始数据H264(不是裹着一个容器)。

现在,

  1. 在我无法播放使用的MediaPlayer 类此流在Android 2.2三星Galaxy Tab。
  2. 不过,我能发挥它在Android 2.3三星Galaxy S。
  3. 某些第三方应用程序(MX播放器)能够起到对2.2的Galaxy Tab相同的流为好。

在这两种情况下2和3所述,DDMS日志指出这样的事实,怯场框架正在内部使用,而在情况1中,PVP(即的OpenCore)中被使用。所有这一切使我得出这样的结论:

  1. 我流不能由框架的OpenCore播放。
  2. 在我的流可以使用Stagefright播放 - 即使是在Android 2.2

这让我想起了我的问题:

  

什么是移植stagefright至Android 2.2涉及?

另外,我注意到,在AOSP源较新的 NuPlayer 负责播放RTSP流了。问:

  
      
  1. 是否有可能在所有端口 NuPlayer 回老版本的Andr​​oid(2.2或2.3)?
  2.   
  3. 如果真是这样,我需要做的,可以使用它在我的应用程序?
  4.   

我知道我可以检查出的来源和使用NDK构建stagefright和NuPlayer(虽然我从来没有在NDK级)。我不知道是我的应用程序如何可以使用这个NuPlayer。

解决方案

我卡住了类似的问题,但我已经找到一个解决方案。需要修补系统build.prob文件。请看看我的问题,我也张贴了我的<一个href="http://stackoverflow.com/questions/9834882/how-to-play-multiple-video-files-simultaneously-in-one-layout-side-by-side-in-di">answer.

在默认情况下stagefright保持禁用build.prop文件。你必须启用它并重新启动您的设备。然后你就可以访问stagefright框架,它不支持您的要求。

有关在远程机TEST RTSP流媒体下载live555MediaServer.exe文件,并保存在同一个位置的一些媒体文件。打开live555MediaServer.exe文件。

使用下面的code -

 私有最终字符串RTSP_FILE =rtsp://形式&LT;远程计算机的IP&GT; /&LT;文件名&gt;中;

mVideoView.setVideoURI(Uri.parse(RTSP_FILE));
 

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 Stage Fright 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.

解决方案

I'm stuck similar problem, but I've found one solution. You have to patch system build.prob file. Please have a look my question and also I posted my answer.

By default stagefright is kept disable in build.prop file. You have to enable it and reboot your device. Then you can access stagefright framework which does support your requirements.

For RTSP streaming download live555MediaServer.exe file in your remote mechine and keep some media file in same location. Open live555MediaServer.exe file.

Use the following code -

private final String RTSP_FILE = "rtsp://<remote machine IP>/<file name>";

mVideoView.setVideoURI(Uri.parse(RTSP_FILE));

这篇关于反向移植stagefright和NuPlayer至Android 2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆